Mosviz

class jdaviz.configs.mosviz.Mosviz(*args, **kwargs)[source] [edit on github]

Bases: jdaviz.core.helpers.ConfigHelper

Mosviz Helper class

Attributes Summary

specviz

A specviz helper (Specviz) for the Jdaviz application that is wrapped by mosviz

Methods Summary

add_column(data[, column_name])

Add a new data column to the table.

link_table_data(data_obj)

Batch link data in the Mosviz table rather than doing it on data load.

load_1d_spectra(data_obj[, data_labels])

Load and parse a set of 1D spectra objects.

load_2d_spectra(data_obj[, data_labels])

Load and parse a set of 2D spectra objects.

load_data([spectra_1d, spectra_2d, images, ...])

Load and parse a set of MOS spectra and images

load_images(data_obj[, data_labels, share_image])

Load and parse a set of image objects.

load_metadata(data_obj[, ids, spectra, sp1d])

Load and parse a set of FITS objects to extract any relevant metadata.

load_niriss_data(data_obj[, data_labels])

load_spectra(spectra_1d, spectra_2d)

Load 1D and 2D spectra using lists or strings to represent each.

load_spectra_from_directory(directory, ...)

Load 1D and 2D spectra from a directory.

to_csv([filename, selected, overwrite])

Creates a csv file with the contents of the MOS table viewer

to_table()

Creates an astropy QTable object from the MOS table viewer.

Attributes Documentation

specviz

A specviz helper (Specviz) for the Jdaviz application that is wrapped by mosviz

Methods Documentation

add_column(data, column_name=None)[source] [edit on github]

Add a new data column to the table.

Parameters
dataarray-like

Array-like set of data values, e.g. redshifts, RA, DEC, etc.

column_namestr

Header string to be shown in the table.

Batch link data in the Mosviz table rather than doing it on data load.

Parameters
data_objobj

Input for Mosviz data parsers.

load_1d_spectra(data_obj, data_labels=None)[source] [edit on github]

Load and parse a set of 1D spectra objects.

Parameters
data_objlist or str

A list of spectra as translatable container objects (e.g. Spectrum1D) that can be read by glue-jupyter. Alternatively, can be a string file path.

data_labelsstr or list

String representing the label for the data item loaded via data_obj. Can be a list of strings representing data labels for each item in data_obj if data_obj is a list.

load_2d_spectra(data_obj, data_labels=None)[source] [edit on github]

Load and parse a set of 2D spectra objects.

Parameters
data_objlist or str

A list of 2D spectra as translatable container objects (e.g. Spectrum1D) that can be read by glue-jupyter. Alternatively, can be a string file path.

data_labelsstr or list

String representing the label for the data item loaded via data_obj. Can be a list of strings representing data labels for each item in data_obj if data_obj is a list.

load_data(spectra_1d=None, spectra_2d=None, images=None, spectra_1d_label=None, spectra_2d_label=None, images_label=None, *args, **kwargs)[source] [edit on github]

Load and parse a set of MOS spectra and images

Parameters
spectra_1dlist or str

A list of spectra as translatable container objects (e.g. Spectrum1D) that can be read by glue-jupyter. Alternatively, can be a string file path.

spectra_2dlist or str

A list of spectra as translatable container objects (e.g. Spectrum1D) that can be read by glue-jupyter. Alternatively, can be a string file path.

imageslist of obj, str, or None

A list of images as translatable container objects (string file path, FITS HDU, FITS HDUList, NDData, or numpy array). Alternatively, can be a string file path. If None, no images are displayed.

spectra_1d_labelstr or list

String representing the label for the data item loaded via onedspectra. Can be a list of strings representing data labels for each item in data_obj if data_obj is a list.

spectra_2d_labelstr or list

String representing the label for the data item loaded via twodspectra. Can be a list of strings representing data labels for each item in data_obj if data_obj is a list.

images_labelstr or list

String representing the label for the data item loaded via images. Can be a list of strings representing data labels for each item in data_obj if data_obj is a list.

load_images(data_obj, data_labels=None, share_image=0)[source] [edit on github]

Load and parse a set of image objects. If providing a file path, it must be readable by astropy.io.fits.

Parameters
data_objlist of obj, str, or None

A list of images as translatable container objects (FITS HDU, FITS HDUList, NDData, or numpy array). Alternatively, can be a string file path. If None, no images are displayed.

data_labelsstr or list

String representing the label for the data item loaded via data_obj. Can be a list of strings representing data labels for each item in data_obj if data_obj is a list.

share_imageint, optional

If 0, images are treated as applying to individual spectra. If non-zero, a single image will be shared by multiple spectra so that clicking a different row in the table does not reload the displayed image. Currently, if non-zero, the provided number must match the number of spectra.

load_metadata(data_obj, ids=None, spectra=False, sp1d=False)[source] [edit on github]

Load and parse a set of FITS objects to extract any relevant metadata.

Parameters
data_objlist or str

A list of FITS objects with parseable headers. Alternatively, can be a string file path.

idslist of str

A list with identification strings to be used to label mosviz table rows. Typically, a list with file names.

spectraBoolean

In case the FITS objects are related to spectral data.

sp1dBoolean

In case the FITS objects are related to 1d spectral data.

load_niriss_data(data_obj, data_labels=None)[source] [edit on github]
load_spectra(spectra_1d, spectra_2d)[source] [edit on github]

Load 1D and 2D spectra using lists or strings to represent each.

Parameters
spectra_1dlist or str

A list of spectra as translatable container objects (e.g. Spectrum1D) that can be read by glue-jupyter. Alternatively, can be a string file path.

spectra_2dlist or str

A list of spectra as translatable container objects (e.g. Spectrum1D) that can be read by glue-jupyter. Alternatively, can be a string file path.

load_spectra_from_directory(directory, instrument)[source] [edit on github]

Load 1D and 2D spectra from a directory.

Parameters
directorystr

The path of the directory where Mosviz data is located.

instrumentstr

The instrument the Mosviz data originated from.

to_csv(filename='MOS_data.csv', selected=False, overwrite=False)[source] [edit on github]

Creates a csv file with the contents of the MOS table viewer

Parameters
filename: str

Filename for the output CSV file.

selected: bool

If set to True, only the checked rows in the table will be output.

to_table()[source] [edit on github]

Creates an astropy QTable object from the MOS table viewer.

Returns
QTable

An astropy table constructed from the loaded mos data.