pyobs-core 2.0.0.dev3__py3-none-any.whl → 2.0.0.dev4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. pyobs/comm/comm.py +1 -7
  2. pyobs/comm/xmpp/xmppcomm.py +3 -3
  3. pyobs/interfaces/IBinning.py +10 -7
  4. pyobs/interfaces/ICooling.py +10 -7
  5. pyobs/interfaces/IExposure.py +10 -7
  6. pyobs/interfaces/IExposureTime.py +8 -5
  7. pyobs/interfaces/IFilters.py +8 -5
  8. pyobs/interfaces/IFocuser.py +9 -6
  9. pyobs/interfaces/IGain.py +9 -6
  10. pyobs/interfaces/IImageFormat.py +8 -5
  11. pyobs/interfaces/IImageType.py +8 -5
  12. pyobs/interfaces/IMode.py +9 -6
  13. pyobs/interfaces/IMotion.py +15 -11
  14. pyobs/interfaces/IMultiFiber.py +12 -9
  15. pyobs/interfaces/IOffsetsAltAz.py +9 -6
  16. pyobs/interfaces/IOffsetsRaDec.py +9 -6
  17. pyobs/interfaces/IPointingAltAz.py +9 -6
  18. pyobs/interfaces/IPointingHGS.py +9 -6
  19. pyobs/interfaces/IPointingHelioprojective.py +9 -6
  20. pyobs/interfaces/IPointingRaDec.py +9 -6
  21. pyobs/interfaces/IReady.py +8 -5
  22. pyobs/interfaces/IRotation.py +8 -5
  23. pyobs/interfaces/IRunning.py +8 -5
  24. pyobs/interfaces/ITemperatures.py +13 -11
  25. pyobs/interfaces/IWindow.py +12 -9
  26. pyobs/interfaces/__init__.py +48 -23
  27. pyobs/interfaces/interface.py +2 -0
  28. pyobs/mixins/motionstatus.py +3 -3
  29. pyobs/modules/camera/basecamera.py +19 -9
  30. pyobs/modules/camera/dummycamera.py +37 -19
  31. pyobs/modules/camera/dummyvideo.py +3 -3
  32. pyobs/modules/flatfield/flatfield.py +16 -6
  33. pyobs/modules/pointing/autoguiding.py +2 -2
  34. pyobs/modules/roof/baseroof.py +2 -2
  35. pyobs/modules/telescope/dummytelescope.py +25 -15
  36. pyobs/modules/utils/dummymode.py +4 -4
  37. {pyobs_core-2.0.0.dev3.dist-info → pyobs_core-2.0.0.dev4.dist-info}/METADATA +1 -1
  38. {pyobs_core-2.0.0.dev3.dist-info → pyobs_core-2.0.0.dev4.dist-info}/RECORD +41 -41
  39. {pyobs_core-2.0.0.dev3.dist-info → pyobs_core-2.0.0.dev4.dist-info}/WHEEL +0 -0
  40. {pyobs_core-2.0.0.dev3.dist-info → pyobs_core-2.0.0.dev4.dist-info}/entry_points.txt +0 -0
  41. {pyobs_core-2.0.0.dev3.dist-info → pyobs_core-2.0.0.dev4.dist-info}/licenses/LICENSE +0 -0
pyobs/comm/comm.py CHANGED
@@ -438,19 +438,13 @@ class Comm:
438
438
  ) -> None:
439
439
  pass
440
440
 
441
- @staticmethod
442
- def _interface_from_state(state_cls: type) -> type:
443
- outer_name = state_cls.__qualname__.rsplit(".", 1)[0]
444
- return getattr(sys.modules[state_cls.__module__], outer_name)
445
-
446
- async def set_state(self, state: Any) -> None:
441
+ async def set_state(self, interface: type[Interface], state: Any) -> None:
447
442
  """Publish state for this module.
448
443
 
449
444
  Args:
450
445
  interface: Interface type for the state.
451
446
  state: State object to publish.
452
447
  """
453
- interface = Comm._interface_from_state(type(state))
454
448
  await self._set_state(interface, state)
455
449
 
456
450
  async def _set_state(self, interface: type[Interface], state: Any) -> None:
@@ -658,7 +658,7 @@ class XmppComm(Comm):
658
658
  item_xml = items_xml.find(f"{{{pubsub_ns}}}item")
659
659
  payload = list(item_xml)[0] if item_xml is not None and len(item_xml) > 0 else None
660
660
  if payload is not None:
661
- state_obj = _xml_to_dataclass(payload, interface.State)
661
+ state_obj = _xml_to_dataclass(payload, interface.state)
662
662
  for callback in callbacks:
663
663
  callback(state_obj)
664
664
  else:
@@ -786,7 +786,7 @@ class XmppComm(Comm):
786
786
  item_xml = items_xml.find(f"{{{pubsub_ns}}}item") if items_xml is not None else None
787
787
  payload = list(item_xml)[0] if item_xml is not None and len(item_xml) > 0 else None
788
788
  if payload is not None:
789
- callback(_xml_to_dataclass(payload, interface.State))
789
+ callback(_xml_to_dataclass(payload, interface.state))
790
790
  except (slixmpp.exceptions.IqError, slixmpp.exceptions.IqTimeout):
791
791
  pass
792
792
 
@@ -902,7 +902,7 @@ class XmppComm(Comm):
902
902
  payload = list(item_xml)[0] if item_xml is not None and len(item_xml) > 0 else None
903
903
  if payload is not None and node in self._state_node_handlers:
904
904
  _, callbacks = self._state_node_handlers[node]
905
- state_obj = _xml_to_dataclass(payload, interface.State)
905
+ state_obj = _xml_to_dataclass(payload, interface.state)
906
906
  for cb in callbacks:
907
907
  cb(state_obj)
908
908
  except (slixmpp.exceptions.IqError, slixmpp.exceptions.IqTimeout):
@@ -8,20 +8,23 @@ from ..utils.time import Time
8
8
  from .interface import Interface
9
9
 
10
10
 
11
+ @dataclass
12
+ class BinningState:
13
+ x: int
14
+ y: int
15
+ time: Time = field(default_factory=Time.now)
16
+
17
+
11
18
  class IBinning(Interface, metaclass=ABCMeta):
12
19
  """The camera supports binning, to be used together with :class:`~pyobs.interfaces.ICamera`."""
13
20
 
14
21
  __module__ = "pyobs.interfaces"
15
22
 
16
- @dataclass
17
- class State:
18
- x: int
19
- y: int
20
- time: Time = field(default_factory=Time.now)
23
+ state = BinningState
21
24
 
22
25
  @dataclass
23
26
  class Capabilities:
24
- binnings: list[IBinning.State] = field(default_factory=list)
27
+ binnings: list[BinningState] = field(default_factory=list)
25
28
 
26
29
  @abstractmethod
27
30
  async def set_binning(self, x: int, y: int, **kwargs: Any) -> None:
@@ -37,4 +40,4 @@ class IBinning(Interface, metaclass=ABCMeta):
37
40
  ...
38
41
 
39
42
 
40
- __all__ = ["IBinning"]
43
+ __all__ = ["IBinning", "BinningState"]
@@ -9,17 +9,20 @@ from ..utils.time import Time
9
9
  from .ITemperatures import ITemperatures
10
10
 
11
11
 
12
+ @dataclass
13
+ class CoolingState:
14
+ setpoint: Annotated[float, Unit.CELSIUS] | None
15
+ power: Annotated[int, Unit.PERCENT] | None
16
+ enabled: bool
17
+ time: Time = field(default_factory=Time.now)
18
+
19
+
12
20
  class ICooling(ITemperatures, metaclass=ABCMeta):
13
21
  """The module can control the cooling of a device."""
14
22
 
15
23
  __module__ = "pyobs.interfaces"
16
24
 
17
- @dataclass
18
- class State:
19
- setpoint: Annotated[float, Unit.CELSIUS] | None
20
- power: Annotated[int, Unit.PERCENT] | None
21
- enabled: bool
22
- time: Time = field(default_factory=Time.now)
25
+ state = CoolingState
23
26
 
24
27
  @abstractmethod
25
28
  async def set_cooling(self, enabled: bool, setpoint: Annotated[float, Unit.CELSIUS], **kwargs: Any) -> None:
@@ -35,4 +38,4 @@ class ICooling(ITemperatures, metaclass=ABCMeta):
35
38
  ...
36
39
 
37
40
 
38
- __all__ = ["ICooling"]
41
+ __all__ = ["ICooling", "CoolingState"]
@@ -10,17 +10,20 @@ from ..utils.time import Time
10
10
  from .interface import Interface
11
11
 
12
12
 
13
+ @dataclass
14
+ class ExposureState:
15
+ status: ExposureStatus
16
+ progress: Annotated[float, Unit.PERCENT]
17
+ exposure_time_left: Annotated[float, Unit.SECONDS] = 0.0
18
+ time: Time = field(default_factory=Time.now)
19
+
20
+
13
21
  class IExposure(Interface, metaclass=ABCMeta):
14
22
  """The module controls a camera."""
15
23
 
16
24
  __module__ = "pyobs.interfaces"
17
25
 
18
- @dataclass
19
- class State:
20
- status: ExposureStatus
21
- progress: Annotated[float, Unit.PERCENT]
22
- exposure_time_left: Annotated[float, Unit.SECONDS] = 0.0
23
- time: Time = field(default_factory=Time.now)
26
+ state = ExposureState
24
27
 
25
28
 
26
- __all__ = ["IExposure"]
29
+ __all__ = ["IExposure", "ExposureState"]
@@ -9,15 +9,18 @@ from ..utils.time import Time
9
9
  from .interface import Interface
10
10
 
11
11
 
12
+ @dataclass
13
+ class ExposureTimeState:
14
+ exposure_time: Annotated[float, Unit.SECONDS]
15
+ time: Time = field(default_factory=Time.now)
16
+
17
+
12
18
  class IExposureTime(Interface, metaclass=ABCMeta):
13
19
  """The camera supports exposure times, to be used together with :class:`~pyobs.interfaces.ICamera`."""
14
20
 
15
21
  __module__ = "pyobs.interfaces"
16
22
 
17
- @dataclass
18
- class State:
19
- exposure_time: Annotated[float, Unit.SECONDS]
20
- time: Time = field(default_factory=Time.now)
23
+ state = ExposureTimeState
21
24
 
22
25
  @abstractmethod
23
26
  async def set_exposure_time(self, exposure_time: Annotated[float, Unit.SECONDS], **kwargs: Any) -> None:
@@ -32,4 +35,4 @@ class IExposureTime(Interface, metaclass=ABCMeta):
32
35
  ...
33
36
 
34
37
 
35
- __all__ = ["IExposureTime"]
38
+ __all__ = ["IExposureTime", "ExposureTimeState"]
@@ -8,15 +8,18 @@ from ..utils.time import Time
8
8
  from .IMotion import IMotion
9
9
 
10
10
 
11
+ @dataclass
12
+ class FilterState:
13
+ filter: str
14
+ time: Time = field(default_factory=Time.now)
15
+
16
+
11
17
  class IFilters(IMotion, metaclass=ABCMeta):
12
18
  """The module can change filters in a device."""
13
19
 
14
20
  __module__ = "pyobs.interfaces"
15
21
 
16
- @dataclass
17
- class State:
18
- filter: str
19
- time: Time = field(default_factory=Time.now)
22
+ state = FilterState
20
23
 
21
24
  @dataclass
22
25
  class Capabilities:
@@ -36,4 +39,4 @@ class IFilters(IMotion, metaclass=ABCMeta):
36
39
  ...
37
40
 
38
41
 
39
- __all__ = ["IFilters"]
42
+ __all__ = ["IFilters", "FilterState"]
@@ -8,16 +8,19 @@ from ..utils.time import Time
8
8
  from .IMotion import IMotion
9
9
 
10
10
 
11
+ @dataclass
12
+ class FocuserState:
13
+ focus: float
14
+ focus_offset: float
15
+ time: Time = field(default_factory=Time.now)
16
+
17
+
11
18
  class IFocuser(IMotion, metaclass=ABCMeta):
12
19
  """The module is a focusing device."""
13
20
 
14
21
  __module__ = "pyobs.interfaces"
15
22
 
