BandpassSet

class rubin_sim.phot_utils.BandpassSet

Bases: object

Set up a dictionary of a set of bandpasses (multi-filters). Run various engineering tests or visualizations.

Methods Summary

calc_filter_edges([drop_peak, drop_percent, ...])

Calculate the edges of each filter for Sb, at values of 'drop_*'.

calc_filter_eff_wave([verbose])

Calculate the effective wavelengths for all filters.

calc_filter_leaks([ten_nm_limit, ...])

Calculate throughput leaks beyond location where bandpass drops to filter_edges (%) of max throughput.

calc_zero_points([gain, verbose])

Calculate the theoretical zeropoints for the bandpass, in AB magnitudes.

multiply_bandpass_sets(other_bp_set)

Multiply two bandpass sets together, filter by filter.

plot_filters([rootdir, throughput, phi, ...])

Plot the filter throughputs and phi's, with limits xlim/ylimthruput/ylimphi.

set_bandpass_set(bp_dict[, bp_dictlist, verbose])

Simply set throughputs from a pre-made dictionary.

set_throughputs__component_files([...])

Read and build bandpass set from all_filter_complist, using data from directory rootdir.

set_throughputs__single_files([filterlist, ...])

Read bandpass set with filters in filterlist, from directory rootdir with base name rootname.

write_phis(filename)

Write all phi values and wavelength to stdout

write_photoz_throughputs(filename)

Write all throughputs in format AndyC needs for photoz

Methods Documentation

calc_filter_edges(drop_peak=0.1, drop_percent=50, verbose=True)

Calculate the edges of each filter for Sb, at values of ‘drop_*’.

Values for drop_peak are X percent of max throughput, drop_percent is where the filter throughput drops to an absolute X percent value.

calc_filter_eff_wave(verbose=True)

Calculate the effective wavelengths for all filters.

calc_filter_leaks(ten_nm_limit=0.01, out_of_band_limit=0.05, filter_edges=0.1, extra_title=None, makeplot=True, savefig=False, figroot='bandpass')

Calculate throughput leaks beyond location where bandpass drops to filter_edges (%) of max throughput.

According to SRD these leaks must be below 0.01% of peak value in any 10nm interval, and less than 0.05% of total transmission over all wavelengths beyond where thruput<0.1% of peak. Assumes wavelength is in nanometers! (because of nm requirement). Uses ten_nm_limit and out_of_band_limit to set specs. Note that the values given here should be in PERCENT (not fractions). Generates plots for each filter, as well as calculation of fleaks.

calc_zero_points(gain=1.0, verbose=True)

Calculate the theoretical zeropoints for the bandpass, in AB magnitudes.

multiply_bandpass_sets(other_bp_set)

Multiply two bandpass sets together, filter by filter. Filterlists must match! Returns a new bandpassSet object.

plot_filters(rootdir='.', throughput=True, phi=False, atmos=True, plotdropoffs=False, ploteffsb=True, compare=None, savefig=False, figroot='bandpass', xlim=(300, 1100), ylimthruput=(0, 1), ylimphi=(0, 0.002), filter_tags='normal', leg_tag=None, compare_tag=None, title=None, linestyle='-', linewidth=2, newfig=True)

Plot the filter throughputs and phi’s, with limits xlim/ylimthruput/ylimphi.

Optionally add comparison (another BandpassSet) throughput and phi curves. and show lines for % dropoffs ; filter_tags can be side or normal.

set_bandpass_set(bp_dict, bp_dictlist=('u', 'g', 'r', 'i', 'z', 'y'), verbose=True)

Simply set throughputs from a pre-made dictionary.

set_throughputs__component_files(filterlist=('u', 'g', 'r', 'i', 'z', 'y'), all_filter_complist=('detector.dat', 'lens1.dat', 'lens2.dat', 'lens3.dat', 'm1.dat', 'm2.dat', 'm3.dat', 'atmos_std.dat'), rootdir='./', verbose=True)

Read and build bandpass set from all_filter_complist, using data from directory rootdir. Note that with this method, every bandpass will be the same. The point is that then you can use this method, plus set up a different BandpassSet with values that are different for each filter and then multiply the two together using multiplyBandpassSets.

set_throughputs__single_files(filterlist=('u', 'g', 'r', 'i', 'z', 'y'), rootdir='./', rootname='total_', rootsuffix='.dat', verbose=True)

Read bandpass set with filters in filterlist, from directory rootdir with base name rootname.

write_phis(filename)

Write all phi values and wavelength to stdout

write_photoz_throughputs(filename)

Write all throughputs in format AndyC needs for photoz