Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter wheel abstract and ascom filter wheel docs #281

Merged
merged 1 commit into from
Nov 20, 2024
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
17 changes: 17 additions & 0 deletions pyscope/observatory/ascom_filter_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@

class ASCOMFilterWheel(ASCOMDevice, FilterWheel):
def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
"""
ASCOM implementation of the FilterWheel abstract base class.

This class provides the functionality to control an ASCOM-compatible filter wheel device,
including properties for focus offsets, filter names, and the current filter position.

Parameters
----------
identifier : `str`
The unique device identifier. This can be the ProgID for COM devices or the device number for Alpaca devices.
alpaca : `bool`, default : `False`, optional
Whether the device is an Alpaca device.
device_number : `int`, default : 0, optional
The device number for Alpaca devices.
protocol : `str`, default : "http", optional
The communication protocol to use for Alpaca devices.
"""
super().__init__(
identifier,
alpaca=alpaca,
Expand Down
34 changes: 34 additions & 0 deletions pyscope/observatory/filter_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,55 @@
class FilterWheel(ABC, metaclass=_DocstringInheritee):
@abstractmethod
def __init__(self, *args, **kwargs):
"""
Abstract base class for filter wheel devices.

This class defines the common interface for filter wheel devices, including properties
for focus off sets, filter names, and the current filter positon. Subclasses must implement
the abstract methods and properties defined here.

Parameters
----------
*args : `tuple`
Variable length argument list.
**kwargs : `dict`
Arbitrary keyword arguments.
"""
pass

@property
@abstractmethod
def FocusOffsets(self):
"""
Focus offsets for each filter in the wheel. (`list` of `int`)

0-indexed list of offsets, one offset per valid slot number.
Values are focuser and filter dependant, and are typically set up by standardizations (such as ASCOM) or by the user.
If focuser offsets aren't available, all values will be 0.
"""
pass

@property
@abstractmethod
def Names(self):
"""
Name of each filter in the wheel. (`list` of `str`)

0-indexed list of filter names, one name per valid slot number.
Values are typically set up by standardizations (such as ASCOM) or by the user.
If filter names aren't available, all values will be "FilterX" such that 1 <= X <= N.
"""
pass

@property
@abstractmethod
def Position(self):
"""
The current filter wheel position. (`int`)

Given as the current slot number, of -1 if wheel is moving.
During motion, a position of -1 is mandatory, no valid slot numbers must be returned during rotation past filter positions.
"""
pass

@Position.setter
Expand Down