fluxcompensator.utils.plot_filters.PlotFilters

class fluxcompensator.utils.plot_filters.PlotFilters(style, normalized, unit)

Tool to plot multiple filter of choice.

Parameters:

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

normalized : None, True

  • None : Plot original scale.
  • True : Plot normalized curve with unity.

unit : str, None

Valid options are:

  • 'unit electrons'
  • 'unit energy'
  • None : Which might plot filters in different units.

Methods

collect_filters(filter_database[, name, ...]) Collect filters of choice.
get_axis() Sets up plotting frame and defines axis.
plot(data_filter, line) Plots filter curves in empty frame.
save_plot([name, dpi]) Saves the plots of the filter response curves.

Methods (detail)

collect_filters(filter_database, name=None, filter_file=None, beta=None)

Collect filters of choice.

Parameters:

filter_database : str, None

  • None : Choose own filter, therefore name, filter_file and
    beta need to be defined.
  • str : Choose filter name_PLOT from database like in FluxCompensator.

name : str

Name of the own filter. Default is None.

filter_file : str, None

Location of own file e. g. filter_file.txt where wavelength (column 1) and response (column 2) of the filter is stored. Default is None. Than filter_database is used.

beta : float, None

Default is None. Then filter_database is used. 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.

Returns:

wave_filter_lim : numpy.ndarray

Vector of the wavelength limits of all filters red in so far.

R_filter_lim : numpy.ndarray

Vector of the response maxima red in so far.

data_filter : object

Returns database like object, even if own filter was red in.

get_axis()

Sets up plotting frame and defines axis.

plot(data_filter, line)

Plots filter curves in empty frame.

Parameters:

data_filter : object

Database like object returned from collect_filters.

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’ : ‘r’, ‘linestyle’ : ‘-‘, ‘linewidth’ : 2}
save_plot(name=None, dpi=None)

Saves the plots of the filter response curves.

Parameters:

name : str

Name of the filter collection e. g. Spitzer.

dpi : None, scalar > 0

The resolution in dots per inch. None is default and will use the val savefig.dpi in the matplotlibrc file.