Closed lassiterdc closed 1 year ago
The fields in these files use a non-standard (i.e., local) encoding. For example the discipline is 209 which is not a WMO standard value
Thank you. I found the local encodings here (https://www.nssl.noaa.gov/projects/mrms/operational/tables.php) where I'm able to download them as a .csv. How do I pass this as an argument to cfgrib?
did you figure out the problem? I am trying to use the data and I have the same issue.
First of all see this FAQ https://confluence.ecmwf.int/display/UDOC/Creating+your+own+local+definitions+-+ecCodes+GRIB+FAQ
Steps: Check centre code; here it is 161
% mkdir -p mydefs/grib2/localConcepts/161
In this new directory, create these 4 files: name.def, shortName.def, paramId.def and units.def
We have to assign a parameter ID (paramId) to each of the local NOAA parameters. It is customary to start with the centre code, so I have chosen paramId=161001001 for 'Radar Precipitation Rate'.
% cat mydefs/grib2/localConcepts/161/paramId.def
#Radar Precipitation Rate
'161001001' = {
discipline = 209 ;
parameterCategory = 6 ;
parameterNumber = 1 ;
}
% cat mydefs/grib2/localConcepts/161/shortName.def
#Radar Precipitation Rate
'PrecipRate' = {
discipline = 209 ;
parameterCategory = 6 ;
parameterNumber = 1 ;
}
Create name.def and units.def using this same model.
Now point ecCodes to this directory by setting the environment variable ECCODES_DEFINITION_PATH
% export ECCODES_DEFINITION_PATH=$PWD/mydefs
Now run cfgrib and the shortName should be 'PrecipRate'.
I followed the instruction and I had success at some level. still didn't work. I use Windows and I think that was the reason. I am trying to use this rainfall data in hydrologic modeling. The model requires the daily rainfall value. Any suggestion is appreciated.
Everything I said was related to UNIX! I don't even know if the PWD environment variable is defined on Windows
On Windows the equivalent of "export" is "SET". Also to get the working directory, you type "CHDIR". Now take the output of CHDIR and use it to set the env. var e.g. set ECCODES_DEFINITION_PATH=C:/users/john/mydefs
thank you Shahram! it worked.
Disclaimer: I'm a beginner to python and wrangling climate datasets in general. I did my best to scour the web and the issues page to find a solution with no luck. I hope I've provided enough information!
Data source: http://edc.occ-data.org/nexrad/mosaic/#data-updates
Problem: The 'PrecipRate' attribute I know to be in the grib is unrecognized resulting in na data values. I confirmed that these data are there using the pygrib library, but I need this to work with cgrib so I can use the 'open_mfdataset' function.
Code: