Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 67 additions & 0 deletions pyobs/interfaces/IMultiFiber.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
from abc import ABCMeta, abstractmethod
from typing import Any

from .interface import Interface


class IMultiFiber(Interface, metaclass=ABCMeta):
"""An interface for multi-fiber setups that helps to set/get a fiber and retrieve position and size of the
current fiber on the acquisition/guiding image."""

__module__ = "pyobs.interfaces"

@abstractmethod
async def abort(self, **kwargs: Any) -> None:
"""Abort current actions."""
...

async def get_fiber_count(self, **kwargs: Any) -> int:
"""Returns the number of available fibers in the setup.

Returns:
Number of fibers.
"""
...

async def list_fiber_names(self, **kwargs: Any) -> list[str]:
"""Returns the names of all available fibers.

Returns:
List of fiber names.
"""
...

async def get_fiber(self, **kwargs: Any) -> str:
"""Returns the name of the currently active fiber.

Returns:
Name of currently active fiber.
"""
...

async def set_fiber(self, fiber: str, **kwargs: Any) -> None:
"""Sets the currently active filter. Must be in list returned by @list_fiber_names.

Args:
fiber: Name of fiber to set.
"""
...

async def get_pixel_position(self, **kwargs: Any) -> tuple[float, float]:
"""Get pixel position of currently active fiber on acquisition/guiding image.

Returns:
x/y pixel position of fiber on image.
"""
...

async def get_radius(self, **kwargs: Any) -> float:
"""Get radius of currently active fiber on acquisition/guiding image.

Returns:
radius of fiber on image.
"""
...


__all__ = ["IMultiFiber"]
1 change: 1 addition & 0 deletions pyobs/interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from .IMode import IMode
from .IModule import IModule
from .IMotion import IMotion
from .IMultiFiber import IMultiFiber
from .IPointingAltAz import IPointingAltAz
from .IPointingHelioprojective import IPointingHelioprojective
from .IPointingHGS import IPointingHGS
Expand Down
7 changes: 7 additions & 0 deletions pyobs/modules/camera/basecamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ async def _expose(self, exposure_time: float, open_shutter: bool, abort_event: a
"""
...

async def _init_exposure(self) -> None:
"""Method that is always called at the very beginning of __expose and can be used to set stuff up."""
...

async def __expose(self, exposure_time: float, image_type: ImageType, broadcast: bool) -> Tuple[Image, str]:
"""Wrapper for a single exposure.

Expand All @@ -233,6 +237,9 @@ async def __expose(self, exposure_time: float, image_type: ImageType, broadcast:
GrabImageError: If there was a problem grabbing the image.
"""

# init stuff
await self._init_exposure()

# request fits headers
header_futures_before = await self.request_fits_headers(before=True)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "pyobs-core"
packages = [{ include = "pyobs" }]
version = "1.18.0"
version = "1.18.1"
description = "robotic telescope software"
authors = ["Tim-Oliver Husser <thusser@uni-goettingen.de>"]
license = "MIT"
Expand Down