Re: Help on Lon and lat. [message #72724] |
Fri, 01 October 2010 05:37 |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Oct 1, 5:30 am, David Fanning <n...@dfanning.com> wrote:
> Dave Poreh writes:
>> I have some NCDF files like this:
>> ncid = NCDF_OPEN(file)
>> NCDF_VARGET, ncid, 0, lon
>> NCDF_VARGET, ncid, 1, lat
>> NCDF_VARGET, ncid, 2, z
>> NCDF_CLOSE, ncid
>> Lon(m) and lat(n) are 1D (m and n are size) and z is 2D [m,n]. What I
>> need is to have this data in one array (with 3 column and m*n rows)
>> like this:
>> Data=data[lon,lat,z]
>> Any kind of help?
>
> Use your Dimensional Juggling tips to make the lon
> and lat arrays m-by-n in size. Then reform all three
> arrays to fit into one 3-by-m*n array.
>
> http://www.dfanning.com/tips/rebin_magic.html
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Thanks David. works like a charm.
Cheers,
Dave
|
|
|
Re: Help on Lon and lat. [message #72725 is a reply to message #72724] |
Fri, 01 October 2010 05:30  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Dave Poreh writes:
> I have some NCDF files like this:
> ncid = NCDF_OPEN(file)
> NCDF_VARGET, ncid, 0, lon
> NCDF_VARGET, ncid, 1, lat
> NCDF_VARGET, ncid, 2, z
> NCDF_CLOSE, ncid
> Lon(m) and lat(n) are 1D (m and n are size) and z is 2D [m,n]. What I
> need is to have this data in one array (with 3 column and m*n rows)
> like this:
> Data=data[lon,lat,z]
> Any kind of help?
Use your Dimensional Juggling tips to make the lon
and lat arrays m-by-n in size. Then reform all three
arrays to fit into one 3-by-m*n array.
http://www.dfanning.com/tips/rebin_magic.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|