; computes the probability density function of input_data ; written by C. Federrath, 2017 pro get_pdf_astr4004, input_data, MIN=min, MAX=max, NBINS=nbins, $ HIST=hist, PDF=pdf, CDF=cdf, LOC=loc, BINSIZE=binsize if not keyword_set(min) then min = min(input_data) if not keyword_set(max) then max = max(input_data) if not keyword_set(nbins) then nbins = 100 binsize = (max-min) / double(nbins) hist = histogram(input_data, binsize=binsize, min=min, max=max, locations=loc) pdf = hist / total(hist, /double) / binsize cdf = total(pdf, /cumulative) * binsize end ; ==============================