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

Home » Public Forums » archive » I need some histogram magic - gridding very large dataset
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
I need some histogram magic - gridding very large dataset [message #84169] Thu, 02 May 2013 02:02
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
I'm fairly sure this can be done using HISTOGRAM but I can't figure out how.

I have some global (irregularly spaced) satellite data which I want to average into 2 degree lat/lon boxes.

Previously my dataset was only 10,000 or so elements large so I just looped over the lat and lon and used WHERE to find all the data values in the grid box and then averaged them.

Something along these lines:


FOR j=0, n_lon-1 DO BEGIN

FOR k=0, n_lat-1 DO BEGIN

lon= lon_min + j * lon_grid
lat= lat_min + k * lat_grid

temp=where(data_lon GE lon AND data_lon LT lon + lon_grid AND data_lat GE lat AND data_lat LT lat + lat_grid)

mean_data[i,j]=mean(data[temp])

ENDFOR
ENDFOR


This worked fine but now I have a dataset with upwards of 20 million datapoints and this way is taking far too long.

Any HISTOMAGIC suitable for this one?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: the problem for GPULIB+IDL
Next Topic: Discrepancy in map conversion between ENVI 4.6 and 5.0, where 4.6 appears more accurate

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

Current Time: Wed Oct 08 11:26:59 PDT 2025

Total time taken to generate the page: 0.00504 seconds