[Thread Prev][Thread Next][Index]

Re: [ferret_users] CF compliant netcdf file



Hi Ben,
At the moment we can't define a long_name attribute for an axis when writing to a netcdf file, but you can certainly define the Z axis with any units you want -- this would be fine:

define axis/z=1:80:1/UNITS=level zax
Also, note that you can use the real definitions of all of the axes to begin with if you wish, the ones with xax and yax in units of degrees, and zax with the levels, rather than first defining abstract axes and then redefining the axes.

To set a global dataset attribute, or add standard_name or long_name attributes to the coordinate axes, for now you'll need to use NCO operators on your file after writing it. For more on the NCO tools, search in the Ferret users archives, there are messages about that, e.g.

http://ferret.pmel.noaa.gov/Ferret/Mail_Archives/fu_2005/msg00835.html

You can do the SAVE command, and then spawn the NCO command to edit attributes right from your Ferret session or scripot. In the next Ferret release we'll have syntax to let you edit and add to attributes.

Ansley

Ben Burford wrote:

Hello fellow Ferreters,

I'm using this script to read in (satellite) data (in BSQ format) from a fil
e (the data has been moved to a lat/lon grid):
define axis/x=1:51:1 xax
define axis/y=1:51:1 yax
define axis/z=1:164:1 zax
define grid/x=xax/y=yax/z=zax gax1
file/format=stream/type=i2/swap/skip=`2048/4`/grid=gax1/var=pr_scale PR2A25_
200210030119_cpr let pr=pr_scale/10
set var/bad=999.9 pr

define axis/x=98.44E:100.94E:.05 xax
define axis/y=16.58N:19.08N:.05 yax
set var/title="TRMM PR Rain Rate" pr
set var/units="mm/h" pr


I then use the save/file function to write one of the levels out to a netcdf
file. My problem is I want to clean up my script to create a CF compliant file.


I need the following changes/fixes:

1. Add a global statement "Conventions=CF 1.0"

2. Add standard_name or long_name attributes to x, y and z axes.

3. I need to define the units of measure of the Z axis (this is the critical
problem making it non-compliant). a. I have satellite data in various channels (i.e. frequency/polarity combin
ations). I would like to define the z axis as Channel, with units of Channe
ls. Perhaps something like Define Axis/z=1:7:1/UNITS=channel/Channels
However, I notice in the CF convention that "level" or "layer" is allowed so
level or layer is fine, but I don't know how to specify this as the axis, o
r what units to use.

b. I have another type of satellite data where the z axis value is a level f
rom 1 to 80 (each level is 250 meters, so this this 0 to 20,000 meters, but I want to specify this as level 1 to 80).
So this might be Define Axis/z=1:80:1/UNITS=level/Level zax (or something, I don't know).


Help in fixing up my script and file will be greatly appreciated.

Thanks,

Ben





[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement