Skip to content

Commit

Permalink
Fixed guiding config
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanHydrogen committed Jan 30, 2024
1 parent 73eba0c commit 68b412b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pyobs/modules/pointing/_baseguiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .guidingstatistics import GuidingStatisticsUptime, GuidingStatisticsPixelOffset
from .guidingstatistics.guidingstatistics import GuidingStatistics
from ...interfaces import ITelescope
from ...object import get_object

log = logging.getLogger(__name__)

Expand All @@ -30,7 +31,7 @@ def __init__(
pid: bool = False,
reset_at_focus: bool = True,
reset_at_filter: bool = True,
guiding_statistic: Optional[GuidingStatistics] = None,
guiding_statistic: Optional[Union[Dict[str, Any], GuidingStatistics]] = None,
**kwargs: Any,
):
"""Initializes a new science frame auto guiding system.
Expand Down Expand Up @@ -65,7 +66,7 @@ def __init__(
if guiding_statistic is None:
guiding_statistic = GuidingStatisticsPixelOffset()

self._statistics = guiding_statistic
self._statistics = get_object(guiding_statistic, GuidingStatistics)
self._uptime = GuidingStatisticsUptime()

async def start(self, **kwargs: Any) -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyobs/modules/pointing/guidingstatistics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .uptime import GuidingStatisticsUptime
from .pixeloffset import GuidingStatisticsPixelOffset
from .skyoffsets import GuidingStatisticsSkyOffset
from .skyoffsets import GuidingStatisticsSkyOffset
6 changes: 4 additions & 2 deletions pyobs/modules/pointing/guidingstatistics/guidingstatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from collections import defaultdict
from typing import List, Dict, Tuple, Any

from pyobs.images import Image


class GuidingStatistics(object, metaclass=ABCMeta):
"""Calculates statistics for guiding."""
Expand Down Expand Up @@ -42,10 +44,10 @@ def add_to_header(self, client: str, header: Dict[str, Tuple[Any, str]]) -> Dict
return header | session_header

@abstractmethod
def _get_session_data(self, input_data: Any) -> Any:
def _get_session_data(self, input_data: Image) -> Any:
raise NotImplementedError

def add_data(self, input_data: Any) -> None:
def add_data(self, input_data: Image) -> None:
"""
Adds data to all client measurement sessions.
Args:
Expand Down
2 changes: 1 addition & 1 deletion pyobs/modules/pointing/guidingstatistics/skyoffsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _build_header(self, data: List[float]) -> Dict[str, Tuple[Any, str]]:
rms = self._calc_rms(data)

if rms is not None:
header["GUIDING OS RMS"] = (float(rms), "RMS for guiding on sky")
header["GUIDING RMS"] = (float(rms), "RMS for guiding on sky")

return header

Expand Down

0 comments on commit 68b412b

Please sign in to comment.