panoptes.pocs.mount package¶
Subpackages¶
- panoptes.pocs.mount.ioptron package
- Submodules
- panoptes.pocs.mount.ioptron.base module
- panoptes.pocs.mount.ioptron.cem40 module
- panoptes.pocs.mount.ioptron.ieq30pro module
- Module contents
MountGPS
MountHemisphere
MountInfo
MountInfo.CEM120
MountInfo.CEM120EC
MountInfo.CEM120EC2
MountInfo.CEM25
MountInfo.CEM26
MountInfo.CEM26EC
MountInfo.CEM40
MountInfo.CEM40EC
MountInfo.CEM60
MountInfo.CEM60EC
MountInfo.CEM70
MountInfo.CEM70EC
MountInfo.GEM28
MountInfo.GEM28EC
MountInfo.GEM45
MountInfo.GEM45EC
MountInfo.iEQ30Pro
MountInfo.iEQ45Pro
MountInfo.iEQ45ProAA
MountMovementSpeed
MountState
MountTimeSource
MountTrackingState
Submodules¶
panoptes.pocs.mount.bisque module¶
- class panoptes.pocs.mount.bisque.Mount(*args, **kwargs)[source]¶
Bases:
AbstractMount
- connect()[source]¶
Connects to the mount via the serial port (self._port)
- Returns:
- Returns the self.is_connected property which checks
the actual serial connection.
- Return type:
- initialize(unpark=False, *args, **kwargs)[source]¶
Initialize the connection with the mount and setup for location.
If the mount is successfully initialized, the _setup_location_for_mount method is also called.
- Returns:
Returns the value from self.is_initialized.
- Return type:
- move_direction(direction='north', seconds=1.0, arcmin=None, rate=None)[source]¶
Move mount in specified direction for given amount of seconds
- park(timeout=120)[source]¶
Slews to the park position and parks the mount.
Note
When mount is parked no movement commands will be accepted.
- Returns:
indicating success
- Return type:
- query(*args, **kwargs)[source]¶
Override the query method to use the command lock.
This is required because TheSkyX cannot handle simulataneous commands. This function will block until the lock is released.
- set_target_coordinates(coords)[source]¶
Sets the RA and Dec for the mount’s current target.
- Parameters:
coords (astropy.coordinates.SkyCoord) – coordinates specifying target location
- Returns:
Boolean indicating success
- Return type:
- slew_to_home(blocking=False, timeout=120)[source]¶
Slews the mount to the home position.
Note
Home position and Park position are not the same thing
- slew_to_target(timeout=120, **kwargs)[source]¶
Slews to the current _target_coordinates
- Returns:
indicating success
- Return type:
panoptes.pocs.mount.mount module¶
- class panoptes.pocs.mount.mount.AbstractMount(location, commands=None, *args, **kwargs)[source]¶
Bases:
PanBase
Abstract Base class for controlling a mount. This provides the basic functionality for the mounts. Sub-classes should override the initialize method for mount-specific issues as well as any helper methods specific mounts might need. See “NotImplemented Methods” section of this module.
Sets the following properties:
self.non_sidereal_available = False
self.PEC_available = False
self._is_initialized = False
- Parameters:
config (dict) – Custom configuration passed to base mount. This is usually read from the main system config.
commands (dict) – Commands for the telescope. These are read from a yaml file that maps the mount-specific commands to common commands.
location (EarthLocation) – An astropy.coordinates.EarthLocation that contains location information.
- distance_from_target()[source]¶
Get current distance from target
- Returns:
An angle represeting the current on-sky separation from the target
- Return type:
u.Angle
- get_current_coordinates()[source]¶
Reads out the current coordinates from the mount.
Note
See _mount_coord_to_skycoord and _skycoord_to_mount_coord for translation of mount specific coordinates to astropy.coordinates.SkyCoord
- Returns:
astropy.coordinates.SkyCoord
- get_ms_offset(offset, axis='ra')[source]¶
Get offset in milliseconds at current speed
- Parameters:
offset (astropy.units.Angle) – Offset in arcseconds
axis (str) – The name of the axis to move, default ‘ra’.
- Returns:
Offset in milliseconds at current speed
- Return type:
astropy.units.Quantity
- get_target_coordinates()[source]¶
Gets the RA and Dec for the mount’s current target. This does NOT necessarily reflect the current position of the mount, see get_current_coordinates.
- Return type:
astropy.coordinates.SkyCoord
- get_tracking_correction(offset_info, pointing_ha, min_tracking_threshold=None, max_tracking_threshold=None)[source]¶
Determine the needed tracking corrections from current position.
This method will determine the direction and number of milliseconds to correct the mount for each axis in order to correct for any tracking drift. The Declination axis correction (‘north’ or ‘south’) depends on the movement of the camera box with respect to the pier, which can be determined from the Hour Angle (HA) of the pointing image in the sequence.
Note
Correction values below 50ms will be skipped and values above 99999ms will be clipped.
- Parameters:
offset_info (OffsetError) – A named tuple describing the offset error. See pocs.images.OffsetError.
pointing_ha (float) – The Hour Angle (HA) of the mount at the beginning of the observation sequence in degrees. This affects the direction of the Dec adjustment.
min_tracking_threshold (int, optional) – Minimum size of tracking correction allowed in milliseconds. Tracking corrections lower than this are ignored. Default 100ms from self.min_tracking_threshold.
max_tracking_threshold (int, optional) – Maximum size of tracking correction allowed in milliseconds. Tracking corrections higher than this are set to this value. Default 99999ms from self.max_tracking_threshold.
- Returns:
Offset corrections for each axis as needed
dict: { # axis: (arcsec, millisecond, direction) 'ra': (float, float, str), 'dec': (float, float, str), }
- Return type:
- property has_target¶
- home_and_park(*args, **kwargs)[source]¶
Convenience method to first slew to the home position and then park.
- property is_connected¶
Checks the serial connection on the mount to determine if connection is open
- Type:
- property location¶
The location details for the mount.
When a new location is set,`_setup_location_for_mount` is called, which will update the mount with the current location. It is anticipated the mount won’t change locations while observing so this should only be done upon mount initialization.
- Type:
astropy.coordinates.SkyCoord
- move_direction(direction='north', seconds=1.0)[source]¶
Move mount in specified direction for given amount of seconds
- park(*args, **kwargs)[source]¶
Slews to the park position and parks the mount.
The park position must be set manually first for this method to work.
Most mount subclasses will override this method to provide mount-specific park functionality.
Note
When mount is parked no movement commands will be accepted.
- Returns:
indicating success
- Return type:
- query(cmd, params=None, **kwargs)[source]¶
Sends a query to the mount and returns response.
Performs a send and then returns response. Will do a translate on cmd first. This should be the major serial utility for commands. Accepts an additional args that is passed along with the command. Checks for and only accepts one args param.
- Parameters:
Examples
>>> from panoptes.pocs.mount import create_mount_from_config >>> mount = create_mount_from_config() >>> mount.query('set_local_time', '101503') '1' >>> mount.query('get_local_time') '101503'
- Returns:
The response from the mount.
- Return type:
- Deleted Parameters:
*args: Parameters to be sent with command if required.
- set_target_coordinates(coords)[source]¶
Sets the RA and Dec for the mount’s current target.
- Parameters:
coords (astropy.coordinates.SkyCoord) – coordinates specifying target location
- Returns:
Boolean indicating success
- Return type:
- slew_to_coordinates(coords, *args, **kwargs)[source]¶
Slews to given coordinates.
- Parameters:
coords (astropy.SkyCoord) – The coordinates to slew to.
- Returns:
indicating success
- Return type:
- slew_to_home(blocking=True, timeout=180)[source]¶
Slews the mount to the home position.
Note
Home position and Park position are not the same thing
- slew_to_target(blocking=False, timeout=180)[source]¶
Slews to the currently assigned target coordinates.
Slews the mount to the coordinates that have been assigned by ~set_target_coordinates. If no coordinates have been set, do nothing and return False, otherwise return response from the mount.
If blocking=True then wait for up to timeout seconds for the mount to reach the is_tracking state. If a timeout occurs, raise a pocs.error.Timeout exception.
- property status¶
panoptes.pocs.mount.serial module¶
- class panoptes.pocs.mount.serial.AbstractSerialMount(location, *args, **kwargs)[source]¶
Bases:
AbstractMount
,ABC
- connect()[source]¶
Connects to the mount via the serial port (self._port)
- Returns:
Returns the self.is_connected property (bool) which checks the actual serial connection.
- set_tracking_rate(direction='ra', delta=0.0)[source]¶
Set the tracking rate for the mount :param direction: Either ra or dec :type direction: str, optional :param delta: Offset multiple of sidereal rate, defaults to 0.0 :type delta: float, optional
- write(cmd)[source]¶
Sends a string command to the mount via the serial port.
First ‘translates’ the message into the form specific mount can understand using the mount configuration yaml file. This method is most often used from within query and may become a private method in the future.
Note
This command currently does not support the passing of parameters. See query instead.
- Parameters:
cmd (str) – A command to send to the mount. This should be one of the commands listed in the mount commands yaml file.
panoptes.pocs.mount.simulator module¶
- class panoptes.pocs.mount.simulator.Mount(location, *args, **kwargs)[source]¶
Bases:
AbstractMount
Mount class for a simulator. Use this when you don’t actually have a mount attached.
- get_current_coordinates()[source]¶
Reads out the current coordinates from the mount.
Note
See _mount_coord_to_skycoord and _skycoord_to_mount_coord for translation of mount specific coordinates to astropy.coordinates.SkyCoord
- Returns:
astropy.coordinates.SkyCoord
- get_ms_offset(offset, axis='ra')[source]¶
Fake offset in milliseconds
- Parameters:
offset (astropy.units.Angle) – Offset in arcseconds
- Returns:
Offset in milliseconds at current speed
- Return type:
astropy.units.Quantity
- initialize(unpark=False, *arg, **kwargs)[source]¶
Initialize the connection with the mount and setup for location.
iOptron mounts are initialized by sending the following two commands to the mount:e
Version
MountInfo
If the mount is successfully initialized, the _setup_location_for_mount method is also called.
- Returns:
Returns the value from self._is_initialized.
- Return type:
- move_direction(direction='north', seconds=1.0)[source]¶
Move mount in specified direction for given amount of seconds
- query(cmd, params=None, **kwargs)[source]¶
Sends a query to the mount and returns response.
Performs a send and then returns response. Will do a translate on cmd first. This should be the major serial utility for commands. Accepts an additional args that is passed along with the command. Checks for and only accepts one args param.
- Parameters:
Examples
>>> from panoptes.pocs.mount import create_mount_from_config >>> mount = create_mount_from_config() >>> mount.query('set_local_time', '101503') '1' >>> mount.query('get_local_time') '101503'
- Returns:
The response from the mount.
- Return type:
- Deleted Parameters:
*args: Parameters to be sent with command if required.
- slew_to_home(blocking=False, timeout=1)[source]¶
Slews the mount to the home position.
Note
Home position and Park position are not the same thing
- Returns:
indicating success
- Return type:
- slew_to_target(slew_delay=0.5, *args, **kwargs)[source]¶
Slews to the currently assigned target coordinates.
Slews the mount to the coordinates that have been assigned by ~set_target_coordinates. If no coordinates have been set, do nothing and return False, otherwise return response from the mount.
If blocking=True then wait for up to timeout seconds for the mount to reach the is_tracking state. If a timeout occurs, raise a pocs.error.Timeout exception.
Module contents¶
- panoptes.pocs.mount.create_mount_from_config(mount_info=None, earth_location=None, *args, **kwargs) AbstractMount [source]¶
Create a mount instance based on the provided config.
Creates an instance of the AbstractMount sub-class in the module specified in the config. Specifically, the class must be in a file called pocs/mount/<DRIVER_NAME>.py, and the class must be called Mount.
- Parameters:
mount_info – Optional param which overrides the ‘mount’ entry in config if provided. Useful for testing.
earth_location – astropy.coordinates.EarthLocation instance, representing the location of the mount on the Earth. If not specified, the config must include the observatory’s location (Latitude, Longitude and Altitude above mean sea level). Useful for testing.
*args – Other positional args will be passed to the concrete class specified in the config.
**kwargs – Other keyword args will be passed to the concrete class specified in the config.
- Returns:
An instance of the Mount class if the config (or mount_info) is complete. None if neither mount_info nor config[‘mount’] is provided.
- Raises:
error.MountNotFound – Exception raised when mount cannot be created because of incorrect configuration.