16
- @dataclass
17
- class State:
18
- focus: float
19
- focus_offset: float
20
- time: Time = field(default_factory=Time.now)
23
+ state = FocuserState
21
24
 
22
25
  @abstractmethod
23
26
  async def set_focus(self, focus: float, **kwargs: Any) -> None:
@@ -46,4 +49,4 @@ class IFocuser(IMotion, metaclass=ABCMeta):
46
49
  ...
47
50
 
48
51
 
49
- __all__ = ["IFocuser"]
52
+ __all__ = ["IFocuser", "FocuserState"]
pyobs/interfaces/IGain.py CHANGED
@@ -8,16 +8,19 @@ from ..utils.time import Time
8
8
  from .interface import Interface
9
9
 
10
10
 
11
+ @dataclass
12
+ class GainState:
13
+ gain: float
14
+ offset: float
15
+ time: Time = field(default_factory=Time.now)
16
+
17
+
11
18
  class IGain(Interface, metaclass=ABCMeta):
12
19
  """The camera supports setting of gain, to be used together with :class:`~pyobs.interfaces.ICamera`."""
13
20
 
14
21
  __module__ = "pyobs.interfaces"
15
22
 
16
- @dataclass
17
- class State:
18
- gain: float
19
- offset: float
20
- time: Time = field(default_factory=Time.now)
23
+ state = GainState
21
24
 
22
25
  @abstractmethod
23
26
  async def set_gain(self, gain: float, **kwargs: Any) -> None:
@@ -44,4 +47,4 @@ class IGain(Interface, metaclass=ABCMeta):
44
47
  ...
45
48
 
46
49
 
47
- __all__ = ["IGain"]
50
+ __all__ = ["IGain", "GainState"]
@@ -10,15 +10,18 @@ from ..utils.time import Time
10
10
  from .interface import Interface
11
11
 
12
12
 
13
+ @dataclass
14
+ class ImageFormatState:
15
+ image_format: ImageFormat
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
13
19
  class IImageFormat(Interface, metaclass=ABCMeta):
14
20
  """The module supports different image formats (e.g. INT16, FLOAT32), mainly used by cameras."""
15
21
 
16
22
  __module__ = "pyobs.interfaces"
17
23
 
18
- @dataclass
19
- class State:
20
- image_format: ImageFormat
21
- time: Time = field(default_factory=Time.now)
24
+ state = ImageFormatState
22
25
 
23
26
  @dataclass
24
27
  class Capabilities:
@@ -37,4 +40,4 @@ class IImageFormat(Interface, metaclass=ABCMeta):
37
40
  ...
38
41
 
39
42
 
40
- __all__ = ["IImageFormat"]
43
+ __all__ = ["IImageFormat", "ImageFormatState"]
@@ -10,15 +10,18 @@ from ..utils.time import Time
10
10
  from .interface import Interface
11
11
 
12
12
 
13
+ @dataclass
14
+ class ImageTypeState:
15
+ image_type: ImageType
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
13
19
  class IImageType(Interface, metaclass=ABCMeta):
14
20
  """The module supports different image types (e.g. object, bias, dark, etc), mainly used by cameras."""
15
21
 
16
22
  __module__ = "pyobs.interfaces"
17
23
 
18
- @dataclass
19
- class State:
20
- image_type: ImageType
21
- time: Time = field(default_factory=Time.now)
24
+ state = ImageTypeState
22
25
 
23
26
  @abstractmethod
24
27
  async def set_image_type(self, image_type: ImageType, **kwargs: Any) -> None:
@@ -30,4 +33,4 @@ class IImageType(Interface, metaclass=ABCMeta):
30
33
  ...
31
34
 
32
35
 
33
- __all__ = ["IImageType"]
36
+ __all__ = ["IImageType", "ImageTypeState"]
pyobs/interfaces/IMode.py CHANGED
@@ -8,20 +8,23 @@ from ..utils.time import Time
8
8
  from .interface import Interface
9
9
 
10
10
 
11
+ @dataclass
12
+ class ModeState:
13
+ modes: dict[str, str] = field(default_factory=dict) # group -> current mode
14
+ time: Time = field(default_factory=Time.now)
15
+
16
+
11
17
  class IMode(Interface, metaclass=ABCMeta):
12
18
  """The module can change modes in a device."""
13
19
 
14
20
  __module__ = "pyobs.interfaces"
15
21
 
22
+ state = ModeState
23
+
16
24
  @dataclass
17
25
  class Capabilities:
18
26
  modes: dict[str, list[str]] = field(default_factory=dict) # group -> list of modes
19
27
 
20
- @dataclass
21
- class State:
22
- modes: dict[str, str] = field(default_factory=dict) # group -> current mode
23
- time: Time = field(default_factory=Time.now)
24
-
25
28
  @abstractmethod
26
29
  async def set_mode(self, mode: str, group: int = 0, **kwargs: Any) -> None:
27
30
  """Set the current mode.
@@ -37,4 +40,4 @@ class IMode(Interface, metaclass=ABCMeta):
37
40
  ...
38
41
 
39
42
 
40
- __all__ = ["IMode"]
43
+ __all__ = ["IMode", "ModeState"]
@@ -10,21 +10,25 @@ from ..utils.time import Time
10
10
  from .IReady import IReady
11
11
 
12
12
 
13
+ @dataclass
14
+ class DeviceMotionStatus:
15
+ name: str
16
+ status: MotionStatus
17
+
18
+
19
+ @dataclass
20
+ class MotionState:
21
+ status: MotionStatus
22
+ devices: list[DeviceMotionStatus] = field(default_factory=list)
23
+ time: Time = field(default_factory=Time.now)
24
+
25
+
13
26
  class IMotion(IReady, metaclass=ABCMeta):
14
27
  """The module controls a device that can move."""
15
28
 
16
29
  __module__ = "pyobs.interfaces"
17
30
 
18
- @dataclass
19
- class DeviceMotionStatus:
20
- name: str
21
- status: MotionStatus
22
-
23
- @dataclass
24
- class State:
25
- status: MotionStatus
26
- devices: list[IMotion.DeviceMotionStatus] = field(default_factory=list)
27
- time: Time = field(default_factory=Time.now)
31
+ state = MotionState
28
32
 
29
33
  @abstractmethod
30
34
  async def init(self, **kwargs: Any) -> None:
@@ -54,4 +58,4 @@ class IMotion(IReady, metaclass=ABCMeta):
54
58
  ...
55
59
 
56
60
 
57
- __all__ = ["IMotion"]
61
+ __all__ = ["IMotion", "DeviceMotionStatus", "MotionState"]
@@ -8,25 +8,28 @@ from ..utils.time import Time
8
8
  from .interface import Interface
9
9
 
10
10
 
11
+ @dataclass
12
+ class MultiFiberState:
13
+ fiber: str = ""
14
+ pixel_x: float = 0.0
15
+ pixel_y: float = 0.0
16
+ radius: float = 0.0
17
+ time: Time = field(default_factory=Time.now)
18
+
19
+
11
20
  class IMultiFiber(Interface, metaclass=ABCMeta):
12
21
  """An interface for multi-fiber setups that helps to set/get a fiber and retrieve position and size of the
13
22
  current fiber on the acquisition/guiding image."""
14
23
 
15
24
  __module__ = "pyobs.interfaces"
16
25
 
26
+ state = MultiFiberState
27
+
17
28
  @dataclass
18
29
  class Capabilities:
19
30
  fiber_count: int = 0
20
31
  fiber_names: list[str] = field(default_factory=list)
21
32
 
22
- @dataclass
23
- class State:
24
- fiber: str = ""
25
- pixel_x: float = 0.0
26
- pixel_y: float = 0.0
27
- radius: float = 0.0
28
- time: Time = field(default_factory=Time.now)
29
-
30
33
  @abstractmethod
31
34
  async def abort(self, **kwargs: Any) -> None:
32
35
  """Abort current actions."""
@@ -42,4 +45,4 @@ class IMultiFiber(Interface, metaclass=ABCMeta):
42
45
  ...
43
46
 
44
47
 
45
- __all__ = ["IMultiFiber"]
48
+ __all__ = ["IMultiFiber", "MultiFiberState"]
@@ -9,17 +9,20 @@ from ..utils.time import Time
9
9
  from .interface import Interface
10
10
 
11
11
 
12
+ @dataclass
13
+ class AltAzOffsetState:
14
+ alt: Annotated[float, Unit.DEGREES]
15
+ az: Annotated[float, Unit.DEGREES]
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
12
19
  class IOffsetsAltAz(Interface, metaclass=ABCMeta):
13
20
  """The module supports Alt/Az offsets, usually combined with :class:`~pyobs.interfaces.ITelescope` and
14
21
  :class:`~pyobs.interfaces.IPointingAltAz`."""
15
22
 
16
23
  __module__ = "pyobs.interfaces"
17
24
 
18
- @dataclass
19
- class State:
20
- alt: Annotated[float, Unit.DEGREES]
21
- az: Annotated[float, Unit.DEGREES]
22
- time: Time = field(default_factory=Time.now)
25
+ state = AltAzOffsetState
23
26
 
24
27
  @abstractmethod
25
28
  async def set_offsets_altaz(
@@ -37,4 +40,4 @@ class IOffsetsAltAz(Interface, metaclass=ABCMeta):
37
40
  ...
38
41
 
39
42
 
40
- __all__ = ["IOffsetsAltAz"]
43
+ __all__ = ["IOffsetsAltAz", "AltAzOffsetState"]
@@ -9,17 +9,20 @@ from ..utils.time import Time
9
9
  from .interface import Interface
10
10
 
11
11
 
12
+ @dataclass
13
+ class RaDecOffsetState:
14
+ ra: Annotated[float, Unit.DEGREES]
15
+ dec: Annotated[float, Unit.DEGREES]
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
12
19
  class IOffsetsRaDec(Interface, metaclass=ABCMeta):
13
20
  """The module supports RA/Dec offsets, usually combined with :class:`~pyobs.interfaces.ITelescope` and
14
21
  :class:`~pyobs.interfaces.IPointingRaDec`."""
15
22
 
16
23
  __module__ = "pyobs.interfaces"
17
24
 
18
- @dataclass
19
- class State:
20
- ra: Annotated[float, Unit.DEGREES]
21
- dec: Annotated[float, Unit.DEGREES]
22
- time: Time = field(default_factory=Time.now)
25
+ state = RaDecOffsetState
23
26
 
24
27
  @abstractmethod
25
28
  async def set_offsets_radec(
@@ -37,4 +40,4 @@ class IOffsetsRaDec(Interface, metaclass=ABCMeta):
37
40
  ...
38
41
 
39
42
 
40
- __all__ = ["IOffsetsRaDec"]
43
+ __all__ = ["IOffsetsRaDec", "RaDecOffsetState"]
@@ -9,16 +9,19 @@ from ..utils.time import Time
9
9
  from .interface import Interface
10
10
 
11
11
 
12
+ @dataclass
13
+ class AltAzState:
14
+ alt: Annotated[float, Unit.DEGREES]
15
+ az: Annotated[float, Unit.DEGREES]
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
12
19
  class IPointingAltAz(Interface, metaclass=ABCMeta):
13
20
  """The module can move to Alt/Az coordinates, usually combined with :class:`~pyobs.interfaces.ITelescope`."""
14
21
 
15
22
  __module__ = "pyobs.interfaces"
16
23
 
17
- @dataclass
18
- class State:
19
- alt: Annotated[float, Unit.DEGREES]
20
- az: Annotated[float, Unit.DEGREES]
21
- time: Time = field(default_factory=Time.now)
24
+ state = AltAzState
22
25
 
23
26
  @abstractmethod
24
27
  async def move_altaz(
@@ -36,4 +39,4 @@ class IPointingAltAz(Interface, metaclass=ABCMeta):
36
39
  ...
37
40
 
38
41
 
39
- __all__ = ["IPointingAltAz"]
42
+ __all__ = ["IPointingAltAz", "AltAzState"]
@@ -9,16 +9,19 @@ from ..utils.time import Time
9
9
  from .interface import Interface
10
10
 
11
11
 
12
+ @dataclass
13
+ class HGSState:
14
+ lon: Annotated[float, Unit.DEGREES]
15
+ lat: Annotated[float, Unit.DEGREES]
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
12
19
  class IPointingHGS(Interface, metaclass=ABCMeta):
13
20
  """The module can move to Mu/Psi coordinates, usually combined with :class:`~pyobs.interfaces.ITelescope`."""
14
21
 
15
22
  __module__ = "pyobs.interfaces"
16
23
 
17
- @dataclass
18
- class State:
19
- lon: Annotated[float, Unit.DEGREES]
20
- lat: Annotated[float, Unit.DEGREES]
21
- time: Time = field(default_factory=Time.now)
24
+ state = HGSState
22
25
 
23
26
  @abstractmethod
24
27
  async def move_hgs_lon_lat(
@@ -36,4 +39,4 @@ class IPointingHGS(Interface, metaclass=ABCMeta):
36
39
  ...
37
40
 
38
41
 
39
- __all__ = ["IPointingHGS"]
42
+ __all__ = ["IPointingHGS", "HGSState"]
@@ -9,16 +9,19 @@ from ..utils.time import Time
9
9
  from .interface import Interface
10
10
 
11
11
 
12
+ @dataclass
13
+ class HelioprojectiveState:
14
+ theta_x: Annotated[float, Unit.DEGREES]
15
+ theta_y: Annotated[float, Unit.DEGREES]
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
12
19
  class IPointingHelioprojective(Interface, metaclass=ABCMeta):
13
20
  """The module can move to Mu/Psi coordinates, usually combined with :class:`~pyobs.interfaces.ITelescope`."""
14
21
 
15
22
  __module__ = "pyobs.interfaces"
16
23
 
17
- @dataclass
18
- class State:
19
- theta_x: Annotated[float, Unit.DEGREES]
20
- theta_y: Annotated[float, Unit.DEGREES]
21
- time: Time = field(default_factory=Time.now)
24
+ state = HelioprojectiveState
22
25
 
23
26
  @abstractmethod
24
27
  async def move_helioprojective(
@@ -36,4 +39,4 @@ class IPointingHelioprojective(Interface, metaclass=ABCMeta):
36
39
  ...
37
40
 
38
41
 
39
- __all__ = ["IPointingHelioprojective"]
42
+ __all__ = ["IPointingHelioprojective", "HelioprojectiveState"]
@@ -9,16 +9,19 @@ from ..utils.time import Time
9
9
  from .interface import Interface
10
10
 
11
11
 
12
+ @dataclass
13
+ class RaDecState:
14
+ ra: Annotated[float, Unit.DEGREES]
15
+ dec: Annotated[float, Unit.DEGREES]
16
+ time: Time = field(default_factory=Time.now)
17
+
18
+
12
19
  class IPointingRaDec(Interface, metaclass=ABCMeta):
13
20
  """The module can move to RA/Dec coordinates, usually combined with :class:`~pyobs.interfaces.ITelescope`."""
14
21
 
15
22
  __module__ = "pyobs.interfaces"
16
23
 
17
- @dataclass
18
- class State:
19
- ra: Annotated[float, Unit.DEGREES]
20
- dec: Annotated[float, Unit.DEGREES]
21
- time: Time = field(default_factory=Time.now)
24
+ state = RaDecState
22
25
 
23
26
  @abstractmethod
24
27
  async def move_radec(
@@ -36,4 +39,4 @@ class IPointingRaDec(Interface, metaclass=ABCMeta):
36
39
  ...
37
40
 
38
41
 
39
- __all__ = ["IPointingRaDec"]
42
+ __all__ = ["IPointingRaDec", "RaDecState"]
@@ -7,15 +7,18 @@ from ..utils.time import Time
7
7
  from .interface import Interface
8
8
 
9
9
 
10
+ @dataclass
11
+ class ReadyState:
12
+ ready: bool
13
+ time: Time = field(default_factory=Time.now)
14
+
15
+
10
16
  class IReady(Interface, metaclass=ABCMeta):
11
17
  """The module can be in a "not ready" state for science and need to be initialized in some way."""
12
18
 
13
19
  __module__ = "pyobs.interfaces"
14
20
 
15
- @dataclass
16
- class State:
17
- ready: bool
18
- time: Time = field(default_factory=Time.now)
21
+ state = ReadyState
19
22
 
20
23
 
21
- __all__ = ["IReady"]
24
+ __all__ = ["IReady", "ReadyState"]