[Thread Prev][Thread Next][Index]

Re: [ferret_users] Gridding i/j data on a lat/lon grid



Hi Vincent,

> I have a variable gridded on a i/j grid. In a separate netcdf file, I have
> the latitudes and longitudes gridded on the same i/j grid as the variable.
> I am looking for a way of putting my variable on the lat/lon grid and not
> having it in the i/j grid anymore.

Is your latitude / longitude grid regular?  I.e. do all "rows" of data
have the same longitude values, and all "columns" have the same
latitude values?

If this is the case, you can define a new netcdf file which
contains a properly gridded version of your data.  I would do it using
python, but ferret can achieve the same.  Something like


use datafile
use gridfile

let londata = longitude[d=gridfile, j=1]        ! one row only
let latdata = latitude[d=gridfile, i=1]         ! one column only
define axis /x lon=londata
define axis /y lat=latdata
let myvar = datavar[d=datafile, gx=lon@asn, gy=lat@asn]

save /file=newfile.nc myvar


If your data is on a curvilinear grid you'll need to interpolate to a
regular lon/lat grid.  There are different tools for this (matlab,
python) but usually customized.  You could also do it with ferret, using
the scat2gridgauss_xy routine.

Pyferret has a new routine CURV2RECT which does this for you.


Kind regards,
     Hein



-- 

Dr. Hein Zelle
Senior consultant meteorology & oceanography
BMT ARGOSS

Tel:        +31 (0)527-242299
Fax:        +31 (0)527-242016
E-mail:     hein.zelle@xxxxxxxxxxxxx
Website:    www.bmtargoss.com
	    
BMT ARGOSS b.v.
Voorsterweg 28, 8316 PT Marknesse, the Netherlands
Postal address: P.O. Box 61, 8325 ZH Vollenhove, the Netherlands

Registered in The Netherlands, Registered no. 39060160.

Unless otherwise agreed by BMT ARGOSS in writing, all work,
services, goods or products supplied by BMT ARGOSS shall be subject
to and governed by BMT ARGOSS' own terms and conditions which are
available for inspection from BMT ARGOSS on request.

E-mail confidentiality notice and disclaimer:
The contents of this e-mail and any attachments are intended for the
use of the mail addressee(s) shown. If you are not that person, you
are not allowed to read it, to take any action based upon it or to
copy it, forward, distribute or disclose the contents of it and you
should please delete it from your system. BMT ARGOSS does not accept
liability for any errors or omissions in the context of this e-mail or
its attachments which arise as a result of internet transmission, nor
accept liability for statements which are those of the author and
clearly not made on behalf of BMT ARGOSS.


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

Privacy Policy | Disclaimer | Accessibility Statement