Skip to content

Commit

Permalink
User lighter Zarr not cfgrib in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexamici committed Oct 15, 2023
1 parent dc989af commit 2134ae5
Show file tree
Hide file tree
Showing 59 changed files with 1,104 additions and 16 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@ naming conventions you can:

>>> import xarray as xr
>>> import cf2cdm
>>> ds = xr.open_dataset('tests/sample-data/era5-levels-members.grib', engine='cfgrib')
>>> ds = xr.open_dataset('tests/sample-data/era5-levels-members.zarr')
>>> cf2cdm.translate_coords(ds, cf2cdm.ECMWF)
<xarray.Dataset>
Dimensions: (time: 4, number: 10, level: 2, latitude: 61, longitude: 120)
Dimensions: (number: 10, time: 4, level: 2, latitude: 61, longitude: 120)
Coordinates:
* time (time) datetime64[ns] 2017-01-01 ... 2017-01-02T12:00:00
step timedelta64[ns] ...
* time (time) datetime64[ns] 2017-01-01 ... 2017-01-02T12:00:00
valid_time (time) datetime64[ns] ...
* latitude (latitude) float64 90.0 87.0 84.0 81.0 ... -84.0 -87.0 -90.0
* longitude (longitude) float64 0.0 3.0 6.0 9.0 ... 348.0 351.0 354.0 357.0
* level (level) float64 850.0 500.0
* number (number) int64 0 1 2 3 4 5 6 7 8 9
Data variables:
z (number, time, level, latitude, longitude) float32 ...
t (number, time, level, latitude, longitude) float32 ...
z (number, time, level, latitude, longitude) float32 ...
Attributes:
GRIB_edition: 1
Conventions: CF-1.7
GRIB_centre: ecmf
GRIB_centreDescription: European Centre for Medium-Range Weather Forecasts
GRIB_edition: 1
GRIB_subCentre: 0
Conventions: CF-1.7
institution: European Centre for Medium-Range Weather Forecasts
history: ...
institution: European Centre for Medium-Range Weather Forecasts

```

Expand All @@ -48,27 +48,27 @@ To translate to the Common Data Model of the Climate Data Store use:
>>> import cf2cdm
>>> cf2cdm.translate_coords(ds, cf2cdm.CDS)
<xarray.Dataset>
Dimensions: (forecast_reference_time: 4, realization: 10,
Dimensions: (realization: 10, forecast_reference_time: 4,
plev: 2, lat: 61, lon: 120)
Coordinates:
* forecast_reference_time (forecast_reference_time) datetime64[ns] 2017-01...
leadtime timedelta64[ns] ...
* forecast_reference_time (forecast_reference_time) datetime64[ns] 2017-01...
time (forecast_reference_time) datetime64[ns] ...
* lat (lat) float64 -90.0 -87.0 -84.0 ... 84.0 87.0 90.0
* lon (lon) float64 0.0 3.0 6.0 9.0 ... 351.0 354.0 357.0
* plev (plev) float64 8.5e+04 5e+04
* realization (realization) int64 0 1 2 3 4 5 6 7 8 9
Data variables:
z (realization, forecast_reference_time, plev, lat, lon) float32 ...
t (realization, forecast_reference_time, plev, lat, lon) float32 ...
z (realization, forecast_reference_time, plev, lat, lon) float32 ...
Attributes:
GRIB_edition: 1
Conventions: CF-1.7
GRIB_centre: ecmf
GRIB_centreDescription: European Centre for Medium-Range Weather Forecasts
GRIB_edition: 1
GRIB_subCentre: 0
Conventions: CF-1.7
institution: European Centre for Medium-Range Weather Forecasts
history: ...
institution: European Centre for Medium-Range Weather Forecasts

```

Expand Down
2 changes: 1 addition & 1 deletion ci/environment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ dependencies:
- pip:
- sphinx-autoapi
# DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW
- cfgrib
- zarr
Binary file removed tests/sample-data/era5-levels-members.grib
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/sample-data/era5-levels-members.zarr/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Conventions": "CF-1.7",
"GRIB_centre": "ecmf",
"GRIB_centreDescription": "European Centre for Medium-Range Weather Forecasts",
"GRIB_edition": 1,
"GRIB_subCentre": 0,
"history": "2023-10-15T20:41 GRIB to CDM+CF via cfgrib-0.9.10.4/ecCodes-2.32.0 with {\"source\": \"tests/sample-data/era5-levels-members.grib\", \"filter_by_keys\": {}, \"encode_cf\": [\"parameter\", \"time\", \"geography\", \"vertical\"]}",
"institution": "European Centre for Medium-Range Weather Forecasts"
}
3 changes: 3 additions & 0 deletions tests/sample-data/era5-levels-members.zarr/.zgroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"zarr_format": 2
}
Loading

0 comments on commit 2134ae5

Please sign in to comment.