Aether Sensors
Aether Sensors¶
Aether sensors allow you to interact with OKAPI:Aether, more specifically for services related to sensor and ground station operations. This page provides illustrated examples to help you get started. We first import dependencies and declare variables which will be useful for our use case. The test data can be downloaded here, while the notebook itself may be fetched here.
import json
import os
from okapi_aether_sdk.aether_sensors_api import AetherSensorsApi
# Ensure that the .env file is populated with the required entries for authentication
aether_api = AetherSensorsApi()
aether_api.login()
# The below code is used to load data from a repository to illustrate the use of the Aether Sensors API.
here = globals()['_dh'][0]
testdata = here / "testdata" / "aether_sensors_api"
with open(os.path.join(testdata, "sensor_system_data.json"), "r") as fp:
request = json.load(fp)
sensor = aether_api.add_sensor_system(sensor_system_to_add=request)
Fetching a sensor from OKAPI:Aether¶
In order to update or see a sensor's information as stored in OKAPI:Aether, it is possible to use the get_sensor_system
method. Below, we use this method to retrieve the sensor we just added to the system, which allows us to verify everything went smoothly with the upload. here we see that the Braunschweig Telescope (BS Telescope) is present in the system
sensor = aether_api.get_sensor_system(sensor_system_id=sensor["sensor_system_id"])
print(f"Properties for the newly inserted sensor: {sensor['sensor_system']['content']}")
Properties for the newly inserted sensor: {'name': 'BS Telescope', 'longitude': 21.912781, 'latitude': 49.9796, 'altitude': 0.582, 'measurement_noise': {'rightascension': 0.000139, 'declination': 0.000139}}
with open(os.path.join(testdata, "tdms_data.json"), "r") as fp:
request = json.load(fp)
tdms = aether_api.add_tdms(tdm_data=request)
tdm_ids = [tdm["tdm_id"] for tdm in tdms]
for tdm_id in tdm_ids:
print(f"Added TDM with ID: {tdm_id}")
Added TDM with ID: 72283313-8a6d-4f2f-ab66-e95e7b5fd9bd Added TDM with ID: 389a0836-0c35-4a92-a891-ca559ff3a99c
Retrieve TDMs from OKAPI:Aether¶
It is possible to retrieve TDMs from OKAPI:Aether either by using the unique identifier of the TDM returned after the upload to get a single TDM, or by using the available filters to fetch a list of TDMS. Below, we retrieve first one of the TDMs we just inserted by using the get_tdm
method, and then by filtering TDMs using the get_tdms
method. Formats for the payloads can be found here for a single TDM and here for multiple TDMs.
tdm = aether_api.get_tdm(tdm_id=tdm_ids[0])
print(f"Retrieved TDM with ID: {tdm['tdm_id']}")
tdms = aether_api.get_tdms(filters={"insert_epoch": {"$gte": "2025-04-24T19:30:00.000Z"}})
print([tdm["tdm_id"] for tdm in tdms])
Retrieved TDM with ID: 72283313-8a6d-4f2f-ab66-e95e7b5fd9bd
['551f4d7b-290e-40d4-8028-61770e1608fc', 'd12e900d-d1a6-4cad-a0c0-1ed83171adb5', 'd41901dd-30ec-4846-b940-8f37502e9dbf', '1eb477b6-7bf0-418f-a00b-749d5dfcf2f7', '52ee0e62-3343-4d04-bddc-9006292f70a7', 'd6ad3b39-2afa-4286-8ec0-638882405f6f', '04eb0389-c69a-444e-a9fd-681abcbd4b28', 'de96abf2-b8e8-44cb-9c32-a45445cc1eaf', '9bdcbfd2-cb24-4002-9dd4-36adcf808b57', 'c3b561a3-e8c2-4e2d-887a-4fe955e5256c', '475767a9-4cb9-467e-928b-8046badb0642', 'bf56733f-e1a4-4d32-8e43-2a7817cf7860', '1b40e49c-2fe5-4ab9-a1e8-76c370fab515', '5da36e82-9546-4ee1-9936-7e949c6a04fb', 'b37b6de5-b2e2-4ee5-b400-78bfbcfae283', '43a82183-707d-49cd-9209-266f5ebb70c5', 'af43e4a4-42c1-409e-b944-356c74eb5f6e', '74e2e77c-790f-4776-a2da-f55880e7dd59', 'a0ea61b2-dfd5-4b9f-96b8-9518fc096ef6', '2b2434a3-b887-4f74-8dd3-f79c2483848a']
with open(os.path.join(testdata, "ground_station_pass_data.json"), "r") as fp:
request = json.load(fp)
aether_api.add_ground_station_pass(request)
ground_station_passes = aether_api.get_ground_station_passes()
Retrieve ground station passes¶
It is possible to retrieve ground station passes, with optional filters. This will look inside OKAPI:Aether for the user's ground station(s) and retrieve passes based on the supplied optional filter criteria. In this example, we retrieve the ground station passes for the satellite with name "TEST-SAT" so that we exclude any other assets from the query. Payload formatting rules can be found here
ground_station_passes = aether_api.get_ground_station_passes(filters={"name": "TEST-SAT"})
print(f"There are {len(ground_station_passes)} ground station passes retrieved.")
There are 13 ground station passes retrieved.