; compute the PDF of data pro get_pdf, data, PDF=pdf, CDF=cdf, LOC=loc, MIN=min, MAX=max, BINSIZE=binsize if not keyword_set(min) then min = min(data) if not keyword_set(max) then max = max(data) if not keyword_set(binsize) then binsize = (max-min)/100d0 ; compute histogram hist = histogram(data, min=min, max=max, binsize=binsize, locations=loc) ; normalize histogram to produce PDF pdf = hist / total(hist) / binsize ; compute cumulative distribution function (CDF) cdf = total(pdf,/cumulative) * binsize return end