Spectrum1DRefLayer

class specviz.core.data.Spectrum1DRefLayer(data, wcs=None, parent=None, layer_mask=None, uncertainty=None, unit=None, mask=None, *args, **kwargs)[source] [edit on github]

Bases: specutils.core.generic.Spectrum1DRef

Class to handle layers in SpecViz.

Parameters:

data: numpy.ndarray

The flux.

wcs: `~astropy.wcs.WCS`

If specified, the WCS relating pixel to wavelength.

parent: layer

If specified, the parent layer.

layer_mask: layer

The layer defining the valid data mask.

args, kwargs:

Arguments passed to the Spectrum1DRef object.

Attributes Summary

full_mask Mask for spectrum data.
layer_mask Mask applied from an ROI.
masked_data Flux quantity with mask applied.
masked_dispersion Dispersion quantity with mask applied.
raw_uncertainty Flux uncertainty with mask applied.
shape
unit
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(formula, layers) Create a layer from an operation performed on other layers
from_parent(parent[, layer_mask, name, copy]) Create a duplicate child layer from a parent layer
from_self([name, layer_mask]) Create a new, parentless, layer based on this layer
set_units([disp_unit, data_unit]) Set the dispersion and flux units

Attributes Documentation

full_mask

Mask for spectrum data.

layer_mask

Mask applied from an ROI.

masked_data

Flux quantity with mask applied. Returns a masked array containing a Quantity object.

masked_dispersion

Dispersion quantity with mask applied. Returns a masked array containing a Quantity object.

raw_uncertainty

Flux uncertainty with mask applied. Returns a masked array containing a Quantity object.

shape
unit
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. Returns a masked array containing a Quantity object.

Methods Documentation

classmethod from_formula(formula, layers)[source] [edit on github]

Create a layer from an operation performed on other layers

Parameters:

formula: str

The operation to perform on the given layers.

layers: [layer, …]

The layers which are arguments to the given formula.

Returns:

new_layer:

Result of the operation

classmethod from_parent(parent, layer_mask=None, name=None, copy=True)[source] [edit on github]

Create a duplicate child layer from a parent layer

Parameters:

parent: layer

The layer to duplicate.

layer_mask: layer

The layer defining the valid data mask.

name: str

Layer’s name. If None, a name based on the parent layer is used.

Returns:

child_layer:

The new layer.

from_self(name=u'', layer_mask=None)[source] [edit on github]

Create a new, parentless, layer based on this layer

Parameters:

name: str

Name of the new layer

layer_mask: layer

The layer defining the valid data mask.

Returns:

new_layer:

The new, parentless, layer.

set_units(disp_unit=None, data_unit=None)[source] [edit on github]

Set the dispersion and flux units

Parameters:

disp_unit: `~astropy.units`

The dispersion units.

data_unit: `~astropy.units`

The flux units.