pyobs-alpaca
This is a pyobs (documentation) module for ALPACA, which is a HTTP proxy for ASCOM.
Example configuration
This is an example configuration for a telescope:
class: pyobs_alpaca.AlpacaTelescope
name: ASCOM Telescope
server: 1.2.3.4
port: 11111
device_type: telescope
device: 0
wait_for_dome: dome
weather: weather
alive_parameter: Name
# communication
comm:
jid: test@example.com
password: ***
And for a focussing unit (without the comm
block):
class: pyobs_alpaca.AlpacaFocuser
name: ASCOM Focuser
server: 1.2.3.4
port: 11111
device_type: focuser
device: 0
alive_parameter: Position
And finally, for a dome:
class: pyobs_alpaca.AlpacaDome
server: 1.2.3.4
port: 11111
device_type: dome
device: 0
follow: telescope
weather: weather
Available classes
These classes are meant more as a means of an example for own implementations. AlpacaTelescope is an implementation for telescopes, while AlpacaFocuser works for focusing devices and AlpacaDome can operate a dome.
AlpacaTelescope
- class AlpacaTelescope(settle_time: float = 3.0, park_position: Tuple[float, float] = (180.0, 15.0), **kwargs: Any)
Bases:
BaseTelescope
,FitsNamespaceMixin
,IFitsHeaderBefore
,IOffsetsRaDec
,ISyncTarget
Initializes a new ASCOM Alpaca telescope.
- Parameters:
settle_time – Time in seconds to wait after slew before finishing.
park_position – Alt/Az park position
- async get_altaz(**kwargs: Any) Tuple[float, float] [source]
Returns current Alt and Az.
- Returns:
Tuple of current Alt and Az in degrees.
- async get_fits_header_before(namespaces: Optional[List[str]] = None, **kwargs: Any) Dict[str, Tuple[Any, str]] [source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
- async get_offsets_radec(**kwargs: Any) Tuple[float, float] [source]
Get RA/Dec offset. :returns: Tuple with RA and Dec offsets.
- async get_radec(**kwargs: Any) Tuple[float, float] [source]
Returns current RA and Dec.
- Returns:
Tuple of current RA and Dec in degrees.
- async init(**kwargs: Any) None [source]
Initialize telescope.
- Raises:
pyobs.utils.exceptions.InitError – If telescope could not be initialized.
- async is_ready(**kwargs: Any) bool [source]
Returns the device is “ready”, whatever that means for the specific device.
- Returns:
Whether device is ready
- async park(**kwargs: Any) None [source]
Park telescope.
- Raises:
pyobs.utils.exceptions.ParkError – If telescope could not be parked.
- async set_offsets_radec(dra: float, ddec: float, **kwargs: Any) None [source]
Move an RA/Dec offset.
- Parameters:
dra – RA offset in degrees.
ddec – Dec offset in degrees.
- Raises:
pyobs.utils.exceptions.MoveError – If offset could not be set.
AlpacaFocuser
- class AlpacaFocuser(**kwargs: Any)
Bases:
MotionStatusMixin
,IFocuser
,IFitsHeaderBefore
,Module
Initializes the mixin.
- Parameters:
interfaces – List of interfaces to handle or None
- async get_fits_header_before(namespaces: Optional[List[str]] = None, **kwargs: Any) Dict[str, Tuple[Any, str]] [source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
- async get_focus_offset(**kwargs: Any) float [source]
Return current focus offset.
- Returns:
Current focus offset.
- async init(**kwargs: Any) None [source]
Initialize device.
- Raises:
pyobs.utils.exceptions.InitError – If device could not be initialized.
- async is_ready(**kwargs: Any) bool [source]
Returns the device is “ready”, whatever that means for the specific device.
- Returns:
True, if telescope is initialized and not in an error state.
- async park(**kwargs: Any) None [source]
Park device.
- Raises:
pyobs.utils.exceptions.ParkError – If device could not be parked.
- async set_focus(focus: float, **kwargs: Any) None [source]
Sets new focus.
- Raises:
pyobs.utils.exceptions.MoveError – If telescope cannot be moved.
AlpacaDome
- class AlpacaDome(tolerance: float = 3, park_az: float = 180, follow: Optional[str] = None, **kwargs: Any)
Bases:
FollowMixin
,BaseDome
Initializes a new ASCOM Alpaca telescope.
- Parameters:
tolerance – Tolerance for azimuth.
park_az – Azimuth for park position.
follow – Name of other device (e.g. telescope) to follow.
- async get_altaz(**kwargs: Any) Tuple[float, float] [source]
Returns current Alt and Az.
- Returns:
Tuple of current Alt and Az in degrees.
- async init(**kwargs: Any) None [source]
Open dome.
- Raises:
pyobs.utils.exceptions.InitError – If dome cannot be opened.
- async is_ready(**kwargs: Any) bool [source]
Returns the device is “ready”, whatever that means for the specific device.
- Returns:
Whether device is ready
- async move_altaz(alt: float, az: float, **kwargs: Any) None [source]
Moves to given coordinates.
- Parameters:
alt – Alt in deg to move to.
az – Az in deg to move to.
- Raises:
pyobs.utils.exceptions.MoveError – If device could not be moved.
- async park(**kwargs: Any) None [source]
Close dome.
- Raises:
pyobs.utils.exceptions.ParkError – If dome cannot be opened.