[Thread Prev][Thread Next][Index]

Re: [ferret_users] Setting global data set attributes in Version 6



Hi Mike,
This just isn't implemented yet. We debated for quite a while what the syntax should be for global attributes, and we haven't resolved all the details on this yet. Global attributes come into Ferret only for netCDF datasets, and we can access them with the ..attributename syntax.  It's understandable to want to define new ones write them to output netCDF files, but we haven't created syntax to tie them to variables, which is what's specified by any write command. 

Say you defined a new attribute
yes? DEFINE ATTRIBUTE ..foo = "bar"
Would this attribute be written to ALL subsequent files, until the attribute was canceled?  If we have several files open, what would one expect to be done with with the various global attributes associated with each of those files, when variables from those files, or new variables calculated from those variables, are written to output files?  For the moment, we have punted on this, and when writing a new netCDF file, we write only the old default HISTORY attribute,

// global attributes:
                :history = "FERRET V6    4-Oct-06" ;


One workaround is to use nco operators to fix up a file after writing; if you have these on your system, you can execute a spawn command from Ferret, or call the external functions NCO or NCO_ATTR to edit a netcdf file right from your Ferret script.
yes? show function nc*

NCO(operator,arguments)
    Call an NCO utility
    operator: name of operator (STRING)
    arguments: one string with all arguments (STRING)

NCO_ATTR(FileName,VariableName,AttributeName,AttType,Mode,AttributeValue)
    Call ncatted to edit attributes in a netCDF file
    FileName: netCDF file name (STRING)
    VariableName: Variable name (or global) (STRING)
    AttributeName: Attribute to change (STRING)
    AttType: Attribute type (STRING)
    Mode: o=edit, a=append, d=delete (STRING)
    AttributeValue: new value of attribute (STRING)

Suggestions and discussion on this topic would be welcome!

Ansley




McCann, Mike wrote:
Hello,
 
I'm enjoying version 6's new ability to easily manipulate variable attributes using DEFINE ATTRIBUTE commands.
 
However, I'm having trouble defining new global attributes, e.g.:

yes? DEFINE ATTRIBUTE ..foo = "bar"
 **ERROR: command syntax: illegal name:
 
Is there something I'm missing?
 
Thanks in advance,
Mike

--
Mike McCann
Software Engineer
Monterey Bay Aquarium Research Institute
7700 Sandholdt Road
Moss Landing, CA 95039-9644
Voice: 831.775.1769  Fax: 831.775.1736 http://www.mbari.org

 

-- 

~>   ~>   ~>   ~>   ~>   ~>   ~>   ~>   ~>   ~>   ~> 

Ansley Manke, NOAA/PMEL   ansley.b.manke@noaa.gov
7600 Sand Point Way NE, Seattle WA
Phone 206-526-6246,  FAX 206-526-6744


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement