Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footprints plugin #2341

Merged
merged 32 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b4f7559
basic plugin setup
kecnry Aug 2, 2023
60ed210
adopt jwst preset regions from jwst_novt
kecnry Aug 2, 2023
5b4b333
move EditableSelectPluginComponent from lcviz
kecnry Aug 2, 2023
3251fad
initial (non-functional) plugin design
kecnry Aug 2, 2023
7e4b581
support basic plotting of footprints
kecnry Aug 3, 2023
7647fdf
support filling overlays
kecnry Aug 3, 2023
e69fb62
improved UI styling/layout
kecnry Aug 3, 2023
c92a027
improve editable select component
kecnry Aug 4, 2023
57798f6
pysiaf as optional dependency (plugin disabled otherwise)
kecnry Aug 4, 2023
241281f
viewer access to center_skycoord
kecnry Aug 4, 2023
5798c1e
better handling of creating new footprint, with defaults
kecnry Aug 4, 2023
5df1320
first footprint centered in viewer
kecnry Aug 4, 2023
da9fe3b
fix styling of color menu
kecnry Aug 4, 2023
cdab342
implement "inapplicable_attrs"
kecnry Aug 4, 2023
4174a49
update input parameter hints
kecnry Aug 4, 2023
220075c
generalize across any JWST instrument
kecnry Aug 4, 2023
9f6b1e9
changelog and code cleanup
kecnry Aug 7, 2023
43255e2
basic test coverage and API docs
kecnry Aug 7, 2023
b5227ef
address review comments
kecnry Aug 7, 2023
3f0d015
fix broken docs
kecnry Aug 8, 2023
b9af1a7
re-enable offsets for all instruments
kecnry Aug 8, 2023
031c9ea
strip out inapplicable_attrs implementation
kecnry Aug 8, 2023
de25108
call callback before changing selection
kecnry Aug 8, 2023
004a4f4
improved test coverage
kecnry Aug 8, 2023
aa56d6d
extend plugin docs
kecnry Aug 8, 2023
7bd1ead
generalize API names for future expansion to importing regions objects
kecnry Aug 8, 2023
e6a2046
avoid expensive recalculating when plugin opened
kecnry Aug 9, 2023
0153cff
fix disabling plugin in pysiaf not installed
kecnry Aug 10, 2023
074747d
exclude viewers without wcs in reference data
kecnry Aug 11, 2023
d528e9d
viewer multiselect to default when previously empty choices
kecnry Aug 11, 2023
9ae3278
support manually recentering footprint
kecnry Aug 11, 2023
a2eed6e
disable plotting footprint when pixel-linked
kecnry Aug 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Imviz

