ConfigHelper

class jdaviz.core.helpers.ConfigHelper(app=None, verbosity='info')[source] [edit on github]

Bases: glue.core.hub.HubListener

The Base Helper Class. Provides shared abstracted helper methods to the user.

Subclasses should set _default_configuration if they are meant to be used with a specific configuration.

Parameters
appApplication or None

The application object, or if None, creates a new one based on the default configuration for this helper.

verbosity{‘debug’, ‘info’, ‘warning’, ‘error’}

Verbosity of the application.

Attributes Summary

fitted_models

Returns the fitted model parameters.

Methods Summary

get_model_parameters([models, model_label, x, y])

Convert each parameter of model inside models into a coordinate that maps the model name and parameter name to a astropy.units.Quantity object.

get_models([models, model_label, x, y])

Loop through all models and output models of the label model_label.

load_data(data[, parser_reference])

show_in_new_tab(**kwargs)

Display the Jdaviz application in a new tab in JupyterLab.

show_in_sidecar(**kwargs)

Display the Jdaviz application in a "sidecar", which by default is a tab on the right side of the JupyterLab interface.

show_inline()

Display the Jdaviz application inline in a notebook.

Attributes Documentation

fitted_models

Returns the fitted model parameters.

Returns
parametersdict

dict of Quantity arrays, or None.

Methods Documentation

get_model_parameters(models=None, model_label=None, x=None, y=None)[source] [edit on github]

Convert each parameter of model inside models into a coordinate that maps the model name and parameter name to a astropy.units.Quantity object.

Parameters
modelsdict

A dictionary where the key is a model name and the value is an astropy.modeling.CompoundModel object.

model_labelstr

Get model parameters for a particular model by inputting its label.

xint

The x coordinate of the model spaxels that will be returned from get_models.

yint

The y coordinate of the model spaxels that will be returned from get_models.

Returns
dict

a dictionary of the form {model name: {parameter name: [[astropy.units.Quantity]]}} for 3d models or {model name: {parameter name: astropy.units.Quantity}} where the Quantity object represents the parameter value and unit of one of spaxel models or the 1d models, respectively.

get_models(models=None, model_label=None, x=None, y=None)[source] [edit on github]

Loop through all models and output models of the label model_label. If x or y is set, return model_labels of those (x, y) coordinates. If x and y are None, print all models regardless of coordinates.

Parameters
modelsdict

A dict of models, with the key being the label name and the value being an astropy.modeling.CompoundModel object. Defaults to fitted_models if no parameter is provided.

model_labelstr

The name of the model that will be found and returned. If it equals default, every model present will be returned.

xint

The x coordinate of the model spaxels that will be returned.

yint

The y coordinate of the model spaxels that will be returned.

Returns
selected_modelsdict

Dictionary of the selected models.

load_data(data, parser_reference=None, **kwargs)[source] [edit on github]
show_in_new_tab(**kwargs)[source] [edit on github]

Display the Jdaviz application in a new tab in JupyterLab.

Additional keywords not listed here are passed into the sidecar.Sidecar constructor. See jupyterlab-sidecar for the most up-to-date options.

Parameters
titlestr, optional

The title of the sidecar tab. Defaults to the name of the application; e.g., “specviz”.

Returns
sidecar

The sidecar.Sidecar object used to create the tab.

Notes

If this method is called in the “classic” Jupyter notebook, the app will appear inline, as only lab has a mechanism to have multiple tabs.

show_in_sidecar(**kwargs)[source] [edit on github]

Display the Jdaviz application in a “sidecar”, which by default is a tab on the right side of the JupyterLab interface.

Additional keywords not listed here are passed into the sidecar.Sidecar constructor. See jupyterlab-sidecar for the most up-to-date options.

Parameters
titlestr, optional

The title of the sidecar tab. Defaults to the name of the application; e.g., “specviz”.

anchorstr

Where the tab should appear, by default on the right. Options are: ‘split-right’, ‘split-left’, ‘split-top’, ‘split-bottom’, ‘tab-before’, ‘tab-after’, ‘right’.

Returns
sidecar

The sidecar.Sidecar object used to create the tab.

Notes

If this method is called in the “classic” Jupyter notebook, the app will appear inline, as only lab has a mechanism to have multiple tabs. See Also ——– show_in_new_tab show_inline

show_inline()[source] [edit on github]

Display the Jdaviz application inline in a notebook. Note this is functionally equivalent to displaying the cell self.app in the notebook.