-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from AstarVienna/dev_master
Prepare for 0.5.5 release
- Loading branch information
Showing
15 changed files
with
209 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,6 @@ | |
from .obs_strategies import * | ||
from .fits_headers import * | ||
|
||
from .rotation import * | ||
|
||
# from . import effects_utils |
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
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,36 @@ | ||
"""Effects related to rotation of the field/CCD | ||
Classes: | ||
- RotateCCD - Rotates CCD by integer multiples of 90 degrees | ||
""" | ||
|
||
import logging | ||
import numpy as np | ||
|
||
from . import Effect | ||
from .. import utils | ||
from ..utils import from_currsys | ||
from ..base_classes import DetectorBase | ||
|
||
|
||
class Rotate90CCD(Effect): | ||
""" | ||
Rotates CCD by integer multiples of 90 degrees | ||
rotations kwarg is number of counter-clockwise rotations | ||
""" | ||
def __init__(self, **kwargs): | ||
super(Rotate90CCD, self).__init__(**kwargs) | ||
params = {"z_order": [809]} | ||
self.meta.update(params) | ||
self.meta.update(kwargs) | ||
|
||
required_keys = ["rotations"] | ||
utils.check_keys(self.meta, required_keys, action="error") | ||
|
||
def apply_to(self, obj, **kwargs): | ||
if isinstance(obj, DetectorBase): | ||
rotations = from_currsys(self.meta["rotations"]) | ||
obj._hdu.data = np.rot90(obj._hdu.data,rotations) | ||
|
||
return obj |
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
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
Oops, something went wrong.