[Thread Prev][Thread Next][Index]

Re: bug?



[This message pertains to odd behaviors regarding ambiguous axis orientations in Ferret]

Hi Nicolas,

Thanks for pointing this out. The misbehavior that you observed can be reproduced in the
very simple lines:

     yes? DEFINE AXIS/X=1:1681:1 tot_x  ! subset of the 2D-region with 1681 grid-pts
     yes? LET tot_grd = X[GX=tot_x]
     yes? SHOW GRID tot_grd

Now change the axis definition to

     yes? DEFINE AXIS/X=130e:80w:2/units=degrees tot_x

and you'll see the problem disappear.  However, using this new definition, one gets an error
as expected from

     yes? let v2 = Y[gy=tot_x]
     yes? show grid v2

since it does not make sense to use a longitude axis in a "Y" pseudo-variable.

It turns out that when the orientation of an axis is ambiguous, Ferret may use the name of
the axis to resolve the ambiguity. That is what is happening in your example. The starting
letter "t" of "tot_x" erroneously makes Ferret think that your axis is T-oriented.

I will look into changing this behavior.  Meantime, the work-around that you suggested is
right on target.

    - steve

====================================

Nicolas Schneider wrote:

> Dear Ferret users
>
> When trying to calculate pdf's, I found a very strange behaviour of ferret? What I tried
> to do is regrid a 2D-dataset on a 1D-vector in order to be able to sort the data.
>
> I tried the following and got an error message (I don't understand):
>
> yes? DEFINE AXIS/X=1:1681:1 tot_x  ! subset of the 2D-region with 1681 grid-pts
> yes? LET tot_grd = X[GX=tot_x]
> yes? LET on1ax = RESHAPE(TEMP[D=1,I=10:50,J=10:50,L=15], tot_grd)
> yes?
> yes? list on1ax
>  **ERROR: regridding: Axis orientation not matching request:GX=TOT_X
> yes?
>
> However, when I changed the name of the newly defined x-axis from tot_x to xax and the
> name of the newly defined grid from tot_grd to grd1d, it worked:
>
> yes? DEFINE AXIS/X=1:1681:1 xax ! subset of the 2D-region with 1681 grid-pts
> yes? LET grd1d = X[GX=xax]
> yes? LET on1ax = RESHAPE(TEMP[D=1,I=10:50,J=10:50,L=15], grd1d)
> yes?
> yes? list on1ax
>              RESHAPE(TEMP[D=out.small-pres.surf1,I=10:50,J=10:50,L=15], GRD1D)
>  1      /    1:  294.3
>  2      /    2:  294.3
>  3      /    3:  294.3
>  4      /    4:  294.3
>  5      /    5:  294.2
>
>
> The more, the first syntax worked when I used a z-axis (==> name: tot_z) and a
> corresponding grid (==> name tot_grd). So it can't only be the underscore.
>
> Although I finally sorted out the problem, is there anything I didn't understand
> correctly or is it just a bug? Are there any letters one can't use in naming variables
> and grids?
>
> Thanks,
> Nick
>
> _____________________________________________________________
>
> Nicolas Schneider
> PhD Student
> University of Bern
> Institute of Geography
> Climatology & Meteorology
> Hallerstrasse 12
> CH-3012 Bern
>
> phone +41-31-631-8542
> fax   +41-31-631-8511
> email schneid@giub.unibe.ch
> _____________________________________________________________

--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement