Skip to content

Commit

Permalink
partial implementation for dq plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Aug 7, 2024
1 parent 53c62e4 commit b8f0ca7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
20 changes: 19 additions & 1 deletion jdaviz/configs/default/plugins/data_quality/data_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@

@tray_registry('g-data-quality', label="Data Quality", viewer_requirements="image")
class DataQuality(PluginTemplateMixin, ViewerSelectMixin):
"""
See the :ref:`Data Quality Plugin Documentation <imviz-data-quality>` for more details.
Only the following attributes and methods are available through the
:ref:`public plugin API <plugin-apis>`:
* :meth:`~jdaviz.core.template_mixin.PluginTemplateMixin.show`
* :meth:`~jdaviz.core.template_mixin.PluginTemplateMixin.open_in_tray`
* :meth:`~jdaviz.core.template_mixin.PluginTemplateMixin.close_in_tray`
* ``science_layer`` (:class:`~jdaviz.core.template_mixin.LayerSelect`)
* ``dq_layer`` (:class:`~jdaviz.core.template_mixin.LayerSelect`):
data quality layer corresponding to the science data in ``science_layer``
* ``dq_layer_opacity``: Opacity of the data quality layer.
* ``decoded_flags``: List of decoded flags from the selected flag map.
* ``flags_filter``: List of flags to display.
* ``flag_map``: Name of the selected flag map.
* ``flag_map_definitions_selected``: Dictionary of the selected flag map.
"""
template_file = __file__, "data_quality.vue"

irrelevant_msg = Unicode("").tag(sync=True)
Expand All @@ -43,7 +61,7 @@ class DataQuality(PluginTemplateMixin, ViewerSelectMixin):
science_layer_selected = Any().tag(sync=True) # Any needed for multiselect

# `dq_layer` is the data quality layer corresponding to the
# science data in `layer`
# science data in `science_layer`
dq_layer_multiselect = Bool(False).tag(sync=True)
dq_layer_items = List().tag(sync=True)
dq_layer_selected = Any().tag(sync=True) # Any needed for multiselect
Expand Down
23 changes: 17 additions & 6 deletions jdaviz/configs/default/plugins/data_quality/data_quality.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<j-tray-plugin
:config="config"
plugin_key="Data Quality"
:api_hints_enabled.sync="api_hints_enabled"
:description="docs_description || 'Data Quality layer visualization options.'"
:link="docs_link || 'https://jdaviz.readthedocs.io/en/'+vdocs+'/'+config+'/plugins.html#data-quality'"
@plugin-ping="plugin_ping($event)"
Expand All @@ -11,17 +14,21 @@
:multiselect="science_layer_multiselect"
:icons="icons"
:show_if_single_entry="true"
:label="'Science data'"
:hint="'Select the science data'"
label="Science data"
api_hint="plg.science_layer ="
:api_hints_enabled="api_hints_enabled"
hint="Select the science data"
/>

<plugin-layer-select
:items="dq_layer_items"
:selected.sync="dq_layer_selected"
:multiselect="dq_layer_multiselect"
:label="'Data quality'"
label="Data quality"
api_hint="plg.dq_layer ="
:api_hints_enabled="api_hints_enabled"
:show_if_single_entry="true"
:hint="'Select the data quality'"
hint="Select the data quality"
:icons="icons"
/>

Expand All @@ -37,7 +44,11 @@

<v-row class="row-no-padding">
<v-col>
<v-subheader class="pl-0 slider-label" style="height: 12px">Data quality relative opacity</v-subheader>
<plot-options-slider-header
label="Data quality relative opacity"
:api_hint="'plg.dq_layer_opacity = ' + dq_layer_opacity"
:api_hints_enabled="api_hints_enabled"
/>
<glue-throttled-slider wait="300" min="0" max="1" step="0.01" :value.sync="dq_layer_opacity"/>
</v-col>
</v-row>
Expand Down Expand Up @@ -78,7 +89,7 @@
</v-col>
</v-row>

<v-col style="...">
<v-col>
<v-row>
<v-select
:menu-props="{ left: true }"
Expand Down

0 comments on commit b8f0ca7

Please sign in to comment.