| Re: non-integer binsize [message #43875 is a reply to message #43862] |
Wed, 04 May 2005 17:54  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
patrick.gatlin@msfc.nasa.gov writes:
> This may be a very elementary question, but I was wondering if the
> histogram function can accept a binsize < 1?
Since the example in the on-line help for HIST_2D uses a
bin size of 0.02, I think you might be in good shape here. ;-)
> I am using the hist_2d function to determine the density field of some
> lat/lon locations in a dataset. These values range 4 deg lat and 4 deg
> lon. In order to determine the # of points per square km, I have setup
> the hist_2d function as follows:
>
> IDL> result=hist_2d(lon,lat,max1=lonmax,min1=lonmin,max2=latmax,$
> min2=latmin,bin1=1/111.,bin2=1/111.)
>
> where the size of bin1 and bin2 are the approximate conversions from km
> to degrees (1km=.09 deg).
> Since hist_2d needs two bins, then is the result equal the number of
> points within a box that is 1/111. long on all sides? Thus am assuming
> result will give me the # of points per square kilometer. Is this a
> correct assumption based upon the way hist_2d works?
This explanation reminds me of editing my middle son's
big essay last night (sigh...), but I think you've probably
got the gist of it, anyway. :-)
I think a better way of looking at it is that the box is
1/111. times the number of bins between the min and max values,
but I think you are correct that the numbers you get back
represent the number of points in a square kilometer.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|