eobs
This module contains functionality to download and load E-OBS data.
Fetches complete grid from https://surfobs.climate.copernicus.eu/dataaccess/access_eobs.php.
Example: Example: Get elevation of whole E-OBS grid
```python
from springtime.datasets import EOBS
datasource = EOBS(product_type='elevation',
variables=['land_surface_elevation'],
years=[2000, 2002]
)
ds = datasource.load()
```
Example: Example: Get all variables for a single point
```python
from springtime.datasets import EOBS
datasource = EOBS(points=[5, 50],
product_type='ensemble_mean',
grid_resolution='0.25deg',
years=[2000,2002])
df = datasource.load()
```
Example: Example: Get elevation
```python
from springtime.datasets import EOBS
datasource = EOBS(points=[5, 50],
product_type='elevation',
variables=['land_surface_elevation'],
years=[2000, 2002]
)
df = datasource.load()
```
Examples: Example: Load all variables for a selection of points.
```python
from springtime.datasets import EOBS
datasource = EOBS(points=[[5, 50], [5, 55]],
product_type='ensemble_mean',
grid_resolution='0.25deg',
years=[2000,2002])
df = datasource.load()
```
Example: Example: Load coarse mean temperature around amsterdam from 2002 till 2002
```python
from springtime.datasets import EOBS
dataset = EOBS(years=[2000,2002],
area={
'name': 'amsterdam',
'bbox': [4, 50, 5, 55]
},
grid_resolution='0.25deg')
df = dataset.load()
```
EOBS
Bases: Dataset
E-OBS dataset.
Attributes:
Name | Type | Description |
---|---|---|
years |
timerange. For example years=[2000, 2002] downloads data for three years. |
|
variables |
Sequence[Variable]
|
Some variables are specific for a certain product type. |
points |
Point | Points | None
|
(Sequence of) point(s) as (longitude, latitude) in WGS84 projection. |
area |
NamedArea | None
|
A dictionary of the form
|
resample |
Optional[dict[str, Any]]
|
Resample the dataset to a different time resolution. If None, no resampling. Else, should be a dictonary of the form {frequency: 'M', operator: 'mean', **other_options}. Currently supported operators are 'mean', 'min', 'max', 'sum', 'median'. For valid frequencies see [1]. Other options will be passed directly to xr.resample [2] |
product_type |
Literal['ensemble_mean', 'ensemble_spread', 'elevation']
|
one of "ensemble_mean", "ensemble_spread", "elevation". |
grid_resolution |
Literal['0.25deg', '0.1deg']
|
either "0.25deg" or "0.1deg" |
version |
Literal['26.0e']
|
currently only possible value is "26.0e" |
keep_grid_location |
bool
|
If True, keep the eobs_longitude and eobs_latitude columns. If False, keep input points instead. |
minimize_cache |
bool
|
if True, only store the data for the selected years and optionally area. This saves disk space, but it requires re-downloading for new years/areas. Default is False, i.e. keep the full EOBS grid. |
https |
bool
|
//pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases |
https |
bool
|
//docs.xarray.dev/en/stable/generated/xarray.Dataset.resample.html |
to_recipe()
Print out a recipe to reproduce this dataset.
download()
Download the data if necessary and return the file paths.
raw_load()
Load the dataset from disk into memory without further processing.
load()
Load and pre-process the data.
extract_time(ds, start, end)
Extract time range from xarray dataset.
extract_area(ds, bbox)
Extract bounding box from xarray dataset.
monthly_agg(ds, operator=np.mean)
Return monthly aggregates based on DOY dimension.
monthly_gdd(ds, t_base=5)
Return monthly growing degree days based on DOY dimension.