analysis.equivalent_width¶
The equivalent_width
module measures the pseudo equivalent widths of
observed and modeled spectra.
Function Documentation¶
-
exception
analysis.equivalent_width.
UnobservedFeature
[source]¶ Referencing a spectral feature that is at least partially unobserved.
-
analysis.equivalent_width.
calc_pew
(wavelength, flux, feature=None, feat_start=None, feat_end=None)[source]¶ Generic function for calculating the pseudo equivalent width
If
feat_start
andfeat_end
are given, use them to determine the continuum flux. If they aren’t specified byfeature
is, estimate the boundaries of the feature.Parameters: - wavelength (ndarray) – An array of wavelength values
- flux (ndarray) – An array of flux values
- feature (dict) – A dictionary defining feature parameters
- feat_start (float) – The starting wavelength of the feature
- feat_end (float) – The ending wavelength of the feature
Returns: The pseudo equivalent width as a float
-
analysis.equivalent_width.
fit_continuum_func
(wavelength, flux, feat_start, feat_end)[source]¶ Fit the pseudo continuum for a given feature
Parameters: - wavelength (ndarray) – An array of wavelength values
- flux (ndarray) – An array of flux values
- feat_start (float) – The starting wavelength of the feature
- feat_end (float) – The ending wavelength of the feature
Returns: A linear function fit to the flux values bounding a feature
-
analysis.equivalent_width.
get_feature_bounds
(wavelength, flux, feature)[source]¶ Get the start and end wavelengths / flux for a given feature
Parameters: - wavelength (ndarray) – An array of wavelength values
- flux (ndarray) – An array of flux values
- feature (row) – A dictionary defining feature parameters
Returns: The starting wavelength of the feature The ending wavelength of the feature
-
analysis.equivalent_width.
tabulate_peak_model_pew
(models)[source]¶ Tabulate the pew for each feature at time of B band maximum
Parameters: models (list) – A list of sncosmo models Returns: A table of equivalent widths for each feature
-
analysis.equivalent_width.
tabulate_pew_spectra
(data_release, models=(), fix_boundaries=True)[source]¶ Tabulate the pseudo equivalent widths for multiple spectra / features
Parameters: - data_release (module) – An sndata data release
- models (list) – A list of sncosmo models
- fix_boundaries (bool) – Fix feature boundaries to observed values
Returns: A table of equivalent widths over time
-
analysis.equivalent_width.
tabulate_pew_spectrum
(phase, wave, flux, models=(), fix_boundaries=True)[source]¶ Tabulate the observed and modeled pew for multiple features
Parameters: - phase (float) – The phase of the observed spectrum
- wave (ndarray) – An array of wavelength values
- flux (ndarray) – An array of flux values
- models (list) – A list of sncosmo models
- fix_boundaries (bool) – Fix feature boundaries to observed values
Returns: An astropy table