Code Examples
Interaction with Satcat Launch can be fully automated using the Satcat SDK or CLI tools. This page provides examples of how to create, configure, and run launch screenings for integrating Satcat Launch into your platform.
Complete Screening Job
In this example, a launch screening is created and configured with a single primary launch ephemeris, a launch window, and a secondary catalog.
Code Example - Complete Launch Screening Job
- SDK (Python)
- CLI
# Upload an O/O ephemeris file
ephemeris = client.screening.create_ephemeris(
"23_Launch_Payload_Caliper.txt",
file_format="caliper",
hbr_m=15.0
)
# Configure the launch screening
configuration = satcat.ScreeningConfiguration(
screening_type="LAUNCH",
launch_window_start=satcat.utc("2023-01-01T00:00:00.000Z"),
launch_window_end=satcat.utc("2023-01-01T01:00:00.000Z"),
launch_window_cadence_s=1,
)
# Create the screening
screening = client.screening.create_screening(
config=configuration,
primaries=[ephemeris],
add_best_secondary_catalog=True,
)
Note the id field of the created screening as this is used to retrieve screening results once complete.
$ satcat create screening \
--type launch \
--launch-window-start='2023-01-01T00:00:00.000Z' \
--launch-window-end='2023-01-01T01:00:00.000Z' \
--launch-window-cadence-s=1 \
--pef 23_Launch_Payload_Caliper.txt \
--pfmt caliper
Secondary Data
Adding a Catalog
Using a catalog as a secondary tells Satcat Launch to screen the primaries against all ephemerides in the catalog. Satcat Launch provides two indicators to help select an appropriate catalog for a screening:
LatestThe most recently created catalog for a given catalog typeBestThe latest catalog for the best catalog type available to the user's organization (typically SP)
Code Example - Retrieve the Latest Catalog
- SDK (Python)
- CLI
catalog = client.screening.get_latest_catalog()
$ satcat list catalogs --latest
Code Example - Using the "Best Catalog" Setting
- SDK (Python)
- CLI
screening = client.screening.create_screening(
...
add_best_secondary_catalog=True,
)
$ satcat create screening \
--use-best-catalog \
...
Adding Ephemerides
One or more ephemerides can be used directly as secondaries instead of a catalog.
Code Example - Uploading an Ephemeris
- SDK (Python)
- CLI
ephemeris = client.screening.create_ephemeris(
"23_Launch_Payload_Caliper.txt",
file_format="caliper",
hbr_m=15.0
)
$ satcat create ephemeris 23_Launch_Payload_Caliper.txt caliper --hbr_m=15.0
Code Example - Use an Ephemeris as a Secondary by Unique ID
- SDK (Python)
- CLI
# Example 1: Retrieve an explicit Ephemeris by ID (ephemeris_id)
ephemeris = client.screening.get_ephemeris(ephemeris_id)
# Example 2: Retrieve the Ephemeris for a specific object by Norad Catalog ID (e.g. 25544) from a Catalog (by catalog_id)
ephemeris = client.screening.list_catalog_ephemerides(catalog_id, filters=[{"field": "norad_cat_id", "value": 25544}])[0]
# Example 3: Upload an Ephemeris to use as a Secondary
ephemeris = client.screening.create_ephemeris("MEME_12345_OEM_20230301.txt", file_format="OEM", comments="Custom Ephemeris for Object 12345")
screening = client.screening.create_screening(
...
secondaries=[ephemeris]
)
Example: use an explicit ephemeris by ID
$ satcat create screening \
--secondary-ephemeris-ids adbf0394-973f-4db4-a4b9-24abed33a1a5
Modifying Threshold Radius Values
The threshold radius is the distance at which two objects in the space domain are considered to have a conjunction, or close approach. Satcat Launch also allows setting different threshold radius values for secondary objects of different categories.
Code Example - Setting the Threshold Radius
- SDK (Python)
- CLI
configuration = satcat.ScreeningConfiguration(
...,
threshold_radius_km = 15.0
)
screening = client.screening.create_screening(
config=configuration,
...
)
$ satcat create screening \
--threshold-radius-km=15.0
Code Example - Setting a Category-specific Threshold Radius
- SDK (Python)
- CLI
configuration = satcat.ScreeningConfiguration(
...,
threshold_radius_manned_km = 200.0,
threshold_radius_active_km = 25.0,
threshold_radius_debris_km = 2.5
)
screening = client.screening.create_screening(
config=configuration,
...
)
$ satcat create screening \
--threshold-radius-manned-km=200.0 \
--threshold-radius-active-km=25.0 \
--threshold-radius-debris-km=2.5 \
...
Strict Coverage
The coverage of a primary is the amount of the primary ephemeris which overlaps in time with the secondary ephemerides. Satcat Launch provides an optional strict coverage configuration parameter (enabled by default) which can be disabled to allow a screening to be performed even with PARTIAL coverage.
Code Example - Disable Strict Coverage
- SDK (Python)
- CLI
screening = client.screening.create_screening(
...
strict_coverage=False # manually disable the Strict Coverage setting
)
$ satcat create screening \
...
--no-strict-coverage # manually disable the Strict Coverage setting
Submission
Code Example - Submitting at Creation Time
- SDK (Python)
- CLI
screening = client.screening.create_screening(
...
submit=True # automatically submit the Screening during creation
)
$ satcat create screening \
...
--submit # automatically submit the Screening
Code Example - Submitting Manually
- SDK (Python)
- CLI
client.screening.submit_screening(screening)
$ satcat submit screening [screening id]
Waiting for Results
Satcat Launch screenings are asynchronous operations which are processed in a queue on Kayhan servers. Satcat Launch provides tools to check the status of a screening, or automatically poll the server to await its completion.
Code Example - Awaiting Screening Completion
- SDK (Python)
- CLI
# Refresh the screening object and check its status
screening = client.screening.get_screening(screening.id)
print(screening.status)
# Await the completion of the screening automatically
screening = client.screening.await_screening_completion(screening)
# Retrieve the screening and check its status
$ satcat get screening [screening id]
$ satcat await screening [screening id]
The --wait flag on satcat create screening submits and awaits the screening in one command.
Conjunction Results
Once the screening is complete, you can review the conjunctions which were identified during screening.
Code Example - Listing Conjunction Results
- SDK (Python)
- CLI
conjunctions = client.screening.list_conjunctions(screening.id)
The filters, sort_field, sort_direction, and count fields query the screening's conjunctions directly. To order the list by Probability of Collision, highest first:
conjunctions = client.screening.list_conjunctions(
screening.id,
sort_field="collision_probability",
sort_direction="desc"
)
:::
$ satcat list conjunctions [screening id]
The --count flag limits how many conjunctions are retrieved.