Filters Class

Everything related to filters is devided into two classes: the SingleFilter class representing a single filter, and the MultiFilters class representing a set of filters.

class piscola.filters_class.MultiFilters(bands, mag_systems)

Class representing multiple filters.

calc_eff_wave(bands=None, sed_wave=None, sed_flux=None)

Calculates the effective wavelength of multiple bands.

The effective wavelength depends on the shape of the given SED.

Parameters:
  • bands (list-like, default None) – Bands for calculating their effective wavelengths. If None, use of the available bands.

  • sed_wave (array-like, default None) – SED’s wavelength range. If None, a flat SED is used.

  • sed_flux (array-like, default None) – SED’s flux density distribution. If None, a flat SED is used.

calc_pivot(z=0.0)

Calculates the observed band closest to restframe \(B\) band (\(4500 Å\)).

Parameters:

z (float, default 0.0) – Redshift.

plot_filters(bands=None)

Plot the filters’ transmission functions.

Parameters:

bands (list, default None) – Bands to plot. If None, plots all the available bands.

remove_filter(band)

Removes a band object.

Parameters:

band (str) – Name of the band.

class piscola.filters_class.SingleFilter(band, mag_sys)

Single filter class.

calc_eff_wave(sed_wave=None, sed_flux=None)

Calculates the effective wavelength.

The effective wavelength depends on the shape of the given SED.

Parameters:
  • sed_wave (array-like, default None) – SED’s wavelength range. If None, a flat SED is used.

  • sed_flux (array-like, default None) – SED’s flux density distribution. If None, a flat SED is used.

Returns:

eff_wave – Effective wavelength.

Return type:

float

calculate_extinction(ra, dec, scaling=0.86, reddening_law='fitzpatrick99', r_v=3.1, ebv=None)

Calculates the extinction for a given filter, given a right ascension and declination or \(E(B-V)\).

Parameters:
  • ra (float) – Right ascension in degrees.

  • dec (float) – Declination in degrees.

  • scaling (float, default 0.86) – Calibration of the Milky Way dust maps. Either 0.86 for the Schlafly & Finkbeiner (2011) recalibration or 1.0 for the original dust map of Schlegel, Fikbeiner & Davis (1998).

  • reddening_law (str, default fitzpatrick99) – Reddening law. The options are: ccm89 (Cardelli, Clayton & Mathis 1989), odonnell94 (O’Donnell 1994), fitzpatrick99 (Fitzpatrick 1999), calzetti00 (Calzetti 2000) and fm07 (Fitzpatrick & Massa 2007 with \(R_V = 3.1\).)

  • r_v (float, default 3.1) – Total-to-selective extinction ratio (\(R_V\))

  • ebv (float, default None) – Colour excess (\(E(B-V)\)). If given, this is used instead of the dust map value.

Returns:

A – Extinction value in magnitudes.

Return type:

float

calculate_zp(mag_sys)

Calculates the zero point in the AB, Vega or BD17 magnitude systems.

Parameters:

mag_sys (str) – Magnitude system. For example: AB, BD17 or Vega.

Returns:

zp – Zero-point in the given natural magnitude system.

Return type:

float

integrate_filter(sed_wave, sed_flux)

Calculates the flux density of an SED given a filter response.

Parameters:
  • sed_wave (array-like) – SED’s wavelength range.

  • sed_flux (array-like) – SED’s flux density distribution.

Returns:

flux_filter – Flux density.

Return type:

float

piscola.filters_class.trim_filters(response)

Trim the leading and trailing zeros from a 1-D array or sequence, leaving one zero on each side. This is a modified version of numpy.trim_zeros().

Parameters:

response (1-D array or sequence) – Input array.

Returns:

  • first (int) – Index of the last leading zero.

  • last (int) – Index of the first trailing zero.