latitude, longitude and a data point [message #63422] |
Tue, 11 November 2008 06:00  |
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  |
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.
|
|
|