comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Help on Lon and lat.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Help on Lon and lat. [message #72724] Fri, 01 October 2010 05:37
d.poreh is currently offline  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 Go to previous message
David Fanning is currently offline  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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: not-quite meidan filter
Next Topic: Type convertion error ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:29:31 PDT 2025

Total time taken to generate the page: 0.00404 seconds