Datasets#

Documentation coming soon. See Exporting Data for general export information.

UI Access#

Top-Level API Access#

The datasets property provides API access to all data loaded in Jdaviz. This property returns a dictionary of data API objects that allow you to retrieve data, export to python objects in the notebook, and manipulate within the app.

import jdaviz as jd

jd.show()
jd.load('mydata.fits', format='1D Spectrum', data_label='spectrum')

# Access all datasets
datasets = jd.datasets
# Returns: {'spectrum': <Data API for spectrum>}

# Access a specific dataset
spectrum_api = jd.datasets['spectrum']

Each dataset is wrapped in a specialized data API object depending on the data type:

All data API objects provide common methods for working with your data.

Basic usage:

# Get the data object
spectrum = jd.datasets['spectrum'].get_data()

# Work with the returned object
print(spectrum.spectral_axis)
print(spectrum.flux)

Add a dataset to a specific viewer programmatically:

# Add data to a viewer
jd.datasets['spectrum'].add_to_viewer('spectrum-viewer')