- The stretch histogram within plot options can now be popped-out into its own window. [#2314]

- Footprints plugin for plotting overlays of instrument footprints in the image viewer. [#2341]

Mosviz
^^^^^^

Expand Down
18 changes: 18 additions & 0 deletions docs/imviz/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,24 @@ are not stored. To save the current result before submitting a new query, you ca
The table returned from the API above may cover more sources than shown in the currently zoomed-in
portion of the image. Additional steps will be needed to filter out these points, if necessary.


.. _imviz-footprints:

Footprints
==========

This plugin supports loading and overplotting instrument footprint overlays on the image viewers.
Any number of overlays can be plotted simultaneously from any number of the available
preset instruments.

The top dropdown allows renaming, adding, and removing footprint overlays. To modify the display
and input parameters for a given overlay, select it in the dropdown, and modify the choices
in the plugin to change its color, opacity, visibilities in any image viewer in the app, or to
select between various preset instruments and change the input options (position on the sky,
position angle, offsets, etc).



.. _rotate-canvas:

Canvas Rotation
Expand Down
1 change: 1 addition & 0 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def to_unit(self, data, cid, values, original_units, target_units):
'plugin-subset-select': 'components/plugin_subset_select.vue',
'plugin-viewer-select': 'components/plugin_viewer_select.vue',
'plugin-layer-select': 'components/plugin_layer_select.vue',
'plugin-editable-select': 'components/plugin_editable_select.vue',
'plugin-add-results': 'components/plugin_add_results.vue',
'plugin-auto-label': 'components/plugin_auto_label.vue',
'glue-state-sync-wrapper': 'components/glue_state_sync_wrapper.vue'}
Expand Down
93 changes: 93 additions & 0 deletions jdaviz/components/plugin_editable_select.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<template>
<div>
<v-row>
<v-select
v-if="mode=='select'"
attach
:menu-props="{ left: true }"
:items="items"
v-model="selected"
@change="$emit('update:selected', $event)"
:label="label"
:hint="hint"
:rules="rules ? rules : []"
item-text="label"
item-value="label"
persistent-hint
>
<template v-slot:append>
<v-icon style="cursor: pointer">mdi-menu-down</v-icon>
<j-tooltip tooltipcontent="rename">
<v-icon style="cursor: pointer" @click="modeRename">mdi-pencil</v-icon>
</j-tooltip>
<j-tooltip tooltipcontent="remove">
<v-icon style="cursor: pointer" @click="modeRemove">mdi-delete</v-icon>
</j-tooltip>
<j-tooltip tooltipcontent="create new">
<v-icon style="cursor: pointer" @click="modeAdd">mdi-plus</v-icon>
</j-tooltip>
</template>
</v-select>
<v-alert
v-else-if="mode=='remove'"
type="warning"
style="width: 100%"
>
<span>remove '{{selected}}' {{label.toLowerCase()}}?</span>
<template v-slot:append>
<j-tooltip tooltipcontent="cancel">
<v-icon style="cursor: pointer" @click="changeCancel">mdi-close</v-icon>
</j-tooltip>
<j-tooltip :tooltipcontent="'Remove '+selected+' '+label.toLowerCase()">
<v-icon style="cursor: pointer" @click="changeAccept">mdi-delete</v-icon>
</j-tooltip>
</template>
</v-alert>
<v-text-field
v-else
v-model="edit_value"
@keyup="$emit('update:edit_value', $event.target.value)"
:label="label"
:hint="mode == 'rename' ? 'Rename '+label.toLowerCase() : 'Add '+label.toLowerCase()"
persistent-hint
>
<template v-slot:append>
<j-tooltip v-if="items.length > 0" tooltipcontent="Cancel change">
<v-icon style="cursor: pointer" @click="changeCancel">mdi-close</v-icon>
</j-tooltip>
<j-tooltip tooltipcontent="Accept change">
<v-icon style="cursor: pointer" @click="changeAccept">mdi-check</v-icon>
</j-tooltip>
</template>
</v-text-field>
</v-row>
</div>
</template>

<script>
module.exports = {
props: ['mode', 'edit_value', 'items', 'selected', 'label', 'hint', 'rules'],
methods: {
changeCancel() {
this.$emit('update:edit_value', this.selected);
this.$emit('update:mode', 'select');
},
changeAccept() {
this.$emit('update:mode', this.mode+':accept')
},
modeRename() {
this.$emit('update:mode', 'rename')
},
modeRemove() {
this.$emit('update:mode', 'remove')
},
modeAdd() {
this.$emit('update:edit_value', '')
this.$emit('update:mode', 'add')
}
}
};
</script>

<style scoped>
</style>
1 change: 1 addition & 0 deletions jdaviz/components/tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const tooltips = {
'plugin-line-analysis-assign': 'Assign the centroid wavelength and update the redshift',
'plugin-moment-save-fits': 'Save moment map as FITS file',
'plugin-link-apply': 'Apply linking to data',
'plugin-footprints-color-picker': 'Change the color of the footprint overlay',
}


Expand Down
2 changes: 1 addition & 1 deletion jdaviz/components/tray_plugin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<span> {{ getDisabledMsg() }}</span>
</v-row>
<div v-else>
<v-row v-if="uses_active_status && keep_active !== undefined">
<v-row v-if="uses_active_status && keep_active !== undefined" style="padding-bottom: 24px">
<v-switch
v-model="keep_active"
@change="$emit('update:keep_active', $event)"
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/configs/default/plugins/line_lists/line_lists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<v-menu>
<template v-slot:activator="{ on }">
<span class="linelist-color-menu"
:style="`background:${list_contents[item].color}`"
:style="`background:${list_contents[item].color}; cursor: pointer`"
@click.stop="on.click"
>&nbsp;</span>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<v-menu>
<template v-slot:activator="{ on }">
<span class="color-menu"
:style="`background:${subset_color_value}`"
:style="`background:${subset_color_value}; cursor: pointer`"
@click.stop="on.click"
>&nbsp;</span>
</template>
Expand Down Expand Up @@ -127,7 +127,7 @@
<v-menu>
<template v-slot:activator="{ on }">
<span class="color-menu"
:style="`background:${line_color_value}`"
:style="`background:${line_color_value}; cursor: pointer`"
@click.stop="on.click"
>&nbsp;</span>
</template>
Expand Down Expand Up @@ -257,7 +257,7 @@
<v-menu>
<template v-slot:activator="{ on }">
<span class="color-menu"
:style="`background:${marker_color_value}`"
:style="`background:${marker_color_value}; cursor: pointer`"
@click.stop="on.click"
>&nbsp;</span>
</template>
Expand Down Expand Up @@ -416,7 +416,7 @@
<v-menu>
<template v-slot:activator="{ on }">
<span class="color-menu"
:style="`background:${image_color_value}`"
:style="`background:${image_color_value}; cursor: pointer`"
@click.stop="on.click"
>&nbsp;</span>
</template>
Expand Down
1 change: 1 addition & 0 deletions jdaviz/configs/imviz/imviz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tray:
- imviz-line-profile-xy
- imviz-aper-phot-simple
- imviz-catalogs
- imviz-footprints
- imviz-rotate-canvas
- g-export-plot
viewer_area:
Expand Down
1 change: 1 addition & 0 deletions jdaviz/configs/imviz/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
from .line_profile_xy import * # noqa
from .catalogs import * # noqa
from .rotate_canvas import * # noqa
from .footprints import * # noqa
2 changes: 2 additions & 0 deletions jdaviz/configs/imviz/plugins/footprints/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .footprints import * # noqa
from . import preset_regions # noqa
Loading