[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 19980907: netcdf and awips



>To: address@hidden
>From: David Tomalak <address@hidden>
>Subject: Re: netcdf and awips 
>Organization: NWS - DLH
>Keywords: decoder utilities, text table, METAR

Hi Dave,

>         I wasn't sure who to ask with this question and thought maybe you 
>      could give me some input. I currently am a lead forecaster for the 
>      National Weather Service in Duluth, MN.  What I'm trying to do is 
>      output decoded metar and marine obs that are stored in netcdf to a 
>      text table. I've been able to use ncdump to list out the data, but it 
>      will take some work to manipulate the output to the way I want. Below 
>      is an example of what I'm trying to do. 
>      
>         netCDF hourly file: 9809072200_metar
>         
>         Use a utility to create:
>      
>         Stn Name        Time    Sky     Temp    RH      WIND    WEATHER
>        ===================================================================
>      
>         KDLH            2155    OVC     70      50      NW 10   NONE
>         KHIB            2153    BKN     72      52      NW 12   NONE
>         ....
>         ....
>      
>      
>      All I've been able to do so far is use ncdump to output the variables 
>      either listed as one item per line or in a an array of data seperated 
>      by comas. I figure what I want to accomplish should be easy to do, 
>      however I'm not all that familiar with netCDF. Could you either tell 
>      me which utility to use to accomplish what I want.
>      
>         Thanks for your time and help

I think what you want to do will require writing a small program, rather
than using an existing utility, because I don't know of any netCDF
utility that will convert the data into a table such as in your example.
Trying to use some a script to convert the output of ncdump into the
sort of table you have in mind might be possible, but I think it would
be more difficult than just writing a program to read the netCDF data
and print out the lines of the table.

The next step is to determine what programming language to use.  There
are netCDF interfaces for C, Fortran, C++, perl, Java, python, IDL, and
MATLAB.  A program to do what you want could be written in any of these
languages.  Which one to choose depends on what you are most familiar
with.  If you know perl, that might result in the smallest program,
since it's designed to make it easy to generate reports and tables.  I
would choose Java, C, or C++, since those are what I am most familiar
with.

If you need more information or help debugging, please let us know at
"address@hidden".

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu