fluxcompensator.filter.Filter¶
-
class
fluxcompensator.filter.
Filter
(name, filter_file, waf_0, alpha, beta)¶ Convolves slice of SyntheticCube val within filter limits in a 2D val image or entries of SyntheticSED val into a scalar val.
Parameters: name : str
Name of filter, default is
None
.filter_file : str
Location of e. g. filter_file.txt file with filter function. column #1: wave_filter in microns column #2: Response_filter
Default is
None
.waf_0 : float
Central wavelength of filter in microns. Default is
None
.alpha : float
Power of nu, when
nu**(alpha) * F_nu = const
. Default isNone
.beta : float
Power of nu, when
R_input = R * nu**(beta)
. If unit of R_input is per unit energy :beta = -1
. If unit of R_input is per unit photon :beta = 0
. Default isNone
.Methods
rebin
(wav, val[, inclination])Rebins the filter response into bins which are passed by wav and val. plot
([val_name, dpi])Plots the original filter curves with the new rebined response. Methods (detail)
-
rebin
(wav, val, inclination=None)¶ Rebins the filter response into bins which are passed by wav and val.
Parameters: wav : numpy.ndarray
The wavelengths of val array slices / entries in microns.
val : numpy.ndarray
The 3D cube with shape (x, y, wav) or 1D sed with shape like wav.
inclination : str,
None
Gives index range of monotonically decreasing wavelength values for arrays with more than one inclination.
Use indices from 100 to (and excluding) 200 set
inclination = '100:200'
.Returns: weight : dict
Dictionary relevant for FluxCompensator.convolve_filter.
weight{wav_short, val_short, Response_new, filter_index, waf_0, waf_min, waf_max}
wav_short
: Vector like wav but all entries outside- the filter boundaries are erased.
val_short
: Shape like wav_short for val.Response_new
: New response in bins of wav_short.filter_index
: Indices of original wav within filter.waf_0
: Central wavelength of filter.waf_min
: Lower boundary of filter.waf_max
: Upper boundary of filter.filter_name
: Name of filter. E. g. IRAC4_FILTER
-
plot
(val_name=None, dpi=None)¶ Plots the original filter curves with the new rebined response.
Parameters: val_name : str
Name of the filter which will appear in the plot file’s name. It should be equal with name in SyntheticCube, SyntheticImage, SyntheticSED or SyntheticFlux.
dpi :
None
, scalar > 0The resolution in dots per inch.
None
is default and will use the val savefig.dpi in the matplotlibrc file.
-