ioptron_for_python package

Submodules

ioptron_for_python.controller module

iOptron Driver for Linux
Matheus J. Castro
This is the main file. aaaHere you find the main classes.
class ioptron_for_python.controller.Ioptron(port)[source]

Bases: IoptronDevices, IoptronCommands

Main class to bridge iOptron RS-232 Command Language with python calls

Parameters:
  • IoptronDevices – Device list class.

  • IoptronCommands – Command list class.

  • port – The RS-232 port where the device is connected.

close_serial()[source]

Closes the serial connection.

Returns:

1 if successful.

fast_send_cmd(data)[source]

Send a string to the serial without reading its output. It encodes the string.

Parameters:

data – The unencoded string.

Returns:

1 after completion.

static format_command(data)[source]

Format the input command and check for errors. It also adds : at the beginning and # at the end of the command string.

Parameters:

data – The unformatted command.

Returns:

The formatted command.

health_check()[source]

Check if the mount is still connected. Raises an MountConnectionError error if not.

Returns:

1 if successful.

init_serial(timedate=True)[source]

Initialize the serial connection.

Parameters:

timedate – If True, it will update the mount with the current computer date and time.

Returns:

1 if successful.

send_cmd(data)[source]

Send a string to the serial device and read its output. It encodes and decodes the string.

Parameters:

data – The unencoded string.

Returns:

The decoded output without #.

set_current_timedate()[source]

Send the commands to update the date and time of the mount with the current computer time.

class ioptron_for_python.controller.IoptronCall(main_instance, commands, fast=False)[source]

Bases: object

Wrapper class to create a command call for RS-232 with the command.

Parameters:
  • main_instance – The main class.

  • commands – The class where the commands are translated.

  • fast – True: no output returned; False: reads the output from the mount. Default: False.

class ioptron_for_python.controller.IoptronCommands[source]

Bases: object

Define all iOptron RS-232 Command Language commands.
- iOptron Mount RS-232 Command Language 2014, Version 2.5 from Jan. 15th 2019.
altitude_azimuth = 'GAC'

Get altitude & azimuth.

altitude_limit = 'GAL'

Get altitude limit (tracking & slewing).

calibrate_mount = 'CM'

Synchronize / calibrate mount.

static custom_ra_rate(rate: float) str[source]

Set the Custom RA tracking rate (n.nnnn * sidereal rate).

Parameters:

rate – a float (nnnnn) between 0.5000 and 1.5000.

Returns:

RRnnnnn.

static daylight_saving(enabled: int) str[source]

Enable or disable the Daylight Saving Time.

Parameters:

enabled – 0 or 1 (n).

Returns:

SDSn.

declination_right_ascension = 'GEC'

Get current declination & right ascension.

firmware_main_and_hc_date = 'FW1'

Get firmware date: mainboard & hand controller

firmware_motor_date = 'FW2'

Get firmware date: RA & Dec motor boards

go_home = 'MH'

Slew immediately to zero/home position.

static guide_east(ms: int) str[source]

Guide east for specified milliseconds.

Parameters:

ms – an int (XXXXX) between 0 and 99999.

Returns:

MeXXXXX.

static guide_north(ms: int) str[source]

Guide north for specified milliseconds.

Parameters:

ms – an int (XXXXX) between 0 and 99999.

Returns:

MnXXXXX.

static guide_south(ms: int) str[source]

Guide south for specified milliseconds.

Parameters:

ms – an int (XXXXX) between 0 and 99999.

Returns:

MsXXXXX.

static guide_west(ms: int) str[source]

Guide west for specified milliseconds.

Parameters:

ms – an int (XXXXX) between 0 and 99999.

Returns:

MwXXXXX.

guiding_rate = 'AG'

Get guiding rate (RA & DEC).

static hemisphere(value: int) str[source]

Set the Hemisphere.

Parameters:

value – 0 for south or 1 for north (n).

Returns:

SHEn.

static latitude(value: int) str[source]

Set the Latitude (arc-seconds).

Parameters:

value – an int (sSSSSSS) between -324000 and 324000.

Returns:

StsSSSSSS.

local_time_info = 'GLT'

Get local time/time zone info.

static longitude(value: int) str[source]

Set the Longitude (arc-seconds).

Parameters:

value – an int (sSSSSSS) between -648000 and 648000.

Returns:

SgsSSSSSS.

longitude_latitude_status = 'GLS'

Get longitude, latitude & status.

max_slew_rate = 'GSR'

Get maximum slewing speed.

meridian_treatment = 'GMT'

Get meridian treatment mode/limit.

mount_model = 'MountInfo'

Gets the mount model number

move_east = 'me'

Continuous motion (like pressing arrow keys) to east until stop_motion is called.

move_north = 'mn'

Continuous motion (like pressing arrow keys) to north until stop_motion is called.

move_south = 'ms'

