ConfigHelper
- class jdaviz.core.helpers.ConfigHelper(app=None, verbosity='warning', history_verbosity='info')[source] [edit on github]
Bases:
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
- app
Application
orNone
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 popup messages in the application.
- history_verbosity{‘debug’, ‘info’, ‘warning’, ‘error’}
Verbosity of the history logger in the application.
- app
Attributes Summary
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
([loc, title])Display the Jdaviz application.
show_in_new_tab
([title])Preserved for backwards compatibility Shows Jdaviz in a sidecar in a new tab to the right
show_in_sidecar
([anchor, title])Preserved for backwards compatibility Shows Jdaviz in a sidecar with the default anchor: right
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 tofitted_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(loc='inline', title=None)[source] [edit on github]
Display the Jdaviz application.
- Parameters
- locstr
The display location determines where to present the viz app. Supported locations:
“inline”: Display the Jdaviz application inline in a notebook. Note this is functionally equivalent to displaying the cell
viz.app
in the notebook.“sidecar”: Display the Jdaviz application in a separate JupyterLab window from the notebook, the location of which is decided by the ‘anchor.’ right is the default
Other anchors:
sidecar:right
(The default, opens a tab to the right of display)sidecar:tab-before
(Full-width tab before the current notebook)sidecar:tab-after
(Full-width tab after the current notebook)sidecar:split-right
(Split-tab in the same window right of the notebook)sidecar:split-left
(Split-tab in the same window left of the notebook)sidecar:split-top
(Split-tab in the same window above the notebook)sidecar:split-bottom
(Split-tab in the same window below the notebook)
See jupyterlab-sidecar for the most up-to-date options.
“popout”: Display the Jdaviz application in a detached display. By default, a new window will open. Browser popup permissions required.
Other anchors:
popout:window
(The default, opens Jdaviz in a new, detached popout)popout:tab
(Opens Jdaviz in a new, detached tab in your browser)
- titlestr, optional
The title of the sidecar tab. Defaults to the name of the application; e.g., “specviz”.
NOTE: Only applicable to a “sidecar” display.
Notes
If “sidecar” is requested in the “classic” Jupyter notebook, the app will appear inline, as only JupyterLab has a mechanism to have multiple tabs.
- show_in_new_tab(title=None)[source] [edit on github]
Preserved for backwards compatibility Shows Jdaviz in a sidecar in a new tab to the right
- show_in_sidecar(anchor=None, title=None)[source] [edit on github]
Preserved for backwards compatibility Shows Jdaviz in a sidecar with the default anchor: right