Skip to content

Latest commit

 

History

History
200 lines (123 loc) · 7.15 KB

plugins.rst

File metadata and controls

200 lines (123 loc) · 7.15 KB

Data Analysis Plugins

The Specviz2D data analysis plugins are meant to aid quick-look analysis of 2D spectroscopic data. All plugins are accessed via the plugin icon in the upper right corner of the Specviz application.

Metadata Viewer

Metadata Viewer <imviz_metadata-viewer>

Imviz documentation on using the metadata viewer.

Plot Options

Plot Options <specviz-plot-options>

Specviz documentation on the plot options plugin.

Subset Tools

Subset Tools <imviz-subset-plugin>

Imviz documentation describing the concept of subsets in Jdaviz.

Spectral Extraction

The Spectral Extraction plugin exposes specreduce methods for tracing, background subtraction, and spectral extraction from 2D spectra.

To interact with the plugin via the API in a notebook, access the plugin object via:

sp_ext = viz.app.get_tray_item_from_name('spectral-extraction')

Trace

The first section of the plugin allows for creating and visualizing specreduce Trace objects.

Once you interact with any of the inputs in the extract step or hover over that area of the plugin, the live visualization will change to show the trace as a solid line.

To create a new trace in the plugin, choose the desired "Trace Type" and edit any input arguments. A preview of the trace will update in real time in the 2D spectrum viewer.

To export and access the specreduce Trace object defined in the plugin, call ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.export_trace:

trace = sp_ext.export_trace()

To import the parameters from a specreduce Trace object, whether it's new or was exported and modified in the notebook, call~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.import_trace:

sp_ext.import_trace(trace)

Background

The background step of the plugin allows for creating background and background-subtracted images via specreduce.background.

Once you interact with any of the inputs in the background step or hover over that area of the plugin, the live visualization will change to show the center (dotted line) and edges (solid lines) of the background region(s). Choose between creating the background around the trace defined in the Trace section, or around a "Manual" flat trace.

To visualize the resulting background or background-subtracted image, click on the respective panel, and choose a label for the new data entry. The exported images will now appear in the data dropdown menu in the 2D spectrum viewer, and can be exported into the notebook via the API <specviz2d-export-data-2d>. To refine the trace based on the background-subtracted image, return to the Trace step and select the exported background-subtracted image as input.

To export and access the specreduce Background object defined in the plugin, call ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.export_bg:

bg = sp_ext.export_bg()

To access the background image or background-subtracted image as a ~specutils.Spectrum1D object, call ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.export_bg_img or ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.export_bg_img, respectively.

To import the parameters from a specreduce Background object into the plugin, whether it's new or was exported and modified in the notebook, call ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.import_bg:

sp_ext.import_bg(bg)

Extract

The extraction step of the plugin extracts a 1D spectrum from an input 2D spectrum via specreduce.extract.

Once you interact with any of the inputs in the extract step or hover over that area of the plugin, the live visualization will change to show the center (dotted line) and edges (solid lines) of the extraction region.

The input 2D spectrum defaults to "From Plugin", which will use the settings defined in the Background step to create a background-subtracted image without needing to export it into the app itself. To use a different 2D spectrum loaded in the app (or exported from the Background step), choose that from the dropdown instead. To skip background subtraction, choose the original 2D spectrum as input.

To visualize or export the resulting 2D spectrum, provide a data label and click "Extract". The resulting spectrum object can be accessed from the API <specviz2d-export-data-1d> in the same way as any other data product in the spectrum viewer.

To export and access the specreduce extraction object defined in the plugin, call ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.export_extract:

ext = sp_ext.export_extract()

To access the extracted spectrum as a ~specutils.Spectrum1D object, call ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.export_extract_spectrum.

To import the parameters from a specreduce extraction object (either a new object, or an exported one modified in the notebook) into the plugin, call ~jdaviz.configs.specviz2d.plugins.spectral_extraction.spectral_extraction.SpectralExtraction.import_extract:

sp_ext.import_extract(ext)

Gaussian Smooth

Gaussian Smooth <gaussian-smooth>

Specviz documentation on Gaussian Smooth.

Model Fitting

Model Fitting <specviz-model-fitting>

Specviz documentation on Model Fitting.

Unit Conversion

Unit Conversion <unit-conversion>

Specviz documentation on Unit Conversion.

Line Lists

Note

The line lists plugin is currently disabled if the 1D spectrum was automatically extracted and/or the 1D spectrum's x-axis is in pixels.

Line Lists <line-lists>

Specviz documentation on Line Lists.

Line Analysis

Note

The line analysis plugin is currently disabled if the 1D spectrum was automatically extracted and/or the 1D spectrum's x-axis is in pixels.

Line Analysis <line-analysis>

Specviz documentation on Line Analysis.

Export Plot

This plugin allows exporting the plot in a given viewer to various image formats.