Source code for chandra_aca.darkbins

# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Define bins for dark current distribution calculations"""

import numpy as np

# Even log spacing from exactly 2 to 2000, then additional bins up to 11000
[docs] x0 = 2
[docs] x1 = 2000
[docs] x2 = 11000
dx = 0.05
[docs] lx0 = np.log10(x0)
[docs] lx1 = np.log10(x1)
[docs] lx2 = np.log10(x2)
[docs] n_bins = np.round((lx1 - lx0) / dx)
[docs] dx = (lx1 - lx0) / n_bins
[docs] log_bins = np.arange(lx0, lx2, dx)
[docs] bins = 10**log_bins
[docs] bin_centers = 10 ** ((log_bins[1:] + log_bins[:-1]) / 2.0)