panoptes.pocs.dome package

Submodules

panoptes.pocs.dome.abstract_serial_dome module

class panoptes.pocs.dome.abstract_serial_dome.AbstractSerialDome(*args, **kwargs)[source]

Bases: AbstractDome

Abstract base class for controlling a dome via a serial connection.

Takes care of a single thing: configuring the connection to the device.

connect()[source]

Connects to the device via the serial port, if disconnected.

Returns:

Returns True if connected, False otherwise.

Return type:

bool

disconnect()[source]

Disconnect from the dome controller.

Raises:

An exception if unable to disconnect.

property is_connected

True if connected to the hardware or driver.

verify_connected()[source]

Throw an exception if not connected.

panoptes.pocs.dome.astrohaven module

class panoptes.pocs.dome.astrohaven.AstrohavenDome(*args, **kwargs)[source]

Bases: AbstractSerialDome

Interface to an Astrohaven clamshell dome with a Vision 130 PLC and RS-232 interface.

Experience shows that it emits a status byte about once a second, with the codes as described in the Protocol class.

LISTEN_TIMEOUT = 3
MOVE_LISTEN_TIMEOUT = 0.1
MOVE_TIMEOUT = 10
NUM_CLOSE_FEEDBACKS = 2
close()[source]

If not known to be closed, attempts to close the dome.

Must already be connected.

Returns: True if and when closed, False if unable to close.

property is_closed

True if dome is known to be closed.

property is_open

True if dome is known to be open.

open()[source]

If not known to be open, attempts to open the dome.

Must already be connected.

Returns: True if and when open, False if unable to open.

property status

Return a dict with dome’s current status.

panoptes.pocs.dome.astrohaven.Dome

alias of AstrohavenDome

class panoptes.pocs.dome.astrohaven.Protocol[source]

Bases: object

A_CLOSE_LIMIT = 'X'
A_IS_CLOSED = '1'
A_OPEN_LIMIT = 'x'
BOTH_CLOSED = '0'
BOTH_OPEN = '3'
B_CLOSE_LIMIT = 'Y'
B_IS_CLOSED = '2'
B_OPEN_LIMIT = 'y'
CLOSE_A = 'A'
CLOSE_B = 'B'
CLOSE_BOTH = 'C'
OPEN_A = 'a'
OPEN_B = 'b'
OPEN_BOTH = 'O'
RESET = 'R'
STABLE_STATES = ('0', '3', '2', '1')

panoptes.pocs.dome.bisque module

class panoptes.pocs.dome.bisque.Dome(*args, **kwargs)[source]

Bases: AbstractDome

docstring for Dome

close()[source]

If not known to be closed, attempts to close the dome.

Must already be connected.

Returns: True if and when closed, False if unable to close.

connect()[source]

Establish a connection to the dome controller.

The sub-class implementation can access configuration information from self._config; see PanBase for more common properties.

Returns: True if connected, False otherwise.

disconnect()[source]

Disconnect from the dome controller.

Raises:

An exception if unable to disconnect.

find_home()[source]
property is_closed

True if dome is known to be closed.

property is_connected

True if connected to the hardware or driver.

property is_open

True if dome is known to be open.

property is_parked
open()[source]

If not known to be open, attempts to open the dome.

Must already be connected.

Returns: True if and when open, False if unable to open.

park()[source]
property position
read(timeout=5)[source]
read_slit_state()[source]
property status

A string representing the status of the dome for presentation.

This string is NOT for use in logic, only for presentation, as there is no requirement to produce the same string for different types of domes: a roll-off roof might have a very different status than a rotating dome that is coordinating its movements with the telescope mount.

Examples: ‘Open’, ‘Closed’, ‘Opening’, ‘Closing’, ‘Left Moving’, ‘Right Stuck’

Returns: A string.

unpark()[source]
write(value)[source]

panoptes.pocs.dome.protocol_astrohaven_simulator module

panoptes.pocs.dome.simulator module

class panoptes.pocs.dome.simulator.Dome(*args, **kwargs)[source]

Bases: AbstractDome

Simulator for a Dome controller.

close()[source]

If not known to be closed, attempts to close the dome.

Must already be connected.

Returns: True if and when closed, False if unable to close.

connect()[source]

Establish a connection to the dome controller.

The sub-class implementation can access configuration information from self._config; see PanBase for more common properties.

Returns: True if connected, False otherwise.

disconnect()[source]

Disconnect from the dome controller.

Raises:

An exception if unable to disconnect.

property is_closed

True if dome is known to be closed.

property is_open

True if dome is known to be open.

open()[source]

If not known to be open, attempts to open the dome.

Must already be connected.

Returns: True if and when open, False if unable to open.

property status

A string representing the status of the dome for presentation.

This string is NOT for use in logic, only for presentation, as there is no requirement to produce the same string for different types of domes: a roll-off roof might have a very different status than a rotating dome that is coordinating its movements with the telescope mount.

Examples: ‘Open’, ‘Closed’, ‘Opening’, ‘Closing’, ‘Left Moving’, ‘Right Stuck’

Returns: A string.

Module contents

class panoptes.pocs.dome.AbstractDome(*args, **kwargs)[source]

Bases: PanBase

Abstract base class for controlling a non-rotating dome.

This assumes that the observatory ‘dome’ is not a classic rotating dome with a narrow slit, but instead something like a roll-off roof or clam-shell, which can be observed from when open, and that the other states (closed or moving) are not used for observing.

Adding support for a rotating dome would require coordination during observing to make sure that the opening tracks the field being observed.

abstract close()[source]

If not known to be closed, attempts to close the dome.

Must already be connected.

Returns: True if and when closed, False if unable to close.

abstract connect()[source]

Establish a connection to the dome controller.

The sub-class implementation can access configuration information from self._config; see PanBase for more common properties.

Returns: True if connected, False otherwise.

abstract disconnect()[source]

Disconnect from the dome controller.

Raises:

An exception if unable to disconnect.

abstract is_closed()[source]

True if dome is known to be closed.

property is_connected

True if connected to the hardware or driver.

abstract is_open()[source]

True if dome is known to be open.

abstract open()[source]

If not known to be open, attempts to open the dome.

Must already be connected.

Returns: True if and when open, False if unable to open.

abstract property status

A string representing the status of the dome for presentation.

This string is NOT for use in logic, only for presentation, as there is no requirement to produce the same string for different types of domes: a roll-off roof might have a very different status than a rotating dome that is coordinating its movements with the telescope mount.

Examples: ‘Open’, ‘Closed’, ‘Opening’, ‘Closing’, ‘Left Moving’, ‘Right Stuck’

Returns: A string.

panoptes.pocs.dome.create_dome_from_config(*args, **kwargs)[source]

If there is a dome specified in the config, create a driver for it.

A dome needs a config. We assume that there is at most one dome in the config, i.e. we don’t support two different dome devices, such as might be the case if there are multiple independent actuators, for example slit, rotation and vents. Those would need to be handled by a single dome driver class.

panoptes.pocs.dome.create_dome_simulator(*args, **kwargs)[source]