[Thread Prev][Thread Next][Index]

Re: ferret "loses" some metadata...



Hi Gary,

The goal of complete control over the attributes in a netCDF file is a good one.
It will be a major item in an upcoming Ferret release (V5.5?), but it has not been
a goal thus far. The support for strings which was added in Ferret V5.4 is a step
along that path. I'll raise a few of the the considerations by way of discussion.

In the simplest case, where the output is an unmodified from an input file the
problem sounds simple. Yet even there it is not. Should one retain the global
attributes of the original file? Not in general, because variables from a different
file may also be appended into the output file.  The user needs to be able to
control both the global and variable attributes.

It gets harder to generalize what to do when the variables may be modified. For
example, if I issue
    yes? SET VARIABLE/BAD=0.0 some_netcdf_file_variable
    yes? SAVE/FILE=out.nc some_netcdf_file_variable
Clearly I should modify the _FillValue attribute in the output file.  But should I
retain the same title (long_name)? In most cases, yes, but not always. The user
needs to be able to control this, too.

The current version of Ferret simply ignores netCDF attributes that mean nothing to
it.  Hence they are dropped in the output.  The future Ferret version in question
will make all attributes available as special variables in your Ferret session
(often string variables). It will allow you to inherit attributes during LET
definitions and to flag which attributes should be included in SAVEs.  Details
sketchy at this point, however.

For now, the NCO toolkit is a big help controlling the output file attributes.
Also, you can in many cases create an output file "container" to your liking first
and then use Ferret to "SAVE/APPEND" values into it.  Neither is an ideal solution,
I agree.

Hope this helps.

    - steve

========================================

Gary Strand wrote:

> What I mean is:
> -------------------------------------------------------------------------------
>  ! NOAA/PMEL TMAP
>  ! FERRET v5.40
>  ! Solaris 5.6 - 02/15/02
>  !  6-Mar-02 08:55
> use A.nc
> let tsb = ts
> save/file=B.nc tsb
> quit
> -------------------------------------------------------------------------------
>
> ncdump -h A.nc:
> -------------------------------------------------------------------------------
> netcdf A {
> dimensions:
>         time = UNLIMITED ; // (1 currently)
>         lat = 64 ;
>         lon = 128 ;
> variables:
>         float TS(time, lat, lon) ;
>                 TS:long_name = "Surface temperature" ;
>                 TS:units = "K" ;
>                 TS:time_rep = "averaged" ;
>         float lat(lat) ;
>                 lat:long_name = "latitude" ;
>                 lat:units = "degrees_north" ;
>         float lon(lon) ;
>                 lon:long_name = "longitude" ;
>                 lon:units = "degrees_east" ;
>         double time(time) ;
>                 time:long_name = "simulation time" ;
>                 time:units = "days since 0000-09-01 00:00:00" ;
>
> // global attributes:
>                 :Conventions = "CSM NetCDF Convention Version 0.0" ;
>                 :platform = "Data converted from CCM History Tape Format" ;
>                 :case = "B11.07" ;
>                 :title = "" ;
> [and a lot more info in the netCDF file]
> -------------------------------------------------------------------------------
>
> ncdump -h B.nc:
> -------------------------------------------------------------------------------
> netcdf B {
> dimensions:
>         LON = 128 ;
>         LAT = 64 ;
>         LATedges = 65 ;
>         TIME = UNLIMITED ; // (1 currently)
> variables:
>         double LON(LON) ;
>                 LON:units = "degrees_east" ;
>                 LON:modulo = " " ;
>                 LON:point_spacing = "even" ;
>         double LAT(LAT) ;
>                 LAT:units = "degrees_north" ;
>                 LAT:point_spacing = "uneven" ;
>                 LAT:edges = "LATedges" ;
>         double LATedges(LATedges) ;
>                 LATedges:edges = " " ;
>         double TIME(TIME) ;
>                 TIME:units = "days since 0000-09-01 00:00:00" ;
>                 TIME:time_origin = "01-SEP-0000 00:00:00" ;
>         float TSB(TIME, LAT, LON) ;
>                 TSB:missing_value = -1.e+34f ;
>                 TSB:_FillValue = -1.e+34f ;
>                 TSB:long_name = "TS" ;
>                 TSB:history = "From A.nc" ;
>
> // global attributes:
>                 :history = "FERRET V5.40    6-Mar-02" ;
> }
> -------------------------------------------------------------------------------
>
> Is there any particular reason FERRET can't maintain all the metadata from the
> file, especially when the data is completely unchanged?
>
> --
> /\        Gary Strand (303) 497-1336                                NCAR ML262A
>   \_][    www.cgd.ucar.edu/ccr/strandwg                      1850 Table Mesa Dr
>       \___strandwg@ucar.edu                       Boulder, Colorado, USA  80305

--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement