Skip to content

Latest commit

 

History

History
54 lines (30 loc) · 1.22 KB

export_data.rst

File metadata and controls

54 lines (30 loc) · 1.22 KB

Exporting Data From Specviz2D

2D Spectra

Images in the 2D spectrum viewer can be exported as specutils.Spectrum1D objects into the notebook:

specviz2d.app.get_data_from_viewer('spectrum-2d-viewer')

which returns a dictionary, with the loaded data labels as keywords and specutils.Spectrum1D objects as values. To return only a single specutils.Spectrum1D object, pass the data label:

specviz2d.app.get_data_from_viewer('spectrum-2d-viewer', 'my-data-label')

1D Spectra

Similarly, the 1D spectrum data objects can be exported into the notebook:

specviz2d.app.get_data_from_viewer('spectrum-viewer')

or:

specviz2d.app.get_data_from_viewer('spectrum-viewer', 'my-data-label')

An instance of Specviz can also be accessed, which exposes some helper methods from Specviz:

specviz2d.specviz.get_spectra()
.. seealso::

    :ref:`Specviz: Export Data <specviz-export-data>`
        Specviz documentation on exporting spectra.