[Thread Prev][Thread Next][Index]

Re: [ferret_users] expand to curvilinear grid



Hi Patrick,
By the way, notice that you could also look at the data with, for instance,
yes? plot/vs/ribbon/thick=3/key/sym=17 indice_i, indice_j, v1d
The expnd*by functions were written to handle data which represents a set of trajectories or profiles, stored as a single 1-D list, with another variable that points to the start of each of those features.  This is the "feature types" datasets in the CF conventions, http://cfconventions.org/Data/cf-convetions/cf-conventions-1.7/build/ch09.htm, when they are stored in "ragged arrays" (section 9.3 of that writeup).

I don't think the expnd*by functions would help us with your data. The EXPNDI_BY_Z could put your 1-D lists into 2-D variables; and we could create the mask variable using say, the derivative of indice_i to find the length of each row in the index variables, but the data would not be in the correct location in 2D coordinate arrays.

What about this. After your commands,
use toexpand_01.nc

let a=SAMPLEIJ(lon2D,INDICE_I,INDICE_J)
let b=SAMPLEIJ(lat2D,INDICE_I,INDICE_J)
plot/vs a, b

def axis/y=41:52:0.1/units=degrees_north mylat
def axis/x=-6:10:0.1/units=degrees_east mylon
let v2D=SCAT2GRID_BIN_XY(a,b,v1D, x[gx=mylon], y[gy=mylat])
Define longitude and latitude variables in the same way.
let/units=degrees_east/title=longitude lons = SCAT2GRID_BIN_XY(a,b,a, x[gx=mylon], y[gy=mylat])
let/units=degrees_north/title=latitude lats = SCAT2GRID_BIN_XY(a,b,b, x[gx=mylon], y[gy=mylat]
shade v2d,lons,lats


On 7/22/2014 9:39 AM, Patrick Brockmann wrote:
Hi ferreters,

Is there a way to expand a 1D variable to a 2D variable using
its compressed indices saved as 1D ?

Here is an example
!=================================
use toexpand_01.nc

let a=SAMPLEIJ(lon2D,INDICE_I,INDICE_J)
let b=SAMPLEIJ(lat2D,INDICE_I,INDICE_J)
plot/vs a, b

def axis/y=41:52:0.1/units=degrees_north mylat
def axis/x=-6:10:0.1/units=degrees_east mylon
let v2D=SCAT2GRID_BIN_XY(a,b,v1D, x[gx=mylon], y[gy=mylat])

!=================================
Let me know if something can be done
to retrieve the uncompressed variable on its
original curvilinear grid.
Perhaps with the  EXPNDI_BY function
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/expndi_by/,
but I have not figured out how to.

Files can be found from
http://dods.ipsl.jussieu.fr/brocksce/ferret_bugs/toexpand_01.jnl
http://dods.ipsl.jussieu.fr/brocksce/ferret_bugs/toexpand_01.nc

Best regards
Patrick



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

Privacy Policy | Disclaimer | Accessibility Statement