Continuous motion (like pressing arrow keys) to south until stop_motion is called.

move_west = 'mw'

Continuous motion (like pressing arrow keys) to west until stop_motion is called.

static moving_rate(rate: int) str[source]

Set the moving rate.

Parameters:

rate – an int (n) between 1 and 9.

Returns:

SRn.

park = 'MP1'

Park mount to the most recently defined parking position.

parking_position = 'GPC'

Get parking position alt/az.

search_home = 'MSH'

Automatically search the mechanical home position using sensors.

static set_altitude(value: str) str[source]

Set Altitude.

Parameters:

value – an 8 character string (TTTTTTTT).

Returns:

SasTTTTTTTT.

static set_altitude_limit(value: int) str[source]

Set the Altitude limit.

Parameters:

value – an int (snn) between -89 and 89.

Returns:

SALsnn.

static set_azimuth(value: str) str[source]

Set Azimuth.

Parameters:

value – a 9 character string (TTTTTTTTT).

Returns:

SzTTTTTTTT.

static set_date(year: int, month: int, day: int) str[source]

Set local date.

Parameters:
  • year – an int between 0 and 99 (YY).

  • month – an int between 1 and 12 (MM).

  • day – an int between 1 and 31 (DD).

Returns:

SCYYMMDD.

static set_dec(value: str) str[source]

Set Declination.

Parameters:

value – an 8 character string (TTTTTTTT).

Returns:

SdsTTTTTTTT.

static set_guiding_rate(ra: int, dec: int) str[source]

Set the Guiding rate.

Parameters:
  • ra – an int (nn) between 1 and 90 (0.01-0.90).

  • def – an int (nn) between 10 and 99 (0.10-0.99).

Returns:

RGnnnn.

static set_max_slew_rate(rate: int) str[source]

Set the Maximum slewing speed.

Parameters:

rate – 7, 8 or 9 (n).

Returns:

MSRn.

static set_meridian_treatment(mode: int, degrees: int) str[source]

Set the Meridian treatment.

Parameters:
  • mode – 0 to stop or 1 to flip (n).

  • degrees – an int (nn) between 0 and 99.

Returns:

SMTnnn.

static set_parking_altitude(value: str) str[source]

Set parking altitude.

Parameters:

value – an 8 character string (TTTTTTTT).

Returns:

SPHTTTTTTTT.

static set_parking_azimuth(value: str) str[source]

Set parking azimuth.

Parameters:

value – a 9 character string (TTTTTTTTT).

Returns:

SPATTTTTTTTT.

static set_ra(value: str) str[source]

Set Right Ascension.

Parameters:

value – an 8 character string (XXXXXXXX).

Returns:

SrXXXXXXXX.

static set_time(hour: int, minute: int, second: int) str[source]

Set local time.

Parameters:
  • hour – an int between 0 and 23 (HH).

  • minute – an int between 0 and 59 (MM).

  • second – an int between 0 and 59 (SS).

Returns:

SLHHMMSS.

set_zero = 'SZP'

Set current position as zero position.

slew = 'MS'

Slew to the most recently defined coordinates.

stop_lr = 'qR'

Stop left/right movement.

stop_motion = 'q'

Stop movement from arrow commands (:mn, :me, :ms, :mw).

stop_slew = 'Q'

Stop slewing only.

stop_ud = 'qD'

Stop up/down movement.

static tracking(enabled: int) str[source]

Enable or disable tracking state.

Parameters:

enabled – 0 to stop or 1 to start tracking (n).

Returns:

STn.

static tracking_rate(rate: int) str[source]

Set the tracking rate.

Parameters:

rate – an int (n) between 0 and 4.

Returns:

RTn.

unpark = 'MP0'

Unpark mount.

static utc_offset(minutes: int) str[source]

Set the UTC offset in minutes.

Parameters:

minutes – an int (sMMM) between -720 and 780.

Returns:

SGsMMM.

class ioptron_for_python.controller.IoptronDevices[source]

Bases: object

Define all RS-232-enabled iOptron devices and their code-tags.

devices_ref = {'0010': 'Cube_II_Cube_Pro_EQ_mode', '0011': 'SmartEQ_Pro_Plus', '0025': 'CEM25_CEM25P', '0026': 'CEM25-EC', '0030': 'iEQ30_Pro', '0040': 'CEM40', '0041': 'CEM40-EC', '0045': 'iEQ45_Pro_EQ_mode', '0046': 'iEQ45_Pro_AA_mode', '0060': 'CEM60', '0061': 'CEM60-EC', '5010': 'Cube_II_Cube_Pro_AA_mode', '5035': 'AZ_Mount_Pro'}
exception ioptron_for_python.controller.MountConnectionError[source]

Bases: Exception

Class to raise Mount Connection Errors

exception ioptron_for_python.controller.WrongCommand[source]

Bases: Exception

Class to raise Wrong Commands Errors