Spectrum1DRefModelLayer

class specviz.core.data.Spectrum1DRefModelLayer(data, model=None, *args, **kwargs)[source]

Bases: specviz.core.data.Spectrum1DRefLayer

A layer for spectrum with a model applied.

Parameters:
  • data (numpy.ndarray) – The flux.
  • model (modeling) – The model
  • kwargs (args,) – Arguments passed to the Spectrum1DRef object.

Attributes Summary

model Spectrum model.
parent_mask A bitwise combination of the data mask and the Spectrum1DRefModelLayer‘s parent’s layer mask.
unmasked_data Flux quantity with no layer mask applied.
unmasked_dispersion Dispersion quantity with no layer mask applied.
unmasked_raw_uncertainty Flux uncertainty with mask applied.

Methods Summary

from_formula(models, formula) Create a layer from an operation performed on other models
from_parent(parent[, model, layer_mask, copy]) Create a duplicate child layer from a parent layer

Attributes Documentation

model

Spectrum model.

parent_mask

A bitwise combination of the data mask and the Spectrum1DRefModelLayer‘s parent’s layer mask. This is useful when dealing with slices of spectra in which you want the model layer to be the visible size of the parent in all cases (whereas full_mask will always be the selected region)*[]:

unmasked_data

Flux quantity with no layer mask applied. Use the parent layer mask for cases wherein a slice of the spectrum is being used.

unmasked_dispersion

Dispersion quantity with no layer mask applied. Use the parent layer mask for cases wherein a slice of the spectrum is being used.

unmasked_raw_uncertainty

Flux uncertainty with mask applied. Returns a masked array containing a Quantity object. Use the parent layer mask for cases wherein a slice of the spectrum is being used.

Methods Documentation

classmethod from_formula(models, formula)[source]

Create a layer from an operation performed on other models

Parameters:
  • formula (str) – The operation to perform on the given layers.
  • models ([model, ..]) – The models which are arguments to the given formula.
Returns:

Result of the operation

Return type:

result_model

classmethod from_parent(parent, model=None, layer_mask=None, copy=False)[source]

Create a duplicate child layer from a parent layer

Parameters:
  • parent (layer) – The layer to duplicate.
  • model (modeling) – The model.
  • layer_mask (layer) – The layer defining the valid data mask.
  • copy (bool) – Copy the model if one is provided.
Returns:

The new layer.

Return type:

child_layer