SpectralExtraction#

class jdaviz.configs.cubeviz.plugins.spectral_extraction.spectral_extraction.SpectralExtraction(*args, **kwargs)[source]#

Bases: PluginTemplateMixin, ApertureSubsetSelectMixin, DatasetSelectMixin, AddResultsMixin

See the Spectral Extraction Plugin Documentation for more details.

Only the following attributes and methods are available through the public plugin API:

  • show()

  • open_in_tray()

  • close_in_tray()

  • aperture (ApertureSubsetSelect): Subset to use for the spectral extraction, or Entire Cube.

  • wavelength_dependent: Whether the aperture should be considered wavelength-dependent. The cone is defined to intersect aperture at reference_spectral_value.

  • reference_spectral_value: The wavelength that will be used to calculate the radius of the cone through the cube.

  • background (ApertureSubsetSelect): Subset to use for background subtraction, or None.

  • bg_wavelength_dependent: Whether the background aperture should be considered wavelength-dependent (requires wavelength_dependent to also be set to True). The cone is defined to intersect background at reference_spectral_value.

  • `bg_spec_per_spaxel:

    Whether to normalize the background per spaxel when calling extract_bg_spectrum. Otherwise, the spectrum will be scaled by the ratio between the areas of the aperture and the background aperture. Only applicable if function is ‘Sum’.

  • bg_spec_add_results (AddResults)

  • extract_bg_spectrum()

  • aperture_method (SelectPluginComponent): Method to use for extracting spectrum (and background, if applicable).

  • add_results (AddResults)

  • extract()

Public constructor

Attributes Summary

active_step

A trait for unicode strings.

aperture_area_along_spectral

aperture_method_items

An instance of a Python list.

aperture_method_selected

A trait for unicode strings.

aperture_weight_mask

bg_area_along_spectral

bg_export_available

A boolean (True, False) trait.

bg_items

An instance of a Python list.

bg_scale_factor

A float trait.

bg_selected

A trait which allows any value.

bg_selected_validity

An instance of a Python dict.

bg_spec_add_to_viewer_items

An instance of a Python list.

bg_spec_add_to_viewer_selected

A trait for unicode strings.

bg_spec_per_spaxel

A boolean (True, False) trait.

bg_spec_results_label

A trait for unicode strings.

bg_spec_results_label_auto

A boolean (True, False) trait.

bg_spec_results_label_default

A trait for unicode strings.

bg_spec_results_label_invalid_msg

A trait for unicode strings.

bg_spec_results_label_overwrite

A boolean (True, False) trait.

bg_spec_spinner

A boolean (True, False) trait.

bg_wavelength_dependent

A boolean (True, False) trait.

bg_weight_mask

conflicting_aperture_and_function

A boolean (True, False) trait.

conflicting_aperture_error_message

A trait for unicode strings.

cube

do_auto_extraction

export_enabled

A boolean (True, False) trait.

extraction_available

A boolean (True, False) trait.

filename

A trait for unicode strings.

flux_units

A trait for unicode strings.

function_items

An instance of a Python list.

function_selected

A trait for unicode strings.

inverted_mask_non_science

live_update_subscriptions

marks

mask_cube

reference_spectral_value

Mixin to handle empty floating point field.

resulting_product_name

A trait for unicode strings.

results_units

A trait for unicode strings.

sb_units

A trait for unicode strings.

show_live_preview

A boolean (True, False) trait.

slice_display_unit

slice_display_unit_name

slice_indicator_viewers

slice_plugin

slice_spectral_value

A float trait.

spatial_axes

spectrum_y_units

A trait for unicode strings.

template_file

uncert_cube

user_api

uses_active_status

A boolean (True, False) trait.

wavelength_dependent

A boolean (True, False) trait.

wavelength_dependent_available

A boolean (True, False) trait.

Methods Summary

__call__([add_data])

Call self as a function.

extract([return_bg, add_data])

Extract the spectrum from the data cube according to the plugin inputs.

extract_bg_spectrum([add_data])

Create a background 1D spectrum from the input parameters defined in the plugin.

vue_adopt_slice_as_reference(*args)

vue_create_bg_spec(*args, **kwargs)

vue_goto_reference_spectral_value(*args)

vue_spectral_extraction(*args, **kwargs)

Attributes Documentation

active_step#

A trait for unicode strings.

aperture_area_along_spectral#
aperture_method_items#

An instance of a Python list.

aperture_method_selected#

A trait for unicode strings.

aperture_weight_mask#
bg_area_along_spectral#
bg_export_available#

A boolean (True, False) trait.

bg_items#

An instance of a Python list.

bg_scale_factor#

A float trait.

bg_selected#

A trait which allows any value.

bg_selected_validity#

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

bg_spec_add_to_viewer_items#

An instance of a Python list.

bg_spec_add_to_viewer_selected#

A trait for unicode strings.

bg_spec_per_spaxel#

A boolean (True, False) trait.

bg_spec_results_label#

A trait for unicode strings.

bg_spec_results_label_auto#

A boolean (True, False) trait.

bg_spec_results_label_default#

A trait for unicode strings.

bg_spec_results_label_invalid_msg#

A trait for unicode strings.

bg_spec_results_label_overwrite#

A boolean (True, False) trait.

bg_spec_spinner#

A boolean (True, False) trait.

bg_wavelength_dependent#

A boolean (True, False) trait.

bg_weight_mask#
conflicting_aperture_and_function#

A boolean (True, False) trait.

conflicting_aperture_error_message#

A trait for unicode strings.

cube#
do_auto_extraction = True#
export_enabled#

A boolean (True, False) trait.

extraction_available#

A boolean (True, False) trait.

filename#

A trait for unicode strings.

flux_units#

A trait for unicode strings.

function_items#

An instance of a Python list.

function_selected#

A trait for unicode strings.

inverted_mask_non_science#
live_update_subscriptions#
marks#
mask_cube#
reference_spectral_value#

Mixin to handle empty floating point field.

resulting_product_name#

A trait for unicode strings.

results_units#

A trait for unicode strings.

sb_units#

A trait for unicode strings.

show_live_preview#

A boolean (True, False) trait.

slice_display_unit#
slice_display_unit_name#
slice_indicator_viewers#
slice_plugin#
slice_spectral_value#

A float trait.

spatial_axes#
spectrum_y_units#

A trait for unicode strings.

template_file = ('/home/docs/checkouts/readthedocs.org/user_builds/jdaviz/envs/latest/lib/python3.11/site-packages/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py', 'spectral_extraction.vue')#
uncert_cube#
user_api#
uses_active_status#

A boolean (True, False) trait.

wavelength_dependent#

A boolean (True, False) trait.

wavelength_dependent_available#

A boolean (True, False) trait.

Methods Documentation

__call__(add_data=True)[source]#

Call self as a function.

extract(return_bg=False, add_data=True, **kwargs)[source]#

Extract the spectrum from the data cube according to the plugin inputs.

Parameters:
return_bgbool, optional

Whether to also return the spectrum of the background, if applicable.

add_databool, optional

Whether to load the resulting data back into the application according to add_results.

kwargsdict

Additional keyword arguments passed to the NDDataArray collapse operation. Examples include propagate_uncertainties and operation_ignores_mask.

extract_bg_spectrum(add_data=False, **kwargs)[source]#

Create a background 1D spectrum from the input parameters defined in the plugin.

If function is ‘sum’, then the value is scaled by the relative ratios of the area (along the spectral axis) of aperture to background.

Parameters:
add_databool

Whether to add the resulting spectrum to the application, according to the options defined in the plugin.

kwargsdict

Additional keyword arguments passed to the NDDataArray collapse operation. Examples include propagate_uncertainties and operation_ignores_mask.

vue_adopt_slice_as_reference(*args)[source]#
vue_create_bg_spec(*args, **kwargs)[source]#
vue_goto_reference_spectral_value(*args)[source]#
vue_spectral_extraction(*args, **kwargs)[source]#