Re: Removing elements

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 07 2012 - 12:11:11 MST

Hi Dan,

Well, PyNIO is just a Python module, so you can certainly edit your Python script to ignore a variable in a GRIB2 dataset based on any criteria you choose. We do not have any official script for converting GRIB2 or any other format to NetCDF, although there may be an example script that you of course are free to modify.

That said, I am not quite sure I understand what the issue is. If a grid is based on a particular map projection, then it may require 2-D coordinates. In that case, it is not possible in NetCDF to treat them as coordinate variables, as 1D coordinates would be treated. Instead, PyNIO follows the CF-convention, and creates an x and y dimenion (without any coordinate variable -- these dimensions are in index space only). In addition, it creates lat and lon variables that have the same x and y dimension as the data variables they are associated with. To make the association clear, PyNIO attaches the CF-convention compliant attribute "coordinates" to the data variable. This attribute contains the names of the lat and lon variables. This is a standard approach.

If the explanation above does not satisfy you, I would be interested in seeing an example of the type of GRIB2 file you are having trouble with. Please upload one or more sample files to our ftp site. Instructions can be found on the NCL web site by opening the Support tab -> report bugs. Please be sure to let me know the name of whatever file(s) you have uploaded.
 -dave

On Feb 7, 2012, at 5:17 AM, Daniel Gilmore wrote:

> Good morning. We are using PyNio to convert a variety of products in GRIB2 to NetCDF. For the most part, it works fine. But lately we're running into some issues with gridded data.
>
> What happens during conversion is both x/y and lat/lon data are included in the resulting NetCDF file. I'm not sure whether this is coming from the Grib2 file itself, or is an artifact of PyNio. Either way, it is confusing our web coverage service when we try to serve these files.
>
> As a work-around, we developed a post-processing app that removes either the x/y or lat/lon elements, depending on the product. This works well, but is product specific. Consequently, it is labor intensive and is going to be a maintenance nightmare.
>
> So what we're wondering is, can PyNio be directed to drop specific elements on the floor during conversion? If not, is this some functionality that can be added at a later date?
>
> Thanks.
>
> Dan
>
> --
> --
> Daniel Gilmore (AceInfo Solutions)
> PGB/MDL/OST/NWS/NOAA
> Office #: SSMC2-10357
> Phone: 301.713.0224 x101
> Cell: 703.232.9603
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Feb 7 12:11:20 2012

This archive was generated by hypermail 2.1.8 : Wed Apr 11 2012 - 14:41:42 MDT