ochanticipy.datasources.chirps package¶
Submodules¶
ochanticipy.datasources.chirps.chirps module¶
Class to download and load CHIRPS observational precipitation data.
- class ochanticipy.datasources.chirps.chirps.ChirpsDaily(country_config: CountryConfig, geo_bounding_box: GeoBoundingBox, resolution: float = 0.05, start_date: date | str | None = None, end_date: date | str | None = None)[source]¶
Bases:
_ChirpsClass object to retrieve CHIRPS observational monthly precipitation data.
- Parameters:
country_config (CountryConfig) – Country configuration
geo_bounding_box (GeoBoundingBox) – the bounding coordinates of the area that should be included in the data.
resolution (float, default = 0.05) – resolution of data to be downloaded. Can be 0.05 or 0.25.
start_date (Optional[Union[datetime.date, str]], default = None) – Data will be considered starting from date start_date. Input can be an ISO8601 string or datetime.date object. If None, it is set to 1981-1-1.
end_date (Optional[Union[datetime.date, str]], default = None) – Data will be considered up to date end_date. Input can be an ISO8601 string or datetime.date object. If None, it is set to the date for which most recent data is available.
Examples
>>> from ochanticipy import create_country_config, CodAB, GeoBoundingBox, ... ChirpsDaily >>> import datetime >>> >>> country_config = create_country_config(iso3="bfa") >>> codab = CodAB(country_config=country_config) >>> codab.download() >>> admin0 = codab.load(admin_level=0) >>> geo_bounding_box = GeoBoundingBox.from_shape(admin0) >>> start_date = datetime.date(year=2007, month=10, day=23) >>> end_date = datetime.date(year=2020, month=3, day=2) >>> chirps_daily = ChirpsDaily( ... country_config=country_config, ... geo_bounding_box=geo_bounding_box, ... start_date=start_date, ... end_date=end_date ... ) >>> chirps_daily.download() >>> chirps_daily.process() >>> chirps_daily_data = chirps_daily.load()
- class ochanticipy.datasources.chirps.chirps.ChirpsMonthly(country_config: CountryConfig, geo_bounding_box: GeoBoundingBox, start_date: date | str | None = None, end_date: date | str | None = None)[source]¶
Bases:
_ChirpsClass object to retrieve CHIRPS observational monthly precipitation data.
- Parameters:
country_config (CountryConfig) – Country configuration
geo_bounding_box (GeoBoundingBox) – the bounding coordinates of the area that should be included in the data.
start_date (Optional[Union[datetime.date, str]], default = None) – Data will be considered starting from date start_date. Input can be an ISO8601 string or datetime.date object. If None, it is set to 1981-1-1.
end_date (Optional[Union[datetime.date, str]], default = None) – Data will be considered up to date end_date. Input can be an ISO8601 string or datetime.date object. If None, it is set to the date for which most recent data is available.
Examples
>>> from ochanticipy import create_country_config, CodAB, GeoBoundingBox >>> from ochanticipy import ChirpsMonthly >>> import datetime >>> >>> country_config = create_country_config(iso3="bfa") >>> codab = CodAB(country_config=country_config) >>> codab.download() >>> admin0 = codab.load(admin_level=0) >>> geo_bounding_box = GeoBoundingBox.from_shape(admin0) >>> >>> start_date = datetime.date(year=2007, month=10, day=23) >>> end_date = datetime.date(year=2020, month=3, day=2) >>> chirps_monthly = ChirpsMonthly( ... country_config=country_config, ... geo_bounding_box=geo_bounding_box, ... start_date=start_date, ... end_date=end_date ... ) >>> chirps_monthly.download() >>> chirps_monthly.process() >>> chirps_monthly_data = chirps_monthly.load()
Module contents¶
Functionality to process CHIRPS data.