### GET /list Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/ftr.md Gets a single file entry according to the predefined listing setup. ```APIDOC ## GET /list ### Description Gets a single file entry according to the predefined listing setup. ### Parameters #### Query Parameters - **next** (bool) - Optional - Get the next item, after a previous call (default: False). ### Response #### Success Response (200) - **is_last** (bool) - If file is last in listing. - **filename** (str) - Name of the file. - **size** (int) - File size [byte]. - **timestamp** (datetime | None) - Date and time of last modification. #### Error Codes - `FTR_MISSINGSETUP`: No active listing setup. - `FTR_INVALIDINPUT`: First item is missing, or last call was already the last. ``` -------------------------------- ### Install GeoComPy from Source Source: https://github.com/mrclock8163/geocompy/blob/main/README.md Install GeoComPy locally from its source code repository. This is useful for using unreleased changes or fixes. ```shell git clone https://github.com/MrClock8163/GeoComPy.git cd GeoComPy python -m pip install . ``` -------------------------------- ### Install GeoComPy from PyPI Source: https://github.com/mrclock8163/geocompy/blob/main/README.md Install the GeoComPy package using pip. This is the recommended method for general use. ```shell python -m pip install geocompy ``` -------------------------------- ### Startup Modes Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/gcdata.md Defines the different modes for starting up the instrument. ```APIDOC ## Startup Modes ### Description Instrument startup modes. ### Enum Values - **GUI** (`2`): Start onboard software. - **LOCAL** (`0`): Manual mode. - **REMOTE** (`1`): GeoCOM mode. ### Version Added Added in version GeoCOM-VivaTPS. ### Deprecated Deprecated since version GeoCOM-VivaTPS. ``` -------------------------------- ### GET BAP_GetATRSetting Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/bap.md Retrieves the current ATR setting. ```APIDOC ## GET BAP_GetATRSetting ### Description Gets the current ATR setting. ### Method GET ### Endpoint RPC 17034 ### Response #### Success Response (200) - **ATRMode** (string) - Current ATR setting. ``` -------------------------------- ### GET /is_camera_ready Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/cam.md Checks if the specified camera is ready for operation. ```APIDOC ## GET /is_camera_ready ### Description Checks if a camera is ready for use (RPC 23627). ### Parameters #### Query Parameters - **camera** (string) - Optional - Camera device, by default OVERVIEW. ### Response #### Success Response (200) - **Status** (string) - Returns success if ready, or error code CAM_NOT_READY if off or starting up. ``` -------------------------------- ### POST MOT_StartController (RPC 6001) Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/mot.md Starts the motor controller in the specified mode. ```APIDOC ## POST MOT_StartController ### Description Starts the motor controller in the specified mode. ### Method POST ### Parameters #### Request Body - **mode** (Controller) - Optional - Controller mode, by default Controller.MANUAL ### Response #### Error Codes - **IVPARAM** - Control mode is not appropriate for velocity control. - **NOT_IMPL** - Motorization not available. - **MOT_BUSY** - Subsystem is busy, controller already started. - **MOT_UNREADY** - Subsystem is not initialized. ``` -------------------------------- ### Establish a TCP connection Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/communication.md Manual setup and teardown of a TCP socket connection using SocketConnection. ```pycon >>> import socket >>> soc = socket.socket( >>> socket.AF_INET, >>> socket.SOCK_STREAM, >>> socket.IPPROTO_TCP >>> ) >>> soc.connect(("192.168.0.1", 1212)) >>> conn = SocketConnection(soc) >>> # message exchanges >>> conn.close() ``` -------------------------------- ### GSI Online Instrument Settings Example Source: https://github.com/mrclock8163/geocompy/blob/main/docs/introduction.md Demonstrates querying and setting instrument parameters using GSI Online commands. 'CONF/30' queries a setting, '0030/0001' is a response, and 'SET/30/2' sets a value. ```default CONF/30 # Query command 0030/0001 # Response SET/30/2 # Setting beeping to loud ? # Success confirmation ``` -------------------------------- ### SerialConnection Example with Timeout Override Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/communication.md Demonstrates the usage of SerialConnection, including a normal operation and a potentially long operation using timeout_override. Ensure the Serial port is correctly configured and opened. ```python >>> from serial import Serial >>> from geocompy.communication import SerialConnection >>> >>> port = Serial("COM1", timeout=5) >>> with SerialConnection(port) as com: ... # normal operation ... ... # potentially long operation ... with com.timeout_override(20): ... answer = com.exchange("message") ... ... # continue normal operation ... ``` -------------------------------- ### GSI Online Measurement Example Source: https://github.com/mrclock8163/geocompy/blob/main/docs/introduction.md Shows how to query and set point IDs using GSI Online measurement commands. 'GET/M/WI11' queries the current point ID, and 'PUT/11....+000000A2' sets a new one. ```default GET/M/WI11 # Query current point ID 11....+000000A1 # Response if format is GSI8 *11....+00000000000000A1 # Response if format is GSI16 PUT/11....+000000A2 # Setting new point ID ? # Success confirmation ``` -------------------------------- ### GeoCOM RPC Example Source: https://github.com/mrclock8163/geocompy/blob/main/docs/introduction.md Illustrates the format of GeoCOM RPC requests and responses. The first line is a command to search for a prism, and the second is a standard OK response. ```default %R1Q,9029:1,1,0 # RPC 9029, prism search in window %R1P,0,0:0 # Standard OK response ``` -------------------------------- ### GET /get_overview_interior_orientation Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/cam.md Retrieves the interior orientation parameters of the camera. ```APIDOC ## GET /get_overview_interior_orientation ### Description Gets the interior orientation parameters of the camera (RPC 23602). ### Parameters #### Query Parameters - **calibrated** (bool) - Optional - Use calibrated data (default: True). ### Response #### Success Response (200) - **float** - Horizontal position of principal point [px]. - **float** - Vertical position of principal point [px]. - **float** - Focus length [m]. - **float** - Pixel size [m/px]. ``` -------------------------------- ### POST MOT_SetVelocity (RPC 6004) Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/mot.md Starts the motors at a constant speed. The motor controller must be set accordingly in advance. ```APIDOC ## POST MOT_SetVelocity ### Description Starts the motors at a constant speed. The motor controller must be set accordingly in advance. ### Method POST ### Parameters #### Request Body - **hz** (float) - Required - Horizontal angle to turn in a second [-pi; +pi]rad. - **v** (float) - Required - Vertical angle to turn in a second [-pi; +pi]rad. ### Response #### Error Codes - **IVPARAM** - Velocities not within acceptable range. - **MOT_NOT_CONFIG** - Motor controller was not started, or is already busy with continuous task. - **MOT_NOT_OCOST** - Controller is not set to constant speed. - **NOT_IMPL** - Motorization is not available. ``` -------------------------------- ### Execute Instrument Command and Print Response Source: https://github.com/mrclock8163/geocompy/blob/main/docs/introduction.md Executes a command to get a reading from the instrument and prints the response. Assumes a connection is already established. ```python level.settings.set_beep(level.settings.BEEPINTENSITY.OFF) resp = level.measurements.get_reading() print(resp) # GsiOnlineResponse(Reading) success, value: ... ``` -------------------------------- ### POST /setup_download Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/ftr.md Prepares download of the specified file of the specified type, on the selected memory device. ```APIDOC ## POST /setup_download ### Description Prepares download of the specified file of the specified type, on the selected memory device. ### Parameters #### Request Body - **filename** (str) - Required - File name (or full path if type is unknown). - **blocksize** (int) - Required - Download data block size. - **device** (Device) - Optional - Memory device (default: Device.CFCARD). - **filetype** (File) - Optional - File type (default: File.UNKNOWN). ### Response #### Success Response (200) - **num_blocks** (int) - Number of download blocks needed. #### Error Codes - `IVPARAM`: Memory device unavailable, or cannot find file path. - `NOTOK`: Setup already exists, previous setup was not aborted. - `FTR_INVALIDINPUT`: Block size too big. - `FTR_FILEACCESS`: File access error. ``` -------------------------------- ### Get and set geodetic coordinates and instrument parameters Source: https://context7.com/mrclock8163/geocompy/llms.txt This snippet covers retrieving calculated coordinates and configuring instrument settings like station coordinates, target height, azimuth, and atmospheric/prism corrections. Requires an active serial connection and GeoCom instance. ```python from geocompy import open_serial, GeoCom, Angle, Coordinate with open_serial("COM1") as conn: tps = GeoCom(conn) # Get calculated coordinates response = tps.tmc.get_simple_coordinate(wait=5, inclination='AUTO') if response: coord = response.params print(f"E: {coord.e:.4f}, N: {coord.n:.4f}, H: {coord.h:.4f}") ``` ```python # Set station coordinates and instrument height tps.tmc.set_station( station=Coordinate(1000.0, 2000.0, 100.0), hi=1.65 ) ``` ```python # Set target height tps.tmc.set_target_height(1.80) ``` ```python # Set azimuth orientation tps.tmc.set_azimuth(Angle(0, 'deg')) ``` ```python # Configure atmospheric corrections tps.tmc.set_atmospheric_corrections( wavelength=0.658, pressure=1013.25, drytemp=20.0, wettemp=15.0 ) ``` ```python # Set prism constant tps.tmc.set_prism_correction(-34.4) ``` ```python # Configure refraction correction tps.tmc.set_refractive_correction( enabled=True, earthradius=6378000, coef=0.13 ) ``` -------------------------------- ### Execute GeoCOM Command and Print Response Source: https://github.com/mrclock8163/geocompy/blob/main/docs/introduction.md Executes a GeoCOM command to get the firmware version and prints the response. GeoCOM commands return a GeoComResponse object containing return codes and parameters. ```python resp = tps.csv.get_firmware_version() print(resp) # GeoComResponse(CSV_GetSWVersion) com: OK, rpc: OK... ``` -------------------------------- ### RPC 5072: setup_listing Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/csv.md Prepares listing of the jobs in memory. ```APIDOC ## RPC 5072: setup_listing ### Description Prepares listing of the jobs in memory. ### Parameters #### Request Body - **device** (unknown) - Optional - Memory device, by default INTERNAL. ### Response - **Return type** (GeoComResponse) - The result of the operation. - **Error codes** - NOTOK: Setup already exists, previous setup was not aborted. ``` -------------------------------- ### COM_GetSWVersion Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/com.md Gets the version of the installed GeoCOM release. ```APIDOC ## GET COM_GetSWVersion ### Description Gets the version of the installed GeoCOM release. ### Method GET ### Response #### Success Response (200) - **int** - Release number - **int** - Version number - **int** - Subversion number ``` -------------------------------- ### Get Signal Intensity Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets information about the intensity of the EDM signal. The EDM must be started in signal measuring mode in advance, and has to be cleared afterwards. ```APIDOC ## GET /api/instrument/signal ### Description Gets information about the intensity of the EDM signal. The EDM most be started in signal measuring mode in advance, and has to be cleared afterwards. ### Method GET ### Endpoint /api/instrument/signal ### Parameters None ### Request Example None ### Response #### Success Response (200) - **signal_intensity** (float) - Return signal intensity [%]. - **measurement_time** (int) - Time of the signal measurement. #### Error Codes - **TMC_SIGNAL_ERROR**: Error in signal measurement. - **ABORT**: Measurement was aborted. - **SHUT_DOWN**: System shutdown. #### Response Example { "signal_intensity": 85.5, "measurement_time": 1678886400 } ``` -------------------------------- ### Set up Serial Connection Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/communication.md Instantiate a `SerialConnection` with a pre-configured `Serial` port. Ensure the serial port is opened and configured with appropriate settings like baud rate and timeout. ```python from serial import Serial conn = gc.communication.SerialConnection(port) ``` -------------------------------- ### Utility - get_dummy_logger Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/communication.md Sets up a dummy logger instance that logs to a nulldevice. ```APIDOC ## POST /communication/get_dummy_logger ### Description Utility function that sets up a dummy logger instance, that does not propagate records, and logs to the nulldevice. ### Method POST ### Endpoint /communication/get_dummy_logger ### Parameters #### Request Body - **name** (string) - Optional - Logger name. Defaults to 'geocompy.dummy'. ### Response #### Success Response (200) - **logger_name** (string) - The name of the created dummy logger. #### Error Response (400) - **error** (string) - Description of the error. ### Request Example ```json { "name": "my_custom_logger" } ``` ### Response Example ```json { "logger_name": "my_custom_logger" } ``` ``` -------------------------------- ### GET BAP_GetPrismDef Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/bap.md Gets the definition of the default prism. ```APIDOC ## GET BAP_GetPrismDef ### Description Gets the definition of the default prism. ### Method GET ### Endpoint RPC 17023 ### Parameters #### Query Parameters - **prism** (string) - Required - Prism type to query. ### Response #### Success Response (200) - **Name** (string) - Name of the prism. - **Constant** (float) - Additive prism constant. - **Reflector** (string) - Reflector type. ``` -------------------------------- ### Get Refractive Method Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets the current refraction mode. ```APIDOC ## GET /api/instrument/refractive/method ### Description Gets the current refraction mode. ### Method GET ### Endpoint /api/instrument/refractive/method ### Parameters None ### Request Example None ### Response #### Success Response (200) - **refraction_method** (int) - Refraction method. #### Response Example { "refraction_method": 1 } ``` -------------------------------- ### RPC 23306: FTR_SetupList Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/ftr.md Prepares a file listing of a specified file type on a selected memory device. ```APIDOC ## RPC 23306: FTR_SetupList ### Description Prepares file listing of the specified file type, on the selected memory device. ### Parameters - **device** (Device) - Optional - Memory device, by default CFCARD. - **filetype** (File) - Optional - File type, by default UNKNOWN. - **path** (str) - Optional - Search path, by default ''. ### Response #### Success Response - **GeoComResponse** (Object) - Returns a GeoComResponse object. #### Error Codes - **IVPARAM**: Memory device unavailable, or cannot find search path. - **NOTOK**: Setup already exists, previous setup was not aborted. - **FTR_FILEACCESS**: File access error. ``` -------------------------------- ### Get Prism Correction Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets the current prism constant. ```APIDOC ## GET /api/instrument/corrections/prism ### Description Gets the current prism constant. ### Method GET ### Endpoint /api/instrument/corrections/prism ### Parameters None ### Request Example None ### Response #### Success Response (200) - **prism_constant** (float) - Prism constant. #### Response Example { "prism_constant": 10.0 } ``` -------------------------------- ### GET /api/tmc/atmospheric/corrections Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets current parameters of the atmospheric correction. ```APIDOC ## GET /api/tmc/atmospheric/corrections ### Description Gets current parameters of the atmospheric correction. ### Method GET ### Endpoint /api/tmc/atmospheric/corrections ### Response #### Success Response (200) - **float** (float) - EDM transmitter wavelength. - **float** (float) - Atmospheric pressure [mbar]. - **float** (float) - Dry temperature [°C]. - **float** (float) - Wet temperature [°C]. #### Response Example { "example": "{\"wavelength\": 0.633, \"pressure\": 1013.25, \"dry_temp\": 20.5, \"wet_temp\": 18.2}" } ``` -------------------------------- ### GET /api/tmc/atmospheric/correction/ppm Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets the current atmospheric correction factor. ```APIDOC ## GET /api/tmc/atmospheric/correction/ppm ### Description Gets the current atmospheric correction factor. ### Method GET ### Endpoint /api/tmc/atmospheric/correction/ppm ### Response #### Success Response (200) - **float** (float) - Atmospheric correction factor [ppm]. #### Response Example { "example": "{\"ppm\": 0.5}" } ``` -------------------------------- ### Initialize GsiOnlineDNA with a Logger Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/index.md Shows how to initialize GsiOnlineDNA with a custom logger for detailed command and response logging. Configure the logger's level and handler as needed. ```python >>> from sys import stdout >>> from logging import getLogger, DEBUG, StreamHandler >>> >>> from geocompy.communication import open_serial >>> from geocompy.gsi.dna import GsiOnlineDNA >>> >>> logger = getLogger("TPS") >>> logger.addHandler(StreamHandler(stdout)) >>> logger.setLevel(DEBUG) >>> with open_serial("COM1") as com: ... dna = GsiOnlineDNA(com, logger=logger) ... dna.beep('SHORT') ... >>> GsiOnlineResponse(GSI Type) ... # Startup GSI format sync GsiOnlineResponse(Beep) ... # First executed command ``` -------------------------------- ### Open Serial Connection and Initialize GsiOnlineDNA Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/index.md Demonstrates opening a serial connection and initializing the GsiOnlineDNA class. Ensure the correct serial port is specified. ```python >>> from geocompy.communication import open_serial >>> from geocompy.gsi.dna import GsiOnlineDNA >>> >>> with open_serial("COM1") as line: ... dna = GsiOnlineDNA(line) ... dna.beep('SHORT') ... >>> ``` -------------------------------- ### Get Refractive Correction Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets current refraction correction coefficients. ```APIDOC ## GET /api/instrument/corrections/refractive ### Description Gets current refraction correction coefficients. ### Method GET ### Endpoint /api/instrument/corrections/refractive ### Parameters None ### Request Example None ### Response #### Success Response (200) - **refraction_correction_enabled** (bool) - Refraction correction enabled. - **earth_radius** (float) - Radius of the Earth. - **refraction_coefficient** (float) - Refraction coefficient. #### Response Example { "refraction_correction_enabled": true, "earth_radius": 6371000.0, "refraction_coefficient": 0.13 } ``` -------------------------------- ### GET /api/tmc/compensator/status Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets the current status of the dual axis compensator. ```APIDOC ## GET /api/tmc/compensator/status ### Description Gets the current status of the dual axis compensator. ### Method GET ### Endpoint /api/tmc/compensator/status ### Response #### Success Response (200) - **bool** (bool) - Compensator is enabled. #### Response Example { "example": "{\"enabled\": true}" } ``` -------------------------------- ### POST /setup_large_download Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/ftr.md Prepares download of the specified large file of the specified type, on the selected memory device. ```APIDOC ## POST /setup_large_download ### Description Prepares download of the specified large file of the specified type, on the selected memory device. ### Parameters #### Request Body - **filename** (str) - Required - File name (or full path if type is unknown). - **blocksize** (int) - Required - Download data block size. - **device** (Device) - Optional - Memory device (default: Device.INTERNAL). - **filetype** (File) - Optional - File type (default: File.UNKNOWN). ### Response #### Success Response (200) - **num_blocks** (int) - Number of download blocks needed. #### Error Codes - `IVPARAM`: Memory device unavailable, or cannot find file path. - `NOTOK`: Setup already exists, previous setup was not aborted. - `FTR_INVALIDINPUT`: Block size too big. - `FTR_FILEACCESS`: File access error. ``` -------------------------------- ### Get Geometric Correction PPM Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets the current geometric correction factors. Added in version GeoCOM-TPS1200. ```APIDOC ## GET /api/instrument/corrections/geometric/ppm ### Description Gets the current geometric correction factors. Added in version GeoCOM-TPS1200. ### Method GET ### Endpoint /api/instrument/corrections/geometric/ppm ### Parameters None ### Request Example None ### Response #### Success Response (200) - **auto_apply_geometric** (bool) - Automatically apply geometric corrections. - **scale_factor_central_meridian** (float) - Scale factor on central meridian. - **offset_central_meridian** (float) - Offset from central meridian. - **length_reduction_projection_to_level** (float) - Length reduction from projection to reference level. - **individual_correction_ppm** (float) - Individual correction [ppm]. #### Response Example { "auto_apply_geometric": true, "scale_factor_central_meridian": 1.0, "offset_central_meridian": 0.0, "length_reduction_projection_to_level": 0.0, "individual_correction_ppm": 0.5 } ``` -------------------------------- ### GeoCOM Transaction ID Examples Source: https://github.com/mrclock8163/geocompy/blob/main/docs/connections.md Examples of GeoCOM request and response messages using transaction IDs. ```default %R1Q,0: %R1P,0,0:0 ``` ```default %R1Q,0,1: %R1P,0,1:0 ``` ```default %R1Q,0,3: %R1P,0,2:0 ``` -------------------------------- ### Open Serial Connection with GeoCom Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/index.md Demonstrates opening a serial connection and initializing the GeoCom handler. Ensure the correct serial port is specified. ```python >>> from geocompy.communication import open_serial >>> from geocompy.geo import GeoCom >>> >>> with open_serial("COM1") as line: ... tps = GeoCom(line) ... tps.com.nullprocess() ... >>> ``` -------------------------------- ### Get Telescope Face Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Gets which face the telescope is currently positioned in. The face information is only valid if the instrument is in an active state. ```APIDOC ## GET /api/instrument/face ### Description Gets which face the telescope is currently positioned in. The face information is only valid if the instrument is in an active state. ### Method GET ### Endpoint /api/instrument/face ### Parameters None ### Request Example None ### Response #### Success Response (200) - **face** (Face) - Current face. #### Response Example { "face": "Face1" } ``` -------------------------------- ### GET /get_sensor_size Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/cam.md Retrieves the dimensions of the camera chip. ```APIDOC ## GET /get_sensor_size ### Description Gets the size of the camera chip (RPC 23668). ### Parameters #### Query Parameters - **camera** (string) - Optional - Camera device, by default OVERVIEW. ### Response #### Success Response (200) - **float** - Sensor width. - **float** - Sensor height. ``` -------------------------------- ### Initialize GeoCom with Logger Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/index.md Shows how to initialize the GeoCom handler with a custom logger for detailed debugging. Configure the logger's level and handlers as needed. ```python >>> from sys import stdout >>> from logging import getLogger, DEBUG, StreamHandler >>> >>> from geocompy.communication import open_serial >>> from geocompy.geo import GeoCom >>> >>> logger = getLogger("TPS") >>> logger.addHandler(StreamHandler(stdout)) >>> logger.setLevel(DEBUG) >>> with open_serial("COM1") as com: ... tps = GeoCom(com, logger=logger) ... tps.com.nullprocess() ... >>> GeoComResponse(COM_NullProc) ... # Startup connection test GeoComResponse(COM_GetDoublePrecision) ... # Precision sync GeoComResponse(COM_NullProc) ... # First executed command ``` -------------------------------- ### GET /api/tmc/height Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Retrieves the current target height setting. ```APIDOC ## GET /api/tmc/height ### Description Gets the current target height. ### Method GET ### Endpoint /api/tmc/height ### Response #### Success Response (200) - **height** (float) - Current target height. #### Response Example ```json { "height": 1.75 } ``` ``` -------------------------------- ### Get Terminator Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/settings.md Retrieves the current message terminator character. ```APIDOC ## GET /api/settings/terminator ### Description Gets the current message terminator. ### Method GET ### Endpoint /api/settings/terminator ### Response #### Success Response (200) - **terminator** (string) - The current message terminator character. Returns `None` if retrieval failed. #### Response Example ```json { "terminator": "\n" } ``` ``` -------------------------------- ### SocketConnection Initialization Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/communication.md Initializes a new SocketConnection instance with a socket and optional configuration parameters. ```APIDOC ## Constructor: SocketConnection(sock, eom='\r\n', eoa='\r\n', sync_after_timeout=False, logger=None) ### Description Initializes the connection wrapper for a given socket. ### Parameters - **sock** (socket) - Required - Socket to communicate on. - **eom** (str) - Optional - EndOfMessage sequence, default '\r\n'. - **eoa** (str) - Optional - EndOfAnswer sequence, default '\r\n'. - **sync_after_timeout** (bool) - Optional - Attempt to re-sync the message-response queue after a timeout, default False. - **logger** (Logger) - Optional - Logger instance for connection events. ``` -------------------------------- ### Get Temperature Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/settings.md Retrieves the current internal temperature of the device. ```APIDOC ## GET /api/settings/temperature ### Description Gets the current internal temperature. ### Method GET ### Endpoint /api/settings/temperature ### Response #### Success Response (200) - **temperature** (float) - The internal temperature. Returns `None` if retrieval failed. #### Response Example ```json { "temperature": 25.5 } ``` ``` -------------------------------- ### Serialize a Byte object Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/data.md Demonstrates creating a Byte instance and its string representation. ```pycon >>> b = gc.data.Byte(17) >>> print(b) '11' ``` -------------------------------- ### Create and Access Vector Components Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/data.md Demonstrates instantiation of a Vector object and accessing its components via attributes or indexing. ```pycon >>> c = gc.data.Vector(1, 2, 3) >>> print(c) Vector(1.0, 2.0, 3.0) >>> c.x 1.0 >>> c[1] 2.0 >>> x, y, z = c >>> z 3.0 ``` -------------------------------- ### GET /get_overview_exterior_orientation Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/cam.md Retrieves the exterior orientation parameters of the camera. ```APIDOC ## GET /get_overview_exterior_orientation ### Description Gets the exterior orientation parameters of the camera (RPC 23603). ### Parameters #### Query Parameters - **calibrated** (bool) - Optional - Use calibrated data (default: True). ### Response #### Success Response (200) - **Coordinate** (object) - Camera offset coordinates. - **Angle** (float) - Yaw deviation. - **Angle** (float) - Pitch deviation. - **Angle** (float) - Roll deviation. ``` -------------------------------- ### Create and Access Coordinate Components Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/data.md Demonstrates instantiation of a Coordinate object and accessing its components via attributes or indexing. ```pycon >>> c = gc.data.Coordinate(1, 2, 3) >>> print(c) Coordinate(1.0, 2.0, 3.0) >>> c.x 1.0 >>> c[1] 2.0 >>> x, y, z = c >>> z 3.0 ``` -------------------------------- ### GET get_user_prism_definition Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/bap.md Retrieves the definition of a user-defined prism by its name. ```APIDOC ## GET get_user_prism_definition ### Description Gets the definition of a user defined prism. ### Parameters #### Path Parameters - **name** (str) - Required - Name of the prism. ### Response #### Success Response (200) - **additive_prism_constant** (float) - Additive prism constant. - **reflector_type** (Reflector) - Reflector type. - **creator** (str) - Creator of the prism definition. #### Error Codes - **IVPARAM** - Invalid prism definition. ``` -------------------------------- ### GET /32 Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/measurements.md Measures the distance from the aimed levelling staff. ```APIDOC ## GET 32 ### Description Measures the distance from the aimed levelling staff in meters. ### Method GET ### Endpoint 32 ### Response #### Success Response (200) - **response** (GsiOnlineResponse) - Distance in meters. ``` -------------------------------- ### Configuration and Settings API Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/csv.md APIs for setting instrument configurations. ```APIDOC ## POST /api/instrument/datetime ### Description Sets the date and time on the instrument. ### Method POST ### Endpoint /api/instrument/datetime ### Parameters #### Request Body - **time** (datetime) - Required - New date and time to set. ### Request Example ```json { "time": "2023-10-27T10:00:00Z" } ``` ### Response #### Success Response (200) - **status** (str) - Operation status. #### Response Example ```json { "status": "Success" } ``` ``` -------------------------------- ### GET /561 Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/measurements.md Retrieves the current month and day from the instrument. ```APIDOC ## GET 561 ### Description Gets the current month and day. ### Method GET ### Endpoint 561 ### Response #### Success Response (200) - **response** (GsiOnlineResponse) - Current month and day wrapped in a datetime object (year should be ignored). ``` -------------------------------- ### POST /fine_adjust Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/aut.md Precisely targets a prism using a search window. ```APIDOC ## POST /fine_adjust ### Description Precisely targets a prism. If the prism is not within the view of the ATR, a target search is executed in the specified window (RPC 9037, AUT_FineAdjust). ### Parameters #### Request Body - **width** (number) - Required - Width of target search window. - **height** (number) - Required - Height of target search window. ### Response #### Success Response (200) - **response** (GeoComResponse) - The result of the operation. #### Error Codes - **NA**: GeoCOM Robotic license not found. - **IVPARAM**: Invalid parameter - **AUT_TIMEOUT**: Positioning timed out. - **AUT_MOTOR_ERROR**: Instrument has no motorization. - **FATAL**: Fatal error. - **ABORT**: Function aborted. - **COM_TIMEDOUT**: Communication timeout. - **AUT_NO_TARGET**: No ATR target found. - **AUT_MULTIPLE_TARGETS**: Multiple ATR targets found. - **AUT_BAD_ENVIRONMENT**: Inadequate environmental conditions. - **AUT_DEV_ERROR**: Angle deviation calculation error. - **AUT_NOT_ENABLED**: ATR mode is not active. - **AUT_DETECTOR_ERROR**: Error in target acquisition. ``` -------------------------------- ### GET /AUS_GetUserLockState Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/aus.md Retrieves the current state of the LOCK mode. ```APIDOC ## GET AUS_GetUserLockState ### Description Gets the current state of the LOCK mode. (RPC 18005) ### Method GET ### Response #### Success Response (200) - **enabled** (bool) - ATR lock is enabled. #### Error Codes - **NOT_IMPL** - ATR is not available. ``` -------------------------------- ### GeoCom Initialization Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/index.md Initializes the GeoCOM protocol handler with a connection and optional configuration settings. ```APIDOC ## GeoCom Initialization ### Description Initializes the GeoCOM protocol handler. The connection is tested by sending an LF character and executing COM_NullProc. ### Parameters - **connection** (object) - Required - Connection to use for communication (usually a serial connection). - **logger** (object) - Optional - Logger to log all requests and responses, default is None. - **attempts** (int) - Optional - Number of tries at connection validation before raising exception, default is 2. - **checksum** (bool) - Optional - Use and verify checksums in requests, default is False. ### Response - **Raises** (ConnectionRefusedError) - If the connection could not be verified in the specified number of attempts. ``` -------------------------------- ### GET /AUS_GetUserAtrState Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/aus.md Retrieves the current state of the ATR mode. ```APIDOC ## GET AUS_GetUserAtrState ### Description Gets the current state of the ATR mode. (RPC 18006) ### Method GET ### Response #### Success Response (200) - **enabled** (bool) - ATR is enabled. #### Error Codes - **NOT_IMPL** - ATR is not available. ``` -------------------------------- ### COM_Local Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/com.md Switches instrument to local mode, exiting the online mode. ```APIDOC ## POST COM_Local ### Description Switches instrument to local mode, exiting the online mode. Once switched, further RPCs will be ignored until online mode is manually activated. ### Method POST ``` -------------------------------- ### GET /api/tmc/complete/measurement Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/tmc.md Performs a complete measurement including angle and inclination. ```APIDOC ## GET /api/tmc/complete/measurement ### Description Performs a complete measurement including angle and inclination. ### Method GET ### Endpoint /api/tmc/complete/measurement ### Parameters #### Query Parameters - **wait** (int) - Optional - Time to wait for measurement completion, defaults to 5 seconds. - **mode** (Inclination) - Optional - Inclination measurement mode, defaults to Inclination.AUTO ``` -------------------------------- ### POST /turn_to Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/aut.md Turns the telescope to the specified angular positions. ```APIDOC ## POST /turn_to ### Description Turns the telescope to the specified angular positions. ### Method POST ### Parameters #### Request Body - **hz** (float) - Required - Horizontal position. - **v** (float) - Required - Vertical position. - **posmode** (enum) - Optional - Positioning precision mode, default: Position.NORMAL. - **atrmode** (enum) - Optional - ATR mode, default: ATR.POSITION. ### Response #### Success Response (200) - **GeoComResponse** (object) - The response object. #### Error Handling - **IVPARAM** - Invalid parameter - **AUT_TIMEOUT** - Positioning timed out - **AUT_MOTOR_ERROR** - Instrument has no motorization - **AUT_ANGLE_ERROR** - Angle measurement error - **AUT_INACC** - Inexact position - **ABORT** - Function aborted - **COM_TIMEDOUT** - Communication timeout - **AUT_NO_TARGET** - No ATR target found - **AUT_MULTIPLE_TARGETS** - Multiple ATR targets found - **AUT_BAD_ENVIRONMENT** - Inadequate environmental conditions - **AUT_ACCURACY** - Position not within tolerances - **AUT_DEV_ERROR** - Angle deviation calculation error - **AUT_NOT_ENABLED** - ATR mode is not active ``` -------------------------------- ### Get Temperature Unit Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/settings.md Retrieves the current measurement unit for temperature. ```APIDOC ## GET /api/settings/temperature_unit ### Description Gets the current temperature measurement unit. ### Method GET ### Endpoint /api/settings/temperature_unit ### Response #### Success Response (200) - **temperature_unit** (string) - The current temperature unit (e.g., 'C' for Celsius, 'F' for Fahrenheit). Returns `None` if retrieval failed. #### Response Example ```json { "temperature_unit": "C" } ``` ``` -------------------------------- ### Initialize GeoCom with Serial Connection Source: https://github.com/mrclock8163/geocompy/blob/main/docs/introduction.md Establishes a GeoCom connection to an instrument via a serial port. The connection is tested and parameters are synchronized during initialization. Ensure the instrument is turned on and in GeoCOM mode. ```python from geocompy import GeoCom, open_serial with open_serial("COM1", timeout=10) as com: tps = GeoCom(com) ``` -------------------------------- ### Get Recorder Status Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/settings.md Retrieves the current measurement recording device. ```APIDOC ## GET /api/settings/recorder ### Description Gets the current measurement recording device. ### Method GET ### Endpoint /api/settings/recorder ### Response #### Success Response (200) - **recorder_device** (string) - The target recording device. Returns `None` if retrieval failed. #### Response Example ```json { "recorder_device": "internal_memory" } ``` ``` -------------------------------- ### RPC 5155: switch_startup_message Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/csv.md Enables or disables the startup message mode on the instrument. ```APIDOC ## RPC 5155: switch_startup_message ### Description Enables or disables the startup message mode on the instrument. ### Parameters #### Request Body - **enabled** (unknown) - Required - Startup message mode is enabled. ### Response - **Return type** (GeoComResponse) - The result of the operation. ``` -------------------------------- ### Get Protocol Status Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/gsi/dna/settings.md Retrieves the current status of the communication protocol. ```APIDOC ## GET /api/settings/protocol ### Description Gets the current status of the communication protocol. ### Method GET ### Endpoint /api/settings/protocol ### Response #### Success Response (200) - **protocol_status** (string) - The current protocol status. Returns `None` if retrieval failed. #### Response Example ```json { "protocol_status": "active" } ``` ``` -------------------------------- ### Import GeoComPy Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/index.md Standard import convention for accessing GeoComPy functionality. ```pycon >>> import geocompy as gc ``` -------------------------------- ### GET /get_zoom Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/cam.md Retrieves the current zoom factor for a camera device. ```APIDOC ## GET /get_zoom ### Description Sets/Gets the current zoom factor on a camera device (RPC 23609). ### Parameters #### Query Parameters - **camera** (string) - Optional - Camera device, by default OVERVIEW. ### Response #### Success Response (200) - **Zoom** (float) - Current zoom level. ``` -------------------------------- ### GET /get_telescopic_crosshair Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/cam.md Retrieves the crosshair position in the current camera resolution. ```APIDOC ## GET /get_telescopic_crosshair ### Description Gets the position of the crosshair in the actual camera resolution (RPC 23671). ### Response #### Success Response (200) - **int** - Horizontal position. - **int** - Vertical position. ``` -------------------------------- ### Convert to/from polar coordinates Source: https://context7.com/mrclock8163/geocompy/llms.txt Demonstrates converting a coordinate to polar format and creating a coordinate from polar measurements. Ensure the 'target' object is initialized. ```python hz, v, dist = target.to_polar() print(f"Hz: {hz.asunit('deg'):.4f}, V: {v.asunit('deg'):.4f}, Dist: {dist:.3f}") ``` ```python coord = Coordinate.from_polar( hz=Angle(45, 'deg'), v=Angle(85, 'deg'), dist=100.0 ) ``` -------------------------------- ### GET BAP_GetLastDisplayedError Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/bap.md Retrieves the number of the last displayed system error. ```APIDOC ## GET BAP_GetLastDisplayedError ### Description Retrieves the number of the last displayed system error. The error code is reset once the command is executed. ### Method GET ### Endpoint RPC 17003 ### Response #### Success Response (200) - **int** - Last error, warning or info number. - **int** - Corresponding GSI error number. ``` -------------------------------- ### GET /AUS_GetRcsSearchSwitch Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/geo/aus.md Retrieves the current state of the RCS search mode. ```APIDOC ## GET AUS_GetRcsSearchSwitch ### Description Gets the current state of the RCS search mode. (RPC 18010) ### Method GET ### Response #### Success Response (200) - **enabled** (bool) - RCS-style search is enabled. #### Error Codes - **NOT_IMPL** - ATR is not available. ``` -------------------------------- ### Connect via Internet Socket Source: https://github.com/mrclock8163/geocompy/blob/main/docs/connections.md Initiate a TCP/IP connection to an instrument over a shared WLAN network. ```python from geocompy import open_socket with open_socket("192.168.0.1", 1212, "tcp") as soc: soc.send("some message") ``` -------------------------------- ### SocketConnection Class Source: https://github.com/mrclock8163/geocompy/blob/main/docs/api/communication.md Initializes a SocketConnection, wrapping an open socket connection. ```APIDOC ### Class: SocketConnection ### Description Connection wrapping an open socket connection. The passed socket should be configured and opened in advance. The socket can use any protocol, that the target instrument supports. A suitable timeout for total stations might be 15 seconds. (A too short timeout may result in unexpected errors when waiting for a slower, motorized function.) ### Parameters #### Path Parameters - **sock** (socket) - Required - The open socket connection. - **eom** (str) - Optional - End of message delimiter. Defaults to '\r\n'. - **eoa** (str) - Optional - End of answer delimiter. Defaults to '\r\n'. - **sync_after_timeout** (bool) - Optional - Whether to synchronize after a timeout. Defaults to False. - **logger** (logger) - Optional - A logger object. Defaults to None. ```