[Thread Prev][Thread Next][Index]

Re: [ferret_users] stiff modulo argument of x-axis



Hi Martin,
cancel axis/modulo really should do what you need.  Make sure that any time you save the data you have issued that command.  Try this sequence,
use etopo20
cancel axis/modulo `rose,return=xaxis`
save/clobber/file=sub.nc/x=300:320/y=0:10 rose
In a new session, see that even though there is not a modulo attribute on the X axis, Ferret treats the axis as modulo So we have to cancel it again.
use sub.nc
sh grid rose
can axis/modulo `rose,return=xaxis`
sh grid rose
let rose2 = 2*rose
save/append/file=sub.nc/y=5 rose
The longitude axis in sub.nc still does not have a modulo attribute.

The topic in the documentation is "subspan modulo axes". We have strong reasons to have this behavior as the default, so that datasets can be compared even if they use different representations of the longitude coordinates.

Ansley

On 4/20/2012 9:49 AM, Martin Schmidt wrote:
Hi Karl,

thanks for the suggestion with

cancel mode upcase

I was not aware of this option.  It helps to prevent that the new axis is written! This solves the problem.

Why I want to cancel the module attribute? My region covers only 15 degrees and some 
subsequent tools look if the data are modulo or not. So I simply want to have correct attributes.

Many thanks for your help,
Martin 


Karl Smith wrote:
Hi Martin,

Does 'cancel mode upcase' solve your original problem of new axes with
uppercase names?

It also seems surprising to me that you don't want your longitudes to
have a modulo of 360 degrees.
Not sure why your 'cancel axis/modulo' call isn't working for you.
You might want to 'set mode verify' to make sure your command is doing
what you think it is doing.

yes? def axis /X=5E:35E:1 /modulo=75 xax
yes? sh axis xax
 name       axis              # pts   start                end
 XAX       LONGITUDE           31mr   5E                   35E
   Axis span (to cell edges) = 31 (modulo length = 75)
yes? can axis /modulo xax
yes? sh axis xax
 name       axis              # pts   start                end
 XAX       LONGITUDE           31 r   5E                   35E
   Axis span (to cell edges) = 31

Karl


On Fri, Apr 20, 2012 at 3:06 AM, Martin Schmidt
<martin.schmidt@xxxxxxxxxxxxxxxxx> wrote:
  
Hi,
I have a given regional data set stored in a netcdf-file topo.dta.nc. The
axes are lat/lon, no modulo attribute is defined.

I derive a new variable from a variable in the data set and hope to have it
defined at the same axis. For example:

let htp_closed = if i[gx=htp] eq 1 the 1/0 else htp

My choice would be to append the variable to the existing file. However, I
cannot force ferret to use the same axis, xt_i, yt_j.
Instead two new capital XT_I, YT_J show up which are stored separately and
have new attributes different from
the original axes. This confuses a program to read the data later.

Putting the new variable onto the old grid using @asn does not help either.

So I try to write to a new file;

save/clobber/file=my_new_file.nc htp_closed

Doing so, I get the modulo attribut set to 360 in the x- axis.

can axis/modulo `htp_closed,return=xaxis`

does not remove the modulo attribute. Also using the explicit axis name does
not help.

How can I get rid of the wrong modulo attribute in the frame of ferret?

Would it be possible to change the behaviour of ferret in future releases in
such a way,
that a modulo attribute must be set if it is required and correct, or is
inherited from other axis that are modulo?

Dealing with regional data the automatic choice of ferret is always wrong
and it reveals as very stiff to
produce correct data.

Many thanks,
Martin Schmidt




    

  

    

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

Privacy Policy | Disclaimer | Accessibility Statement