I've updated models.py to include the rap
MODELS = [
{
'mname': 'nam',
'url': "http://nomads.ncep.noaa.gov/pub/data/nccf/com/nam/prod/",
'ddir': "/scratch/data/cdf/nam/218",
'fglob': ('nam.{runtime}.awip12.grib2',
'nam.{runtime}.awphys.grib2'),
'times': (0, 6, 12, 18),
'template': 'nam218.cdf'
},
{
'mname': 'gfs',
'url': "http://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/",
'ddir': "/scratch/data/cdf/gfs/230",
'fglob': ("gfs.{runtime}.pgrb2full..f??",
"gfs.{runtime}.pgrb2full..f???"),
'times': (0, 6, 12, 18),
'template': 'gfs230.cdf'
},
{
'mname': 'rap',
'url': "http://nomads.ncep.noaa.gov/pub/data/nccf/com/rap/prod/",
'ddir': "/scratch/data/cdf/rap",
'fglob': ('nam.{runtime}.awip12.grib2',
'nam.{runtime}.awphys.grib2'),
'times': (0, 3, 6, 9, 12, 15, 18, 21),
'template': 'rap.cdf'
},
# {
# 'mname': 'dgex',
# 'url': "http://nomads.ncep.noaa.gov/pub/data/nccf/com/dgex/prod/",
# 'ddir': "/scratch/data/cdf/dgex/185",
# 'fglob': ('dgex_conus.{runtime}.*',),
# 'times': (6, 18),
# 'template': 'dgex.cdf'
# }
]
ENABLED = ['nam', 'rap']
but it says there is no known model by the name rap when I try to do ifp.ingest --models rap
What's going on here?
Adding the nomads URL is just one of many steps involved in adding new model data. So, just doing that alone is not sufficient to make the data flow. Things involved in getting a new model working:
All of this could be made a whole lot easier if any documentation could be found which describes:
I have not been able to find any substantial, complete and detailed documentation for this. If some could be found it would be much more straight forward to add more models.
The RAP example you are trying is a good place to point out the documentation problem facing getting this data into a form useable by the gfe. In this directory:
http://nomads.ncep.noaa.gov/pub/data/nccf/com/rap/prod/
You will find subdirectories named with five differnt naming conventions. What is the diffence between these names? What do they mean? Some simple and obvious guesses could be made as to what some parts of the names mean. But it would be awesome if a document could be located that spelled it out. Otherwise it is all guessing.
http://nomads.ncep.noaa.gov/pub/data/nccf/com/rap/prod/rap.20180508/
"rap.t00z.awip32f01.grib2 "
Taking a look there we see rap.t (time) 00z , so using the script I edited, it would generate 00 06 12 15 etc.
Not sure what the 32 is for awip.. howerver f01 is the frame number. It appears the rap has 21 frames. I wonder if you can have it look for anything associating for awip* and have it grab the .grib2 extention :)
Here is a quick guide: http://www.nco.ncep.noaa.gov/pmb/products/nam/nomads.shtml
Using the NAM from NOMADS, we would be interested in the 12km CONUS which is listed as nam.tCCz.awphysFF.grb2.tm00. The CC=cycle time (00,06,12,18 UTC), and FF is the forecast hour. Since the NAM12 only goes to 84 hours, we would see awphys00.grb2.tm00-awphys84.grb2.tm00
We also note two .grib2 files such as:
nam.t00z.awphys00.tm00.grib2
nam.t00z.awphys00.tm00.grib2.idx
It should be obvious by the file size the one we would want is the 54M file size.
Each model has parameters that are listed. For the NAM12, I believe the ones we would want are
tmpsfc for surface temperature
apcpsfc for precipitation
gustsfc for wind gust
rh2m for surface relative humidity
etc etc...I can get the complete list when and if you are ready for it
If I am missing something that you have a question about please let me know and I will quickly get back to you.
EDIT As I look through models.py GFE looks to be ingesting the correct NAM, so I will continue to look further as to why it says "No grids to copy".
Last edit: Allan Diegan 2018-05-27
How do we even get it to injest the RAP or even pull stuff out of a model run like CAPE, etc? I'm not sure how we edit the template file.
The configuration found in ingest/models.py is just the basics of what needs to be setup to sucessfully ingest a new model. The items in each configuration entry are as follows:
mname - The model name
url : The URL where the specific files (specified in fglob below) are found
ddir - The destination directory. This is where the ingestor will place netcdf and work files)
fglob - a list of glob patterns (*.txt, file_$.txt etc) that specify which files to get
times - The model run times on a 24 hour clock
template - The netcdf template file to place decoded grib grids into (see below)
So, the ingest framework will start looking for files that are matches using the url, model run time, current time of day and flob patterns. When files are found they, will be downloaded. This is only the first step of many. The next step involves the template.
What if you went here and wrote a support ticket: http://nomads.ncep.noaa.gov:9090/
I was able to locate the gribnames and the nam218 file. I think the names for stuff like temperature should be changed from T to tmpsfc or rh to rhprs. i found the names for these products from nomads.ncep.noaa.gov:9090/. I would give you the full link but apparently nomads is down tonight. This page also gives information about the deminsions of the grid, etc. i will look more into it when its back online.
The odd problem is that the NAM repeatedly only shows 1 hour of data (usually close to the models initialization time). For example if it downloads the 06Z, and I click to copy grids I may get the 07 and 08Z data to show up. Nothing else shows up and sometimes I get a no grids to copy message when there is clearly a cdf file in the folder.. I also let it run for hours even toward the next model run. That part is throwing me for a loop. BUT if even one hour of data loads correctly then apparently the grid parameter names are correct at least for the NAM.
I will uodate when the server is back up.
thanks so much!
Nomads is back up. This is the link I was talking about if you click on info...http://nomads.ncep.noaa.gov:9090/dods/nam/nam20180528
This site gives you a description of the 141 variables that are possible in the NAM. Things like Maximum temperature are listed under tmax2m or minimum temperature listed under tmin2m. Unless it specifically says surface (some variable), then use 2m for 2 meter. For example they do not provide surface relative humidity so we would want 2 meter relative humidity listed as rh2m. Variables that contain multiple layers of the atmosphere such as temperature at the 300 mb, 500mb, 700mb level would be listed as tmpprs. I do understand this part, and I notice that the names of variables listed in gribnames are different from the variables listed in nomads. I believe temperature is listed as T when it should be tmpsfc (temperature surface).
It does list deminsions such as lat, long, altitude as points (42 points or levels for the NAM). This part I'm not really familiar with in regards to what is listed in the gribnames file and how or if they are different then what the nomads says.
If you go to http://nomads.ncep.noaa.gov:9090/dods/ you can select any model that is available from nomads and it should give you the variable names and such. I am hoping this helps, as this is all that I can provide. I may be able to provide insight into what variables mean what but this may be the extend of my knowledge especially when it comes to python so excuse me if you have already mentioned something that you do not have documentation for and I didnt provide it in this comment.
As I mentioned nomads is back up and running. It seems to be downloading data as expected and degribbing them (correctly, I do not know of). I will see if it is able to copy more than 1 hour worth of grids this time. I am starting to wonder if the reason why it says no grids to copy is because the variable names, vertical levels, or map properties may not match what nomads has (I think nomads changed variable names at some point). The reason I say that is because the definition for Temperature is 'T' while in nomads it says it should be 'tmpsfc'. However, like I said before, once in a blue moon it will copy 1 hour worth of grids and it seems to display correctly. But 8 times out of 10 it says "no grids to copy". As you can see why, I am confused and uncertain of what the actual issue could be.
I will be working on this more today.
Thanks for the link! I think I may have bumped into the nam documentation before. Which is why nam is implemented in ifp.Ingest. What I failed to find is similar documentation for any other models :).