[Thread Prev][Thread Next][Index]

Re: [ferret_users] Changing axis names with ferret

There are some newer Ferret commands to help with these issues.

LIST/KEEP_AXISNAMES   would use LON and LAT for the subsetted axis names

And MODE UPCASE lets you control whether Ferret outputs names in upper-case or their original upper/lowercase spelling.

I think these would do what you need.


On 5/2/2012 8:54 AM, Paul Young wrote:

To follow from Hein's email, to my knowledge ferret will always name variables and dimensions in upper case. You might want to check with the project requirements about that since netcdf naming is case sensitive for many programs (e.g. IDL, nco etc).

...I normally use nco to deal with metadata from files that I produce from ferret. You can even call them from within your ferret script using the spawn command. E.g., for your script:

!Save a monthly climatology of variable chla
!Attention: if considered years are modified
!           => incrementation "l" has to be modified also
!M. CHIFFLET - April 2011
cancel/all data
cancel/all window
set memory/size=10000

sp rm ROMS-SST-BISCAY-HC-AnnualMeanMap.nc
sp rm ROMS-SST-BISCAY-HC-TSeries.nc

use "/disc1/roms1.1_boby_npzd/Run2_1997-2009_output/sst_daily.nc"

DEFINE AXIS/EDGES/T0=01-jan-1900/UNITS=days years=DAYS1900(X[i=1998:2009:1],1,1)
save/append/file="ROMS-SST-BISCAY-HC-TSeries.nc" SST[d=1,X=-10:-0.5@ave,Y=42:49@ave,gt=years]

use "/disc1/roms1.1_boby_npzd/Run2_1997-2009_input/roms_grd.nc"
!define axis/Y/from_data/name=lat lat_rho[d=2,i=120]
!define axis/X/from_data/name=lon lon_rho[d=2,j=70]
!define grid/X=lon/Y=lat gridBiscay_topo
SAVE/append/FILE="ROMS-SST-BISCAY-HC-AnnualMeanMap.nc" SST[d=1,l=@ave,X=-10:-0.5,Y=42:49]

!! My added bit (...using lower case)

sp "ncrename -d LON43_157, lon ROMS-SST-BISCAY-HC-AnnualMeanMap.nc" !Rename dimension
sp "ncrename -d LAT25_145, lat ROMS-SST-BISCAY-HC-AnnualMeanMap.nc"
sp "ncrename -v LON43_157, lon ROMS-SST-BISCAY-HC-AnnualMeanMap.nc" !Rename variable
sp "ncrename -v LAT25_145, lat ROMS-SST-BISCAY-HC-AnnualMeanMap.nc"

On May 2, 2012, at 9:22 AM, Hein Zelle wrote:

Dear Marina Chifflet,

usually there's both a variable AND a dimension.  If you want to use
nco to do the rename, try renaming both the variable and the
dimension, and see if that works properly.

The reason ferret renames dimensions is because you're applying a
subset or region.  I would have expected ferret to behave if you
define new axes yourself, then save a variable defined on those axes.
Does that not work?

Something like

define axis /x=-10,20,1 /units="degrees_east" lon
define axis /y=20,40,1 /units="degrees_north" lat

let sst = sea_surface_temperature[gx=lon,gy=lat]

save /file=sst.nc sst

If that doesn't work, could you send an example with a file to try?

Kind regards,
    Hein Zelle


Dr. Hein Zelle
Advisor Meteorology & Oceanography

Tel:        +31 (0)527-242299
Fax:        +31 (0)527-242016
E-mail:     hein.zelle@xxxxxxxxxxxxx
Website:    www.bmtargoss.com

Voorsterweg 28, 8316 PT Marknesse, the Netherlands
Postal address: P.O. Box 61, 8325 ZH Vollenhove, the Netherlands

Registered in The Netherlands, Registered no. 39060160.

Unless otherwise agreed by BMT ARGOSS in writing, all work,
services, goods or products supplied by BMT ARGOSS shall be subject
to and governed by BMT ARGOSS' own terms and conditions which are
available for inspection from BMT ARGOSS on request.

----Confidentiality Notice & Disclaimer----

The contents of this e-mail and any attachments are intended for the
use of the mail addressee(s) shown. If you are not that person, you
are not allowed to read it, to take any action based upon it or to
copy it, forward, distribute or disclose the contents of it and you
should please delete it from your system. BMT ARGOSS does not accept
liability for any errors or omissions in the context of this e-mail or
its attachments which arise as a result of internet transmission, nor
accept liability for statements which are those of the author and
clearly not made on behalf of BMT ARGOSS.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement