ecmwf / cfgrib

A Python interface to map GRIB files to the NetCDF Common Data Model following the CF Convention using ecCodes
Apache License 2.0
409 stars 77 forks source link

Get Time 1 not 2 from GFS APCP #321

Open support2019mp opened 1 year ago

support2019mp commented 1 year ago

Hi! I'm trying to get data from a GFS APCP (Total Precipitation 'tp' accum), but only can access to time 2. Time 1 have the accumulated precipitation from RUN hour to the forecast hour. For example for 06Z , time 1 shows tha acumulated precipitation from 00 to 06. Time 2 have the accumulated fomr the sinoptic hour until the forecast hour. For example, 17Z have the precipitation from 12 to 17. With: backend_kwargs = {'filter_by_keys': {'stepType':'accum'},'indexpath': ''} ds = xr.open_dataset(file_path , engine="cfgrib" , backend_kwargs=backend_kwargs) only can be read time 2, not time 1. Please, how could I read time 1 grib? Thank you

iainrussell commented 1 year ago

Hi @support2019mp,

Perhaps the time_dims argument could help you? Try experimenting with it! See https://github.com/ecmwf/cfgrib/blob/master/CHANGELOG.rst#0973-2019-11-04

Cheers, Iain