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

Re: 20040324: ncdump dates (fwd)



>To: address@hidden
>From: <address@hidden>
>Subject: ncdump dates (fwd)
>Organization: CMC
>Keywords: 200403241452.i2OEqsrV029902 ncdump

Hi Rick,

>      Earlier in the month I sent the message below directly to the
> netcdfgroup.  I don't usually submit to the group, and perhaps I should
> have sent it to support instead.  Anyway, I'll re-send, just in case I
> goofed:

I didn't see it on the netcdfgroup mailing list, so maybe it got
filtered out for some reason (such as having an attachment), or you
sent it from a different email address than used for you on the
netcdfgroup mailing list.

>      A version of ncdump at the CDC used to convert udunits dates into
> dates that can be read easily.  I lost that functionality recently (and
> CDC ncdump was hard to compile using a newer version of netCDF), and wrote
> a short program to replace it.  The idea is to filter the output of ncdump
> and replace the dates using udunits.  It seems to work for NCEP Reanalysis
> data files.  I've included a perl script below that illustrates how it
> could be used on multiple netCDF files, for example.  The "read.ncdump.c"
> program is attached, in case there are others in the same boat (I doubt
> it's COARDS compliant, but that could be changed).
> 
> Cheers,
> Rick Danielson
> 
> #!/usr/bin/perl -w
> for ($a = 0; $a < scalar(@ARGV); $a++) {
>   $command = "ncdump -c $ARGV[$a] | read.ncdump\n";
>   system($command);
> }

Thanks for contributing this!  I copied it to our contributed netCDF
software directory:

  ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/read.ncdump.c

and added an entry about it in our contributed software catalog:

  http://www.unidata.ucar.edu/packages/netcdf/Contrib.html

that says:

  read.ncdump.c
    Rick Danielson's filter for ncdump output that replaces udunits
    times with the corresponding date and time in a more readable
    form YYYY-MM-DD hh:mm:ss.

If you want to change this, just let me know.  It still might be
worthwhile to announce this on the netcdfgroup mailing list, as there
might be others who would like to know about your filter.

--Russ

_____________________________________________________________________

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