[Thread Prev][Thread Next][Index]

[ferret_users] Re: axis scaling in ferret?



Hi Thomas,
This is really a question that should go to the Ferret Users List. If you haven't already subscribed, you can do that by following the directions at http://ferret.pmel.noaa.gov/Ferret/email-users-group. The list has some very experienced and helpful people who are happy to answer questions like yours. 

But, since you wrote,  You can access the values of the coordinate variables with Pseudo-variables x, y, etc. (look up Pseudo-variables in the Users Guide for a description).  Use pseudo-variables to define new axes based on the old ones.
let xyvar = $3[d=3]    ! just to make things easier to read

! The pseudo-variables X & Y capitalized here to make it clearer
! These are variables containing the coordinate values

let x_meters = X[gx=xyvar ]
let y_meters = Y[gy=xyvar ]

! Now define new coordinate axes in terms of km.

define axis/x/units=km x_km = x_meters/1000
define axis/y/units=km y_km = y_meters/1000

! This is the short form of DEFINE AXIS/FROM_DATA. Now, the values
! in your variable $3 are not going to change, but you want to just assign the
! variable to the new coordinate axes:
LET xyvar_km = xyvar[gx=x_km@ASN, gy=y_km@ASN]
! And you would just use the same index values in the SHADE command,
! if I understand what you are doing with the $ variables.  /XAXIS is not a
! qualifier for SHADE, so maybe that was just a typo.
SHADE/LEVELS=$LEVELS/NOLAB xyvar_km[ ...
By the way, if you define the axes with units, they will automatically be labeled with the units, Km , and you might want to define your variable with its title, so you don't have to use PPL commands.  So where we define the value on the kilometer grid, this would be:
LET/title="Mapped to IM" xyvar_km = $3[d=3]

Ansley

Thomas Reerink wrote:
Dear ferret-expert,

Using netcdf for both my GCM and ice model files, I plot my results  by scripting ferret.  A very simple thing, I thought, is to rescale in the final plots the values of my coordinates: from meters to kilometers. I want nothing more than exactly the same plot of my netcdf data, but the values along the x and y coordinate divided by 1000.  (The ranges of those axis can vary and be completely different for various data sets.)

Is this possible? To divide the field values is really simple, but I can not find the variable in which the coordinates are stored in ferret, because then I could manipulate them.

Part of my script (the $-variables are variables in csh) is:

SET VIEW 2
SHADE/LEVELS=$LEVELS/NOLAB/XAXIS $3[d=3, i = $i_IM_low : $i_IM_high, j = $j_IM_low : $j_IM_high ]
PPL XLAB X
PPL YLAB Y
PPL TITLE Mapped to IM
PPL SHADE
!PPL FILL

I would by really gratefull for an answer,

Thomas Reerink

IMAU, Universiteit Utrecht

Princetonplein 5

3584 CC Utrecht

room 656  BBL-building

++31 (0)30 253 3274


++31 (0)6 546 85 866



[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement