-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented an image processor that adds a given pixel offset to the …
…image meta data, so that an acquisition module can simply it.
- Loading branch information
Showing
2 changed files
with
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import logging | ||
from typing import Tuple, Any | ||
|
||
from pyobs.images import Image | ||
from pyobs.images.meta import PixelOffsets, OnSkyDistance | ||
from .offsets import Offsets | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class AddPixelOffset(Offsets): | ||
"""Adds a given pixel offset to the image meta data, so that an acquisition module can apply it.""" | ||
__module__ = "pyobs.images.processors.offsets" | ||
|
||
def __init__(self, pixel_offset_x, pixel_offset_y, **kwargs: Any): | ||
Offsets.__init__(self, **kwargs) | ||
self._pixel_offset_x = pixel_offset_x | ||
self._pixel_offset_y = pixel_offset_y | ||
|
||
|
||
async def __call__(self, image: Image) -> Image: | ||
image.set_meta(PixelOffsets(dx=self._pixel_offset_x, dy=self._pixel_offset_y)) | ||
return image | ||
|
||
|
||
__all__ = ["AddPixelOffset"] |