OCHA-DAP / ds-raster-pipelines

1 stars 0 forks source link

How do we interpret the various `time` dimensions in ECMWF outputs? #9

Open hannahker opened 1 month ago

hannahker commented 1 month ago

I have seen reference to a number of different temporal dimensions across ECMWF outputs and am having a hard time interpreting each one. This applies to ERA5 (reanalysis) and SEAS5 (seasonal forecasts) products.

Fundamentally, I want to know:

Relevant links:


SEAS5

If we look at a .grib outputs for SEAS5, for example:

ds = xr.open_dataset(
    "test_outputs/seas5/mars/raw/tprate_1990.grib",
    engine="cfgrib",
    backend_kwargs=dict(time_dims=("verifying_time", "forecastMonth", "time", "step", "valid_time")),
)

print(ds)

Returns:

<xarray.Dataset> Size: 57GB
Dimensions:         (number: 25, verifying_time: 18, forecastMonth: 7,
                     time: 12, step: 24, latitude: 23, longitude: 38,
                     valid_time: 18)
Coordinates:
  * number          (number) int64 200B 0 1 2 3 4 5 6 7 ... 18 19 20 21 22 23 24
  * verifying_time  (verifying_time) datetime64[ns] 144B 1990-01-01 ... 1991-...
  * forecastMonth   (forecastMonth) int64 56B 1 2 3 4 5 6 7
  * time            (time) datetime64[ns] 96B 1990-01-01 ... 1990-12-01
  * step            (step) timedelta64[ns] 192B 28 days 30 days ... 215 days
    valid_time      (time, step) datetime64[ns] 2kB ...
    surface         float64 8B ...
  * latitude        (latitude) float64 184B 37.8 37.4 37.0 ... 29.8 29.4 29.0
  * longitude       (longitude) float64 304B 60.0 60.4 60.8 ... 74.0 74.4 74.8
Data variables:
    tprate          (number, verifying_time, forecastMonth, time, step, valid_time, latitude, longitude) float32 57GB ...
Attributes:
    GRIB_edition:            1
    GRIB_centre:             ecmf
    GRIB_centreDescription:  European Centre for Medium-Range Weather Forecasts
    GRIB_subCentre:          0
    Conventions:             CF-1.7
    institution:             European Centre for Medium-Range Weather Forecasts
    history:                 2024-08-08T16:14 GRIB to CDM+CF via cfgrib-0.9.1...

time: Initial time of forecast. (1st of each month in the year) forecastMonth: Months since forecast_reference_time (time). (1-7) step: Time in nanoseconds since forecast_reference_time (time) - Why are there 24 step values?

verifying_time: 18 values, corresponding to the 1st of each month. All 1990 months, plus first 6 months of 1991. - What does this correspond to? valid_time: A function of time and step. Also 18 values. - What does this correspond to?

Following what we've implemented in other analyses, I would assume that all we need to care about are time and forecastMonth.


ERA5

TODO

When is a forecast issued? When does a forecast apply to?

hannahker commented 1 month ago

Also worth confirming what the time_dims option in backend_kwargs is doing: https://github.com/ecmwf/cfgrib