Utilities API#

jdaviz.app Module#

Classes#

Application(**kwargs)

The main application object containing implementing the ipyvue/vuetify template instructions for composing the interface.

jdaviz.configs.default.plugins.data_tools.file_chooser Module#

Classes#

FileChooser(**kwargs)

FileChooser class.

jdaviz.configs.default.plugins.line_lists.line_list_mixin Module#

Classes#

LineListMixin()

Line list-related methods and properties for use in the configuration helper classes.

jdaviz.configs.default.plugins.model_fitting.fitting_backend Module#

Functions#

fit_model_to_spectrum(spectrum, ...[, ...])

Fits a CompoundModel to a Spectrum1D instance.

jdaviz.configs.default.plugins.model_fitting.initializers Module#

This module is used to initialize spectral models to the data at hand.

This is used by model-fitting code that has to create spectral model instances with sensible parameter values such that they can be used as first guesses by the fitting algorithms.

Functions#

initialize(instance, x, y)

Initialize given model.

get_model_parameters(model_cls[, model_kwargs])

jdaviz.configs.imviz.wcs_utils Module#

This module handles calculations based on world coordinate system (WCS).

Functions#

get_compass_info(image_wcs, image_shape[, r_fac])

Calculate WCS compass parameters.

draw_compass_mpl(image[, orig_shape, wcs, ...])

Visualize the compass using Matplotlib.

jdaviz.core.astrowidgets_api Module#

Classes#

AstrowidgetsImageViewerMixin()

This class implements astrowidgets API for Jdaviz image viewer.

jdaviz.core.config Module#

This file contains helper function related to configuration handling.

Functions#

read_configuration([path])

Loads a configuration from a YAML file.

get_configuration([path, section, config])

Retrieve a copy of a specified configuration.

list_configurations()

Get a list of pre-built configurations.

jdaviz.core.custom_traitlets Module#

Classes#

HandleEmptyMixin(*args, **kwargs)

Mixin to handle empty field.

IntHandleEmpty(*args, **kwargs)

Mixin to handle empty integer field.

FloatHandleEmpty(*args, **kwargs)

Mixin to handle empty floating point field.

jdaviz.core.data_formats Module#

Functions#

guess_dimensionality(filename)

Guess the dimensionality of a file.

get_valid_format(filename)

Identify a best match Jdaviz configuration from a filename.

identify_data(filename[, current])

Identify the data format and application configuration from a filename.

identify_helper(filename[, ext])

Guess the appropriate viz helper for a data file.

jdaviz.core.events Module#

Classes#

NewViewerMessage(cls, data[, x_attr])

Message to trigger viewer creation in the application.

ViewerAddedMessage(viewer_id, *args, **kwargs)

Unlike NewViewerMessage, this should be emitted after a viewer is created.

ViewerRemovedMessage(viewer_id, *args, **kwargs)

Message emitted after a viewer is destroyed by the application.

LoadDataMessage(path, *args, **kwargs)

Create a new message

AddDataMessage(data, viewer[, viewer_id])

Create a new message

SnackbarMessage(text[, color, timeout, loading])

Create a new message

RemoveDataMessage(data, viewer[, viewer_id])

Create a new message

AddLineListMessage(table, *args, **kwargs)

Create a new message

RowLockMessage(is_locked, *args, **kwargs)

Create a new message

SliceSelectSliceMessage(value, *args, **kwargs)

Message generated by the cubeviz helper and processed by the slice plugin to sync slice selection across all viewers

SliceValueUpdatedMessage(value, value_unit, ...)

Message generated by the slice plugin when the selected slice is updated

SliceToolStateMessage(change, viewer, *args, ...)

Message generated by the select slice plot plugin when activated/deactivated

TableClickMessage(selected_index[, shared_image])

Message generated by Mosviz table to zoom to object on image

LinkUpdatedMessage(link_type, ...)

Message generated when the WCS/pixel linking is changed

ExitBatchLoadMessage(*args, **kwargs)

Message generated when exiting the outermost batch_load context manager

AstrowidgetMarkersChangedMessage(...)

Message generated when markers are added/removed from an image viewer via astrowidgets API

MarkersPluginUpdate(table_length, *args, ...)

Message when the length of the markers plugin table changes

CanvasRotationChangedMessage(viewer_id, ...)

Message generated by canvas rotation plugin

GlobalDisplayUnitChanged(axis, unit, *args, ...)

Message generated when the global app-wide display unit is changed

ChangeRefDataMessage(data, viewer[, ...])

Create a new message

PluginTableAddedMessage(sender)

Message generated when a plugin table is initialized

PluginTableModifiedMessage(sender)

Message generated when the items in a plugin table are changed

PluginPlotAddedMessage(sender)

Message generated when a plugin plot is initialized

PluginPlotModifiedMessage(sender)

Message generated when the items in a plugin plot are changed

jdaviz.core.freezable_state Module#

Classes#

FreezableState()

FreezableProfileViewerState(**kwargs)

FreezableBqplotImageViewerState(*args, **kwargs)

jdaviz.core.helpers Module#

Helper classes are meant to provide a convenient user API for specific configurations. They allow a separation of “viztool-specific” API and the glue application objects.

See also spacetelescope/jdaviz#104 for more details on the motivation behind this concept.

Classes#

ConfigHelper([app, verbosity, history_verbosity])

The Base Helper Class.

ImageConfigHelper(*args, **kwargs)

ConfigHelper that uses an image viewer as its primary viewer.

jdaviz.core.linelists Module#

Functions#

get_linelist_metadata()

Return metadata for line lists.

get_available_linelists()

Return all available line lists.

load_preset_linelist(name)

Return one of the preset line lists, loaded into QTable.

jdaviz.core.marks Module#

Classes#

OffscreenLinesMarks(viewer)

BaseSpectrumVerticalLine(**kwargs)

Public constructor

SpectralLine(**kwargs)

Subclass on bqplot Lines, mostly so that we can erase spectral lines by eliminating any SpectralLines objects from a figures marks list.

SliceIndicatorMarks(**kwargs)

Subclass on bqplot Lines to handle slice/wavelength indicator.

ShadowMixin()

Mixin class to propagate traits from one mark object to another.

ShadowLine(**kwargs)

Create a white shadow line around another line to help make it standout on top of other lines.

ShadowLabelFixedY(**kwargs)

Label whose position shadows that of a parent shadowing line and will flip alignment based on whether it is left or right of the center of the viewer.

PluginMark(*args, **kwargs)

LinesAutoUnit(**kwargs)

Public constructor

PluginLine(**kwargs)

Public constructor

PluginScatter(**kwargs)

Public constructor

LineAnalysisContinuum(**kwargs)

Public constructor

LineAnalysisContinuumCenter(**kwargs)

Public constructor

LineAnalysisContinuumLeft(**kwargs)

Public constructor

LineAnalysisContinuumRight(**kwargs)

Public constructor

LineUncertainties(**kwargs)

Public constructor

ScatterMask(**kwargs)

Public constructor

SelectedSpaxel(**kwargs)

Public constructor

MarkersMark(**kwargs)

Public constructor

FootprintOverlay(**kwargs)

Public constructor

ApertureMark(**kwargs)

Public constructor

SpectralExtractionPreview(**kwargs)

Public constructor

jdaviz.core.region_translators Module#

The region_translators module houses translations of Region Shapes to Aperture Photometry (photutils.aperture) apertures.

Functions#

regions2roi(region_shape[, wcs])

Convert a given regions shape to glue ROI.

regions2aperture(region_shape)

Convert a given regions shape to photutils aperture.

aperture2regions(aperture)

Convert a given photutils aperture to regions shape.

jdaviz.core.registries Module#

Functions#

convert(name)

Converts camel-case strings to snake-case.

Classes#

UniqueDictRegistry()

Base registry class that handles hashmap-like associations between a string representation of a plugin and the class to be instantiated.

ViewerRegistry()

Registry containing references to custom viewers.

TrayRegistry()

Registry containing references to plugins that will be added to the sidebar tray tabs.

ToolRegistry()

Registry containing references to plugins which will populate the application-level toolbar.

MenuRegistry()

Registry containing references to plugins that will populate the application-level menu bar.

DataParserRegistry()

Registry containing parsing functions for attempting to auto-populate the application-defined initial viewers.

jdaviz.core.template_mixin Module#

Functions#

show_widget(widget, loc, title)

skip_if_no_updates_since_last_active([...])

with_spinner([spinner_traitlet])

decorator on a plugin method to set a traitlet to True at the beginning and False either on failure or successful completion.

with_temp_disable([timeout, ...])

decorator on a plugin method to track the amount of time the wrapped method takes, and disable live plugin-previews if it takes longer than timeout seconds.

Classes#

TemplateMixin(*args, **kwargs)

Public constructor

PluginTemplateMixin(*args, **kwargs)

This base class can be inherited by all sidebar/tray plugins to expose common functionality.

ViewerPropertiesMixin()

BasePluginComponent(plugin, **kwargs)

This base class handles attaching traitlets from the plugin itself to logic handled within the component, support for caching and clearing caches on properties, and common properties for accessing the app, etc.

MultiselectMixin(**kwargs)

Public constructor

SelectPluginComponent(**kwargs)

Plugin select, with support for single or multi-selection.

UnitSelectPluginComponent(**kwargs)

