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

Home » Public Forums » archive » Re: I need some histogram magic - gridding very large dataset
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: I need some histogram magic - gridding very large dataset [message #84168 is a reply to message #84163] Thu, 02 May 2013 02:45 Go to previous message
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
Ok, after re-reading the tutorial I'm getting closer.


histogram = HIST_ND(TRANSPOSE([[lon],[lat]]), $
[1,1], MIN=[-180, -90], $
MAX=[180, 90],REVERSE_INDICES=ri)

grid_mean=fltarr(361, 181)
grid_mean[*]=!values.f_nan

FOR i=0L,N_ELEMENTS(histogram)-1 DO IF(histogram[i] GT 0) THEN $
grid_mean[i] = mean(data[ri[ri[i]:(ri[i+1]-1)]])

The only thing that's let me a bit confused is why does hist_nd return a (361, 181) array? Isn't that 1 element too large in both direction? If the min and max is -180 and 180, that's 361 values but the bins range between those values e.g. -180 to -179, -179 to -178..., 179 to 180 so there should only be 360 bins (which is what I want).

Or is min/max defined differently? Is max the lower bound of the final bin, so the actual maximum value is max+binsize?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Discrepancy in map conversion between ENVI 4.6 and 5.0, where 4.6 appears more accurate
Next Topic: New graphics: lock zoom in one axis

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

Current Time: Sun Oct 12 02:24:49 PDT 2025

Total time taken to generate the page: 0.16638 seconds