Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
titleRead GRIB file with 2 product types
collapsetrue
import xarray as xr

 # Reading the high resolution forecast data (fc)

efas_fc = xr.open_dataset("Efas_forecast.grib",  engine='cfgrib', backend_kwargs={'filter_by_keys': {'dataType': 'fc'}, 'indexpath':''}) 
  
# Reading the Control reforecast (cf) data

glofas_cf = xr.open_dataset("Glofas_reforecast.grib",  engine='cfgrib', backend_kwargs={'filter_by_keys': {'dataType': 'cf'}, 'indexpath':''}) 


 # Reading the Ensemble perturbed reforecasts (pf) data

glofas_pf = xr.open_dataset("Glofas_reforecast.grib ",  engine='cfgrib', backend_kwargs={'filter_by_keys': {'dataType': 'pf'}, 'indexpath':''}) 


# Reading the Historical Consolidated (0001) data

consololidated = xr.open_dataset('glofas.grib', engine='cfgrib', backend_kwargs={'read_keys': {'experimentVersionNumber':'0001'}})

# Reading the Historical Intermediate (0005) data

intermediate = xr.open_dataset('glofas.grib', engine='cfgrib', backend_kwargs={'read_keys': {'experimentVersionNumber':'0005'}}) 

...