Re: Number of bins in pdfx function

From: Ioannis Koletsis <koletsis_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 04 2013 - 08:56:37 MDT

Thanks Maria for your reply..


I calculated the number of bins as


opt = True

opt@bin_spacing = 0.2

max_ws = max(ws)

min_ws= min(ws)

nbins = floattointeger(((max_ws - min_ws)/0.2)+1)


wspdf = pdfx(ws,nbins,opt)


I hope these lines to be useful for someone who want to calculate
automatically the number of bins ..


Thanks a lot







From: Maria Gehne []
Sent: Wednesday, July 03, 2013 8:21 PM
To: Ioannis Koletsis
Subject: Re: Number of bins in pdfx function


Hi Ioannis,

I don't know of a way to directly specify the bin spacing in pdfx. But if
you know the min and max values of your data it should be easy to work out
the number of bins to use to get the spacing you want.

Something along the lines of

nbins = (max - min)/bin_spacing

( just make sure this is an integer number)

You can also specify the bin_min and bin_max you want to use as attributes
to the opt argument. This way you can be sure what these values are when
calculating the pdf and that nbins is an integer.

Hope this helps,

On 07/03/2013 08:30 AM, Ioannis Koletsis wrote:

Dear NCL users,


I would like to calculate the pdf of wind speed using bin spacing of 0.2
m/s, but the function pdfx obligate me to define the number of bins..

Is there any way to calculate the pdf, setting only the bin_spacing without
specifying the number of bins?


Thanks in advance





Dr. Ioannis Koletsis

National Observatory of Athens
Institute for Environmental Research
Lofos Koufou
Tel: +30 210 8109 <tel:210%208109127> 203, Fax: +30 210 8103236
e-mail: <>

Weather forecasts: (in english)
or <> (in greek)
Weather forecasts for Europe:
<> (in english)



ncl-talk mailing list
List instructions, subscriber options, unsubscribe:

Maria Gehne
Postdoctoral Fellow
P.O. Box 3000
Boulder, CO 80307
No virus found in this message.
Checked by AVG -
Version: 2013.0.2904 / Virus Database: 3204/6462 - Release Date: 07/03/13

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Jul 4 08:56:41 2013

This archive was generated by hypermail 2.1.8 : Fri Jul 05 2013 - 13:06:49 MDT