This extends BasePluginComponent for common functionality for a select/dropdown component.

EditableSelectPluginComponent(**kwargs)

Plugin select with support for renaming, adding, and deleting items (by the user).

PluginSubcomponent(**kwargs)

Public constructor

SubsetSelect(**kwargs)

Plugin select for subsets, with support for single or multi-selection.

SubsetSelectMixin(**kwargs)

Applies the SubsetSelect component as a mixin in the base plugin.

SpatialSubsetSelectMixin(**kwargs)

Applies the SubsetSelect component as a mixin in the base plugin.

SpectralSubsetSelectMixin(**kwargs)

Applies the SubsetSelect component as a mixin in the base plugin.

ApertureSubsetSelect(**kwargs)

Plugin select for aperture subsets, with support for single or multi-selection, as well as live-preview rendered in the viewers.

ApertureSubsetSelectMixin(**kwargs)

Applies the ApertureSubsetSelect component as a mixin in the base plugin.

DatasetSpectralSubsetValidMixin(**kwargs)

Adds a traitlet tracking whether self.dataset and self.spectral_subset overlap in the spectral axis.

SpectralContinuumMixin(**kwargs)

Plugin select to choose options for a linear spectral continuum.

ViewerSelect(**kwargs)

Plugin select for viewers, with support for single or multi-selection.

ViewerSelectMixin(**kwargs)

Applies the ViewerSelect component as a mixin in the base plugin.

LayerSelect(**kwargs)

Plugin select for layers, with support for single or multi-selection.

LayerSelectMixin(**kwargs)

Applies the LayerSelect component as a mixin in the base plugin.

PluginTableSelect(**kwargs)

Plugin select for plugin table entries, with support for single or multi-selection.

PluginTableSelectMixin(**kwargs)

Public constructor

PluginPlotSelect(**kwargs)

Plugin select for plugin plot entries, with support for single or multi-selection.

PluginPlotSelectMixin(**kwargs)

Public constructor

NonFiniteUncertaintyMismatchMixin(**kwargs)

Adds a traitlet that identifies if there are any finite data values that correspond to a non-finite uncertainty at that index.

DatasetSelect(**kwargs)

Plugin select for data entries, with support for single or multi-selection.

DatasetSelectMixin(**kwargs)

Applies the DatasetSelect component as a mixin in the base plugin.

DatasetMultiSelectMixin(**kwargs)

Applies the DatasetSelect component as a mixin in the base plugin with togglable multiselect.

FileImportSelectPluginComponent(**kwargs)

IMPORTANT: Always accompany with HasFileImportSelect IMPORTANT: currently assumed only one instance per-plugin

HasFileImportSelect(**kwargs)

Public constructor

Table(**kwargs)

Table subcomponent.

TableMixin(**kwargs)

Table subcomponent mixin.

Plot(**kwargs)

Plot subcomponent.

PlotMixin(**kwargs)

Plot subcomponent mixin.

AutoTextField(plugin, value, default, auto, ...)

Label component with the ability to synchronize to a plugin-provided default value or override with a custom value.

AutoTextFieldMixin(**kwargs)

Applies the AutoTextField component as a mixin in the base plugin.

AddResults(plugin, label, label_default, ...)

Plugin component for providing a data-label and selecting a viewer to add the results from the plugin.

AddResultsMixin(**kwargs)

Applies the AddResults component as a mixin in the base plugin.

PlotOptionsSyncState(plugin, viewer_select, ...)

Plugin component for syncing with glue state objects.

jdaviz.core.validunits Module#

Functions#

units_to_strings(unit_list)

Convert equivalencies into readable versions of the units.

create_spectral_equivalencies_list(...[, ...])

Get all possible conversions from current spectral_axis_unit.

create_flux_equivalencies_list(flux_unit, ...)

Get all possible conversions for flux from current flux units.

jdaviz.models.physical_models Module#

Models that have physical origins.

Classes#

BlackBody(*args, **kwargs)

Blackbody model using the Planck function.

Class Inheritance Diagram#

Inheritance diagram of jdaviz.models.physical_models.BlackBody

jdaviz.utils Module#

Functions#

enable_hot_reloading()

Use watchdog to perform hot reloading.

bqplot_clear_figure(fig)

Clears a given bqplot.Figure to mimic matplotlib clf().

standardize_metadata(metadata)

Standardize given metadata so it can be viewed in Metadata Viewer plugin.

alpha_index(index)

Converts an index to label (A-Z, AA-ZZ).

get_subset_type(subset)

Determine the subset type of a subset or layer

Classes#

SnackbarQueue()

Class that performs the role of VSnackbarQueue, which is not implemented in ipyvuetify.

ColorCycler([counter])

Cycles through matplotlib's default color palette after first using the Glue default data color.