Specviz#
- class jdaviz.configs.specviz.helper.Specviz(*args, **kwargs)[source]#
Bases:
ConfigHelper
,LineListMixin
Specviz Helper class.
Methods Summary
flip_x
()flip_y
()get_data
([data_label, spectral_subset, cls, ...])Returns data with name equal to data_label of type cls with subsets applied from spectral_subset.
get_spectra
([data_label, spectral_subset, ...])Returns the current data loaded into the main viewer
get_spectral_regions
([use_display_units])load_data
(data[, data_label, format, ...])Load data into Specviz.
set_spectrum_tick_format
(fmt[, axis])x_limits
([x_min, x_max])y_limits
([y_min, y_max])Methods Documentation
- autoscale_x()[source]#
Deprecated since version 4.2: The autoscale_x function is deprecated and may be removed in a future version. Use viewers[‘spectrum-viewer’].reset_limits instead.
Sets the x-axis limits to the min/max of the reference data
- autoscale_y()[source]#
Deprecated since version 4.2: The autoscale_y function is deprecated and may be removed in a future version. Use viewers[‘spectrum-viewer’].reset_limits instead.
Sets the y-axis limits to the min/max of the reference data
- flip_x()[source]#
Deprecated since version 4.2: The flip_x function is deprecated and may be removed in a future version. Use viewers[‘spectrum-viewer’].set_limits instead.
Flips the current limits of the x-axis
- flip_y()[source]#
Deprecated since version 4.2: The flip_y function is deprecated and may be removed in a future version. Use viewers[‘spectrum-viewer’].set_limits instead.
Flips the current limits of the y-axis
- get_data(data_label=None, spectral_subset=None, cls=None, use_display_units=False)[source]#
Returns data with name equal to data_label of type cls with subsets applied from spectral_subset.
- Parameters:
- data_labelstr, optional
Provide a label to retrieve a specific data set from data_collection.
- spectral_subsetstr, optional
Spectral subset applied to data.
- cls
Spectrum1D
, optional The type that data will be returned as.
- use_display_units: bool, optional
Whether to convert to the display units defined in the <unit-conversion> plugin.
- Returns:
- datacls
Data is returned as type cls with subsets applied.
- get_spectra(data_label=None, spectral_subset=None, apply_slider_redshift='Warn')[source]#
Returns the current data loaded into the main viewer
- get_spectral_regions(use_display_units=False)[source]#
Deprecated since version 4.1: The get_spectral_regions function is deprecated and may be removed in a future version. Use subset_tools.get_regions instead.
A simple wrapper around the app-level call to retrieve only spectral subsets, which are now returned as SpectralRegions by default.
- Parameters:
- use_display_unitsbool, optional
Whether to convert to the display units defined in the Unit Conversion plugin.
- Returns:
- spec_regsdict
Mapping from the names of the subsets to the subsets expressed as
specutils.SpectralRegion
objects.
- load_data(data, data_label=None, format=None, show_in_viewer=True, concat_by_file=False, cache=None, local_path=None, timeout=None, load_as_list=False)[source]#
Load data into Specviz.
- Parameters:
- datastr,
Spectrum1D
, orSpectrumList
Spectrum1D, SpectrumList, or path to compatible data file.
- data_labelstr
The Glue data label found in the
DataCollection
.- formatstr
Loader format specification used to indicate data format in
read
io method.- show_in_viewerbool
Show data in viewer(s).
- concat_by_filebool
If True and there is more than one available extension, concatenate the extensions within each spectrum file passed to the parser and add a concatenated spectrum to the data collection.
- cacheNone, bool, or str
Cache the downloaded file if the data are retrieved by a query to a URL or URI.
- local_pathstr, optional
Cache remote files to this path. This is only used if data is requested from
astroquery.mast
.- timeoutfloat, optional
If downloading from a remote URI, set the timeout limit for remote requests in seconds (passed to
download_file
ortimeout
).
- datastr,
- set_spectrum_tick_format(fmt, axis=None)[source]#
Deprecated since version 4.2: The set_spectrum_tick_format function is deprecated and may be removed in a future version. Use viewers[‘spectrum-viewer’].set_tick_format instead.
Manually set the tick format of one of the axes of the profile viewer.
- Parameters:
- fmtstr
Format of tick marks in the spectrum viewer. For example,
'0.1e'
to set scientific notation or'0.2f'
to turn it off.- axis{0, 1}
The spectrum viewer data axis. Axis 1 corresponds to the Y-axis and 0 to the X-axis.
- x_limits(x_min=None, x_max=None)[source]#
Deprecated since version 4.2: The x_limits function is deprecated and may be removed in a future version. Use viewers[‘spectrum-viewer’].set_limits instead.
Sets the limits of the x-axis
- Parameters:
- x_min
The lower bound of the axis. Can also be a Specutils SpectralRegion
- x_max
The upper bound of the axis
- y_limits(y_min=None, y_max=None)[source]#
Deprecated since version 4.2: The y_limits function is deprecated and may be removed in a future version. Use viewers[‘spectrum-viewer’].set_limits instead.
Sets the limits of the y-axis
- Parameters:
- y_min
The lower bound of the axis. Can also be a Specutils SpectralRegion
- y_max
The upper bound of the axis