diff --git a/pyobs/images/processors/offsets/__init__.py b/pyobs/images/processors/offsets/__init__.py index f4af6f27..c1f6411b 100644 --- a/pyobs/images/processors/offsets/__init__.py +++ b/pyobs/images/processors/offsets/__init__.py @@ -4,6 +4,7 @@ """ from .brighteststar_guiding import BrightestStarGuiding from .offsets import Offsets +from .add_pixeloffset import AddPixelOffset from .astrometry import AstrometryOffsets from .brighteststar import BrightestStarOffsets from .nstar.nstar import NStarOffsets @@ -14,6 +15,7 @@ __all__ = [ "Offsets", + "AddPixelOffset", "AstrometryOffsets", "NStarOffsets", "ProjectedOffsets", diff --git a/pyobs/images/processors/offsets/add_pixeloffset.py b/pyobs/images/processors/offsets/add_pixeloffset.py new file mode 100644 index 00000000..f1ea311a --- /dev/null +++ b/pyobs/images/processors/offsets/add_pixeloffset.py @@ -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"]