Flux cookbook

Cookbook of utilities to manipulate flux

Table of contents

  1. Re-bin spectrum
  2. Smooth spectrum
  3. Rescale spectrum
  4. De-redden spectrum
  5. Adjust magnitudes
  6. Estimate SNR
  7. Estimate RMS

Re-bin spectrum

Method CookbookGeneral.rebin
Parameters
  • xstart: Start wavelength (nm)
  • xend: End wavelength (nm)
  • dx: Step in x
  • xunit: Unit of wavelength or velocity
  • norm: Return normalized spectrum, if continuum exists
  • filling: Value to fill region without data
JSON template
{
  "cookbook": "cb",
  "recipe": "rebin",
  "params": {
    "xstart": "null",
    "xend": "null",
    "dx": "10.0",
    "xunit": "km / s",
    "norm": "true",
    "filling": "nan"
  }
}    

Apply a new binning to a spectrum, with a constant bin size.

🚧

Smooth spectrum

🚧

Rescale spectrum

🚧

De-redden spectrum

Method CookbookFlux.deredden
Parameters
  • ebv: Color excess
  • rv: Ratio of total selective extinction
JSON template
{
  "cookbook": "cb",
  "recipe": "deredden",
  "params": {
    "ebv": "0.03",
    "rv": "3.1"
  }
}    

Correct the spectrum flux for reddening due to extinction.

The extinction is modeled with the parametrization of O’Donnell (1994), depending on the spectrum color excess \(E(B-V)\) and ratio of total selective extinction \(R(V)=A(V)/E(B-V)\). Column y of the spectrum is updated with de-reddened values.

🚧

Adjust magnitudes

🚧

Estimate SNR

Method CookbookGeneral.snr_est
Parameters –
JSON template
{
  "cookbook": "cb",
  "recipe": "snr_est",
  "params": {
  }
}    

Estimate the signal-to-noise ratio per pixel.

A snr column is populated with y/dy ratios computed for all spectrum bins.

Estimate RMS

Method CookbookGeneral.rms_est
Parameters
  • hwindow: Half-size in pixels of the running window
JSON template
{
  "cookbook": "cb",
  "recipe": "rms_est",
  "params": {
    "hwindow": "100"
  }
}    

Estimate flux error by computing the root-mean-square (RMS) of the flux within a running window.

The RMS is computed over y values and is saved in y_rms. It may be useful to compare the latter with dy to check that the formal error is consistent with the actual dispersion of y values.