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

Home » Public Forums » archive » latitude, longitude and a data point
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
latitude, longitude and a data point [message #63422] Tue, 11 November 2008 06:00 Go to next message
kramerpeterk is currently offline  kramerpeterk
Messages: 1
Registered: November 2008
Junior Member
Hi,

I have 3 one dimension arrays,

LATITUDE FLOAT = Array[15979]
LONGITUDE FLOAT = Array[15979]
VALUES LONG = Array[15979]

and I want to be able to create a 2D array where each X,Y pair is the
value at a particular latitude and longitude. To do this i've tried
using David Fanning's scatter3d_on_map which I think plotted it
correctly (hard for me to tell in direct graphics), but I am still
not sure how to retrieve my 2D array with the floating values I
want.

I'm sure someone will give me an exceedingly simple 1 line solution
but any help would be appreciated =)

Regards,

Peter Kramer
Re: latitude, longitude and a data point [message #63616 is a reply to message #63422] Wed, 12 November 2008 12:29 Go to previous message
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
Peter,

If your lat and lon arrays are already points on a 2d grid, David's
solution works. If they are points you wish to lay on an arbitrary
grid, it works like this:

h2=hist_nd(transpose([[longitude],[latitude]]),[bin_x,bin_y] ,min=
[-180,-90],max=[179.999999,89.99999],reverse_indices=ri2); grid
val2=h2*0.0d; initialize
for i=0l,n_elements(h2)-1 do if(h2[i] gt 0) then val2[i]
=MEAN_OR_WHATEVER(values[ri2[ri2[i]:(ri2[i+1]-1)]]); calculate

If that looks like black magic, go to David's website and search for
"horror disgust".

--Edward H.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Workbench Debugging
Next Topic: Re: 2-d fitting

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

Current Time: Wed Oct 08 13:48:25 PDT 2025

Total time taken to generate the page: 0.00490 seconds