[Met_help] Reading a netcdf for grid-stat
John Halley Gotway
johnhg at rap.ucar.edu
Mon Oct 26 15:17:49 MDT 2009
Critian,
I think you're almost there.
In the global attribute for the name of the projection, you should be
using the string "LatLon", but you're using "Lat/Lon". Try taking out
that '/' character and see if that does the trick.
Thanks,
John
> Hi John,
>
> First of all, thanks for the support information. I made all of your
> recommendations and i think my main issue is about the map projection i
> want to use. My data relies in a latitude/longitude grid, separated by
> 0.25 degrees between each lat/lon grid point. Attached you can see my
> model output (salida_mod_asc.20090715.nc) and my observation file
> (salida_qsk_asc.20090715.nc). You can check each of them with the ncview
> command.
>
> I made the header of these files by adapting the expected information
> according to the read_netcdf.cc file located in /lib/vx_met_util directory
> for a latitude/longitude projection.
>
> Thanks again for your help, regards!
>
>> Cristian,
>>
>> Unfortunately, METv2.0 is not really compatible with NetCDF data in a
>> general sense. However, the MET tools are able to read the output of
>> the
>> PCP-Combine tool which is, in fact, a NetCDF file.
>> Therefore, if you were to make your files look like the output of the
>> PCP-Combine tool, Grid-Stat should be able to read it.
>>
>> For the next release, we're working to provide more general support for
>> NetCDF files, specifically those following the NetCDF CF-convention.
>>
>> For now if you'd like to tweak your NetCDF files to look like the output
>> of Grid-Stat, here's what I'd recommend...
>>
>> (1) First, you're not trying to read the NetCDF output of WRF directly
>> into MET are you? If that's the case, you'll need to run your data
>> through the WRF-PostProcessor, available for download here:
>> http://www.dtcenter.org/wrf-nmm/users/downloads/index.php
>> WPP writes out GRIB files, which is what MET was designed to read.
>>
>> (2) Second, if you haven't already, go into the "METv2.0/scripts"
>> directory and run the "test_all.sh" script in there. This will run each
>> of the MET tools at least once, including the PCP-Combine tool.
>>
>> (3) Go into the "METv2.0/out/pcp_combine" directory and use the "ncdump
>> -h" utility to view the contents of those NetCDF files. This is what
>> you'll have to make your files look like. Specifically,
>> note the following:
>> - Each variable should be indexed by dimensions named "lat" and
>> "lon".
>> - Each variable should be named using the GRIB code abbreviations
>> defined on this page:
>> http://www.nco.ncep.noaa.gov/pmb/docs/on388/table2.html
>> For example, temperature is GRIB code 11 and should be named "TMP".
>> Accumulated precip is a special case. It's GRIB code 61 and should
>> be named "APCP_HH" where HH is the number of hours of
>> accumulation.
>> - The units you use should match the units defined in the GRIB table
>> above. MET assumes that the data is in those units.
>> - For each NetCDF variable, you must define the following variable
>> attributes:
>> level, init_time_ut, valid_time_ut, accum_time (I believe that's
>> all
>> that MET actually reads, but you could put the rest of them to be
>> safe).
>> In these "_ut" stands for unixtime, the number of seconds since
>> 1/1/1970. You can use the unix date command to compute unix time.
>> For example, "date +%s" gives you the current unixtime. The
>> "accum_time" attribute should be in seconds.
>> - The projection information must be provided in the global
>> attributes
>> section. The PCP-Combine output contains an example of the Lambert
>> Conformal projection. If your data is on a different
>> projection, send me a sample data file, and I'll be happy to help you
>> figure out what to put there.
>>
>> As you can see, our support for NetCDF is currently VERY limited. We're
>> working to expand it in future releases.
>>
>> Thanks,
>> John Halley Gotway
>> johnhg at ucar.edu
>>
>>
>> Cristian Gonzal Muñoz Castillo wrote:
>>> Hi,
>>>
>>> Which attributes are needed from a netcdf file to be used in the
>>> grid-stat
>>> tool? i'm using netcdf files created by matlab but i think i'm not
>>> writing
>>> down the necessary attributes for it. Could you please advise me on
>>> this.
>>>
>>> Thanks
>>>
>>> PS: when i run grid-stat i get "NetCDF: Attribute not found"
>>>
>>>
>>
>
>
> --
> Cristian G. Muñoz Castillo
> Geofísico
> Licenciado en Ciencias Físicas
> Oficina 442
> Depto. Geofísica (DGEO)
> Fono (41) 2203155
> Facultad Ciencias Físicas y Matemáticas
> Universidad de Concepción
> Concepción
> Chile
More information about the Met_help
mailing list