[Thread Prev][Thread Next][Index]

[ferret_users] regridding transformation should reduce dimension . . .



Hi Ferret users,

I'm sure there has been discussions about this issue and I searched
our email archive and found some threads that touch upon it, but
didn't find whether it's "solved" or not.

The problem is that @LOC (and perhaps other similar transformations)
doesn't properly "eliminate" the axis.  For a (x,y,z) temperature
field, say, you can find the depth of an isopycnal:

   yes? z10 = temp[z=@LOC:10]

but, "SHOW GRID z10", it still has more than one gridpoints.  Nevertheless,

    yes? fill z10[k=1]   !--> undefined field
    yes? fill z10           !--> works!

See a complete example below.  This behavior looks like a bug to me.

This matters.  I wanted to define a mask on the basis of this
variable, something like:

   yes? let below_z10 = if z[g=temp] lt z10 then 1

but this doesn't work because z10[k=1, 2, 3, . . .] are undefined!

My temporary solution is

   yes? let grid = x[gx=temp] + y[gy=temp]
   yes? let z10_squashed = reshape(z10,grid)
   yes? let below_z10 = if z[g=temp] lt z10_squashed then 1

But, I guess Ferret should do this reshaping for me with @LOC.

Regards,

Ryo
----------------------------------------
$ ferret
  NOAA/PMEL TMAP
  FERRET v6.94
  Darwin 14.1.0 - 02/26/15
  1-Dec-15 19:36

yes? set data levitus_climatology
yes? let z10 = temp[z=@LOC:10]
yes? show grid z10
    GRID GMS1
 name       axis              # pts   start                end
 XAXLEVITR LONGITUDE          360mr   20.5E                19.5E(379.5)
 YAXLEVITR LATITUDE           180 r   89.5S                89.5N
 ZAXLEVITR DEPTH (m)           20 i-  0                    5000
 normal    T
 normal    E
 normal    F
yes? list/x=180/y=0 z10[k=1]
             VARIABLE : TEMP[Z=@LOC:10]
             FILENAME : levitus_climatology.cdf
             FILEPATH : /usr/local/ferret/data/
             LONGITUDE: 179.5E
             LATITUDE : 0.5S
             DEPTH (m): 0 to 5
        ....
yes? list/x=180/y=0 z10
             VARIABLE : TEMP[Z=@LOC:10]
             FILENAME : levitus_climatology.cdf
             FILEPATH : /usr/local/ferret/data/
             LONGITUDE: 179.5E
             LATITUDE : 0.5S
             DEPTH (m): 0 to 5000
          371.7
!---- temporary solution ----
yes? let grid = x[gx=temp] + y[gy=temp]
yes? let z10_reshaped = reshape(z10, grid)
yes? show grid z10_reshaped
    GRID (G002)
 name       axis              # pts   start                end
 XAXLEVITR LONGITUDE          360mr   20.5E                19.5E(379.5)
 YAXLEVITR LATITUDE           180 r   89.5S                89.5N
 normal    Z
 normal    T
 normal    E
 normal    F
yes? list/x=180/y=0 z10_reshaped[k=1]
             VARIABLE : RESHAPE(Z10, GRID)
             FILENAME : levitus_climatology.cdf
             FILEPATH : /usr/local/ferret/data/
             LONGITUDE: 179.5E
             LATITUDE : 0.5S
          371.7
yes? list/x=180/y=0 z10_reshaped
             VARIABLE : RESHAPE(Z10, GRID)
             FILENAME : levitus_climatology.cdf
             FILEPATH : /usr/local/ferret/data/
             LONGITUDE: 179.5E
             LATITUDE : 0.5S
          371.7
yes?


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

Privacy Policy | Disclaimer | Accessibility Statement