alpaca package¶
Submodules¶
alpacadsc.alpaca_controller module¶
alpacadsc.alpaca_models module¶
alpacadsc.alpaca_service module¶
alpacadsc.altaz_dsc_profile module¶
-
class
alpacadsc.altaz_dsc_profile.
AltAzSettingCirclesProfile
(reldir, name=None)¶ Bases:
alpacadsc.profiles.Profile
-
class
Encoders
(_sectionname: str = 'encoders', driver: str = None, serial_port: str = None, serial_speed: int = 9600, alt_resolution: int = None, az_resolution: int = None, alt_reverse: bool = False, az_reverse: bool = False)¶ Bases:
alpacadsc.profiles.ProfileSection
-
alt_resolution
= None¶ Alt axis resolution
-
alt_reverse
= False¶ Reverse ALT?
-
az_resolution
= None¶ AZ axis resolution
-
az_reverse
= False¶ Reverse AZ?
-
driver
= None¶
-
serial_port
= None¶
-
serial_speed
= 9600¶
-
-
class
Location
(_sectionname: str = 'location', obsname: str = None, latitude: float = None, longitude: float = None, altitude: float = None)¶ Bases:
alpacadsc.profiles.ProfileSection
-
altitude
= None¶ Altitude in meters
-
latitude
= None¶ Latitude in degrees
-
longitude
= None¶ Longitude in degrees
-
obsname
= None¶ Name of observing location
-
-
read
()¶ Read profile config file.
Returns: (bool) Whether or not read succeeded.
-
class
alpacadsc.baseencoders module¶
-
class
alpacadsc.baseencoders.
A
¶
-
class
alpacadsc.baseencoders.
EncodersBase
¶ Bases:
object
Base class for all encoder drivers.
-
connect
()¶ The driver should connect to the digital setting circles hardware when this method is called.
-
disconnect
()¶ The driver should disconnect to the digital setting circles hardware when this method is called.
-
get_encoder_position
()¶ Read the encoders resolution from the digital setting circles hardware.
Returns: (tuple) The position of the altitude and azimuth encoders.
-
get_encoder_resolution
()¶ Read the encoders resolution from the digital setting circles hardware.
Returns: (tuple) The resolution of the altitude and azimuth encoders.
-
name
()¶ Returns the human readable name for this driver.
-
set_encoder_resolution
(res_alt, res_az)¶ Read the encoders resolution from the digital setting circles hardware.
Parameters: - res_alt – Resolution (steps/rev) of altitude encoder.
- res_alt – Resolution (steps/rev) of azimuth encoder.
-
alpacadsc.encoders_altaz_daveek module¶
-
class
alpacadsc.encoders_altaz_daveek.
EncodersDaveEk
(res_alt=4000, res_az=4000, reverse_alt=False, reverse_az=False)¶ Bases:
alpacadsc.baseencoders.EncodersBase
Parameters: - res_alt (int, optional) – Altitude encoder resolution, defaults to 4000
- res_az (int, optional) – Azimuth encoder resolution, defaults to 4000
- reverse_alt (bool, optional) – Reverse altitude axis, defaults to False
- reverse_az (bool, optional) – Reverse azimuth axis, defaults to False
-
connect
(port, speed=9600)¶ The driver should connect to the digital setting circles hardware when this method is called.
Parameters: - port – Serial device to which digital setting circles is connected.
- res_alt – Speed for serial connection.
Returns: True is successful.
Return type: bool
-
disconnect
()¶ Disconnect.
Returns: True is successful. Return type: bool
-
get_encoder_position
()¶ Read the encoders resolution from the digital setting circles hardware.
Returns: (ttuple) The position of the altitude and azimuth encoders.
-
get_encoder_resolution
()¶ Read the encoders resolution from the digital setting circles hardware.
Returns: (tuple) The resolution of the altitude and azimuth encoders.
-
name
()¶ Returns the human readable name for this driver.
-
set_encoder_resolution
(res_alt, res_az)¶ Read the encoders resolution from the digital setting circles hardware.
Parameters: - res_alt – Resolution (steps/rev) of altitude encoder.
- res_alt – Resolution (steps/rev) of azimuth encoder.
alpacadsc.encoders_altaz_simulator module¶
-
class
alpacadsc.encoders_altaz_simulator.
EncodersAltAzSimulator
(res_alt=4000, res_az=4000, *, reverse_alt=False, reverse_az=False)¶ Bases:
alpacadsc.baseencoders.EncodersBase
Parameters: - res_alt (int, optional) – Altitude encoder resolution, defaults to 4000
- res_az (int, optional) – Azimuth encoder resolution, defaults to 4000
- reverse_alt (bool, optional) – Reverse altitude axis, defaults to False
- reverse_az (bool, optional) – Reverse azimuth axis, defaults to False
-
connect
(port, speed=9600)¶ The driver should connect to the digital setting circles hardware when this method is called.
Note: port and speed ignored in this simulator driver.
Parameters: - port – Serial device to which digital setting circles is connected.
- res_alt – Speed for serial connection.
Returns: (bool) True is successful.
-
disconnect
()¶ The driver should disconnect to the digital setting circles hardware when this method is called.
-
get_encoder_position
()¶ Read the encoders resolution from the digital setting circles hardware.
Returns: (ttuple) The position of the altitude and azimuth encoders.
-
get_encoder_resolution
()¶ Read the encoders resolution from the digital setting circles hardware.
Returns: (ttuple) The resolution of the altitude and azimuth encoders.
-
name
()¶ Returns the human readable name for this driver.
-
set_encoder_resolution
(res_alt, res_az)¶ Read the encoders resolution from the digital setting circles hardware.
Parameters: - res_alt – Resolution (steps/rev) of altitude encoder.
- res_alt – Resolution (steps/rev) of azimuth encoder.
alpacadsc.profiles module¶
-
class
alpacadsc.profiles.
Profile
(reldir, name=None)¶ Bases:
object
Stores program settings which can be saved persistently. Supports ProfileSection’s which allow a hierarchical namespace for parameters.
Set some defaults for program settings
Parameters: - reldir (str) – location relative to top of default config location If None then will be relative to current working directory.
- name (str) – name of profile config file
Note: reldir = “hfdfocus/” and name = “C8F7.yaml” would create a file <configbasedir>/hfdfocus/C8F7.yaml
-
add_section
(sectionclass)¶ Add a section to Profile.
Parameters: sectionclass (ProfileSection) – Section to be added.
-
filename
()¶ Return profile config filename.
Returns: (Path) Profile filename
-
read
()¶ Read profile config file.
Returns: (bool) Whether or not read succeeded.
-
write
()¶ Write profile config file.
Returns: (bool) Whether or not write succeeded.
-
class
alpacadsc.profiles.
ProfileSection
¶ Bases:
object
A ProfileSection is a subtree member of a Profile and contains its own set of key/value pairs. Multiple ProfileSection’s can be added to a Profile to give parameters different namespaces in the Profile.’
-
get
(key, default=None)¶ Retrieve parameter from ProfileSection by key name. Default value used if key not found in ProfileSection.
Parameters: - key (str) – Name of parameter to retrieve
- default – Optional default value if key not present
Returns: Parameter value or default value if not present.
-
-
alpacadsc.profiles.
find_profiles
(loc)¶ Return list of existing profiles in given location loc. The location loc is relative to the base path for config files for the given platform.
Parameters: loc (str) – Directory relative to base config path to search for profiles Note: Assumes profile configuration files end with ‘.yaml’ Returns: (List[str]) List of profiles found or [] if none available.
-
alpacadsc.profiles.
get_base_config_dir
()¶ Find base path for where to store config files depending on platform.
Returns: (Path) Root path of where config files are stored Raises: FileNotFoundError – If base path cannot be determined.
-
alpacadsc.profiles.
get_current_profile
(loc)¶ Read current_profile.yaml file to get name of current profile.
Parameters: loc (str) – Directory relative to base config path to search for profiles Returns: (str) Name of currently active profile or None if none defined.
-
alpacadsc.profiles.
set_current_profile
(loc, current_profile_name)¶ Write current_profile.yaml file with name of current profile.
Parameters: - loc (str) – Directory relative to base config path to search for profiles
- current_profile_name (str) – Name of current active profile - do NOT include a ‘.yaml’ extension on the profile name.
Returns: (bool) Whether operation was successful or not