2D Spectral Extraction#

Plugin Availability

This plugin works with 3D spectral cubes.

The plugin will be visible when at least one 3D spectral cube dataset is loaded.

Extract 1D spectra from 2D spectroscopic data.

Description#

The 2D Spectral Extraction plugin extracts 1D spectra from 2D spectroscopic data by summing or averaging across the spatial direction.

Key Features:

  • Extract 1D from 2D spectra

  • Configurable extraction aperture

  • Background subtraction

  • Trace following

  • Uncertainty propagation

UI Access#

v0.1
Click toolbar icons to toggle different sidebars
Data Menu

Control data and subset layer order and visibility for each viewer. Toggle layer visibility, reorder layers by dragging, and manage which data appears in the viewer.

dm = jd.viewers[viewer].data_menu

Click the Spectral Extraction icon in the plugin toolbar to:

  1. Define extraction aperture

  2. Set background regions

  3. Configure extraction parameters

  4. Extract 1D spectrum

API Access#

plg = specviz2d.plugins['Spectral Extraction']
plg.aperture_width = 5  # pixels
plg.extract()

API References#

The Spectral Extraction 2D plugin exposes specreduce methods for tracing,

background subtraction, and spectral extraction from 2D spectra. See the 2D 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()

  • interactive_extract Whether to automatically extract when parameters change.

  • trace_dataset (SelectPluginComponent) controls the input dataset for generating the trace.

  • trace_type (SelectPluginComponent) controls the type of trace to be generated.

  • trace_peak_method (SelectPluginComponent) only applicable if trace_type is not Flat.

  • trace_pixel pixel of the trace. If trace_type is not Flat, then this is the “guess” for the automated trace.

  • trace_do_binning only applicable if trace_type is not Flat. Bin the input data when fitting the trace.

  • trace_bins only applicable if trace_type is not Flat and trace_do_binning.

  • trace_order order of the polynomial fit for the trace.

  • trace_offset offset to apply to the trace.

  • trace_trace (SelectPluginComponent) existing trace to use as a reference.

  • trace_window full width of the trace.

  • import_trace()

  • export_trace()

  • bg_dataset (DatasetSelect): controls the input dataset for generating the background.

  • bg_type (SelectPluginComponent): controls the type of background to be generated.

  • bg_trace (SelectPluginComponent) existing trace to use as a reference for the background.

  • bg_trace_pixel only applicable if bg_type is set to Manual

  • bg_separation only applicable if bg_type set set to OneSided or TwoSided. Separation from the referenced trace for the center of each of the background window(s).

  • bg_width full width of each background window(s).

  • bg_statistic (SelectPluginComponent) statistic to use when computing the background. ‘Average’ will account for partial pixel weights, ‘Median’ will include all partial pixels.

  • bg_add_results (AddResults)

  • bg_sub_add_results

  • import_bg()

  • export_bg()

  • export_bg_spectrum()

  • export_bg_img()

  • export_bg_sub()

  • ext_dataset (DatasetSelect): controls the input dataset for generating the extracted spectrum. “From Plugin” will use the background-subtracted image as defined by the background options above. To skip background extraction, select the original input 2D spectrum.

  • ext_trace (DatasetSelect)

  • ext_type (SelectPluginComponent)

  • ext_width full width of the extraction window.

  • horne_ext_profile (SelectPluginComponent) For Horne extract, choice of ‘Gaussian’ or ‘Self (interpolated)’ to use empirical profile from data.

  • self_prof_n_bins Number of bins to use when computing the self-derived profile for Horne Extract.

  • self_prof_interp_degree_x Interpolation degree (in X) to use when computing the self-derived profile for Horne Extract.

  • self_prof_interp_degree_y Interpolation degree (in Y) to use when computing the self-derived profile for Horne Extract.

  • ext_add_results (AddResults)

  • import_extract()

  • export_extract()

  • export_extract_spectrum()

For detailed API documentation, see SpectralExtraction2D.

See Also#