fluxcompensator.utils.one_filter.OneFilter¶
-
class
fluxcompensator.utils.one_filter.OneFilter(name, filter_file, beta=None)¶ Tool to plot one filter of choise.
Parameters: name : str
Name of the filter.
filter_file : str
Location of file e. g. filter_file.txt where wavelength (column 1) and response (column 2) of the filter is stored.
beta : float
Only important if multiple filters with PlotFilters are plotted. Default is
None. Power of nu, whenR_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.Returns: wave_filter : numpy.ndarray
Wavelength vector of filter with descending wavelength values in microns.
R_filter : numpy.ndarray
Response of the filter in input units. beta could give hints of the units.
Rmax : float
Maximum of the vertical component of the filter curve.
nu_Rmax : float
Frequency at maximum of the vertical component of the filter curve in Hz.
Methods
onefilter_plot([line, style, normalized, unit])Only important if multiple filters with PlotFilters are plotted. onefilter_save_plot([dpi])Only important if one filter wants to be plotted directly with original scale. Methods (detail)
-
onefilter_plot(line='-r', style='linear', normalized=None, unit=None)¶ Only important if multiple filters with PlotFilters are plotted.
Parameters: line : str, dict
Linestyle of the filter curve. Valid are all python commands like:
'-r': red with solid line'--g': green with dashed line'.-b': blue with dot dashed line- dict : line{‘color’ : color, ‘linestyle’ : ‘-‘, ‘linewidth’ : 2}
Default is
'-r'.style : str
Style of the plotting axis. Valid options are:
'linear': red with solid line'loglog': green with dashed line'logx': blue with dot dashed line'logy': blue with dot dashed line
Default is
'linear'.normalized :
None,TrueNone: Plot original scale.True: Plot normalized curve with unity.
Default is
None.unit : str,
NoneValid options are:
'unit electrons''unit energy'
Default is
None, which might plot filters in different units.Returns: plot : plt command
Plotting command to pass to PlotFilters.
-
onefilter_save_plot(dpi=None)¶ Only important if one filter wants to be plotted directly with original scale.
Parameters: dpi :
None, scalar > 0The resolution in dots per inch.
Noneis default and will use the val savefig.dpi in the matplotlibrc file.Returns: plot : e. g. plot.png
Plot of filter with chosen style.
-