synth - Flux integration and synthetic magnitudes

Filter(string) Filter class.
pixel_fracs(x, xmin, xmax) Return which fraction of each (Voronoi) pixel centered on (not necessarily regularly sampled, but strictly increasing) x is contained within wavelength range [xmin, xmax].
inspec.synth.CLIGHT = 2.99792458e+18

Speed of light [A/s]

inspec.synth.HPLANCK = 6.62606896e-27

Planck constant [erg s]

exception inspec.synth.SynthComputationWarning[source]

Synthetic photometry computation warning.

class inspec.synth.Filter(string)[source]

Filter class.

Read filter curve from ascii-file (if string is a valid filename) or define top-hat bandpass from string = ‘name,lmin,lmax’.

classmethod bandpass(name, lmin, lmax)[source]

Create a bandpass filter.

read(filename)[source]

Read filter transmission curve from ascii-file filename.

Expected format (all initial KEYWORD lines are optional):

# KEYWORD FNAME filtername
# lbda [A]  transmission [fraction]
effLambda()[source]

Return filter effective wavelength:

\[\begin{split}\lambda_{\text{eff}} &= \int \lambda T(\lambda) d\lambda / \int T(\lambda) d\lambda \\ &= (\lambda_{\min} + \lambda_{\max}) / 2 \quad\text{for a top-hat bandpass}\end{split}\]
interpolate(x, monotonic=True)[source]

Filter interpolation.

Interpolate filter over input array x (not necessarily regularly sampled).

monotonic uses PCHIP monotonic cubic interpolation to preserve monotonicity in the interpolated data at the price of potential discontinuities in second-derivatives. Non-monotonic uses standard spline interpolation: beware that interpolation doesn’t go wild outside the filter definition range, or even inside.

integrate(spec, p=1, wrange=None, monotonic=True)[source]

Integrate spectrum flux over a filter.

\[\begin{split}I_p &= \int (h\nu)^{-p} F_\nu(\nu) T(\nu) d\nu \\ &= \int \left(\frac{\lambda}{hc}\right)^{p} F_\lambda(\lambda) T(\lambda) d\lambda\end{split}\]

Special cases:

  • p = 0: \(\int F_\lambda(\lambda) T(\lambda) d\lambda\) (energy magnitudes)
  • p = 1: \(\int \lambda/(hc) F_\lambda(\lambda) T(\lambda) d\lambda\) (photon magnitudes)

Set wrange to integrate over a restricted wavelength range (None is full range).

Note

spectrum is supposed to be regularly sampled in wavelength.

Todo

  • split this function into elementary parts, and compute integral from linear algebraic expression (easier to manipulate for variance/covariance computations).
  • validate computations.
zeroPoint(p=1)[source]

Filter zero-point.

\[\begin{split}10^{z_{p} / 2.5} &= \int (h\nu)^{-p} T(\nu) d\nu \\ &= \int \left(\frac{\lambda}{hc}\right)^{p} \left(\frac{c}{\lambda^2}\right) T(\lambda) d\lambda\end{split}\]

The integral is performed on sampled filter transmissions using Simpson’s integration rule, since the wavelengthes are not necessarily regularly sampled.

Special cases:

  • p = 0: \(z_0 = \int T(\nu) d\nu\) (energy magnitudes)
  • p = 1: \(z_1 = \int T(\nu) / (h\nu) d\nu\) (photon magnitudes)
magn(spec, p=1, m0=48.59)[source]

Compute magnitude in filter for spectrum.

\[m = -2.5\log\left(\int (h\nu)^{-p} F_\nu(\nu) T(\nu) d\nu\right) + z_p - m_0\]

Reference: Vega and AB Photometric Systems

inspec.synth.pixel_fracs(x, xmin, xmax)[source]

Return which fraction of each (Voronoi) pixel centered on (not necessarily regularly sampled, but strictly increasing) x is contained within wavelength range [xmin, xmax].