-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci skip]
- Loading branch information
Showing
9 changed files
with
462 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .rotate_image import * # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from traitlets import Bool, observe | ||
|
||
from jdaviz.core.custom_traitlets import FloatHandleEmpty | ||
from jdaviz.core.registries import tray_registry | ||
from jdaviz.core.template_mixin import TemplateMixin | ||
|
||
__all__ = ['RotateImageSimple'] | ||
|
||
|
||
@tray_registry('imviz-rotate-image', label="Simple Image Rotation") | ||
class RotateImageSimple(TemplateMixin): | ||
template_file = __file__, "rotate_image.vue" | ||
|
||
rotate_mode_on = Bool(False).tag(sync=True) | ||
angle = FloatHandleEmpty(0).tag(sync=True) | ||
|
||
@observe('angle') | ||
def vue_rotate_image(*args, **kwargs): | ||
pass # TODO | ||
|
||
# Create a small dummy image | ||
|
||
# Create a fake WCS with desired orientation | ||
|
||
# Add it into data collection | ||
|
||
# Make it reference. Remember which one as old reference. | ||
# If no API to make something reference, remove everything, readd | ||
# with it first, and relink. | ||
|
||
# When angle changes, is updating Data.coords with new WCS good enough? | ||
|
||
# Find a way to hide this image from Data dropdown, blink, etc | ||
|
||
# When toggle off, discard this from data_collection and restore old reference. | ||
|
||
# Have compass hide zoom box when rotate_mode_on is True | ||
# and un-hide it when False. | ||
|
||
# Write tests. |
28 changes: 28 additions & 0 deletions
28
jdaviz/configs/imviz/plugins/rotate_image/rotate_image.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<j-tray-plugin> | ||
<v-row> | ||
<j-docs-link :link="'https://jdaviz.readthedocs.io/en/'+vdocs+'/'+config+'/plugins.html#simple-image-rotation'">Rotate image N-up/E-left.</j-docs-link> | ||
</v-row> | ||
|
||
<v-row> | ||
<v-switch | ||
label="Rotate celestial axes" | ||
hint="Toggle N-E axes rotation on or off" | ||
v-model="rotate_mode_on" | ||
persistent-hint> | ||
</v-switch> | ||
</v-row> | ||
|
||
<v-row v-if="rotate_mode_on"> | ||
<v-col> | ||
<v-text-field | ||
v-model='angle' | ||
type="number" | ||
label="Angle" | ||
hint="Rotation angle of N-axis in degree clockwise (0 is N-up)" | ||
></v-text-field> | ||
</v-col> | ||
</v-row> | ||
|
||
</j-tray-plugin> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Copyright (c) 2010-2019 CNRS / Centre de Recherche Astrophysique de Lyon | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Oops, something went wrong.