メインコンテンツまでスキップ

コード例

Satcat Launchの操作は、Satcat SDKまたはSatcat CLIのツールを使用して完全に自動化できます。このページでは、Satcat Launchをお使いのプラットフォームに統合するために、打ち上げスクリーニングを作成、設定、実行する方法の例を紹介します。


スクリーニングジョブの全体の例​

この例では、1つのプライマリの打ち上げ軌道暦、打ち上げウィンドウ、およびセカンダリのカタログを使用して、打ち上げスクリーニングを作成し、設定します。

コード例 - 打ち上げスクリーニングジョブの全体
# 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,
)

セカンダリのデータ​

カタログの追加​

カタログをセカンダリとして使用すると、Satcat Launchは、カタログ内のすべての軌道暦に対してプライマリをスクリーニングします。Satcat Launchには、スクリーニングに適したカタログを選択するための2つの指標があります。

  • Latest   特定のカタログタイプで最も新しく作成されたカタログ
  • Best   ユーザーの組織が利用できる最適なカタログタイプの最新のカタログ(通常はSP)
コード例 - 最新のカタログの取得
catalog = client.screening.get_latest_catalog()
コード例 - 「Best Catalog」設定の使用
screening = client.screening.create_screening(
...
add_best_secondary_catalog=True,
)

軌道暦の追加​

カタログの代わりに、1つ以上の軌道暦を直接セカンダリとして使用できます。

コード例 - 軌道暦のアップロード
ephemeris = client.screening.create_ephemeris(
"23_Launch_Payload_Caliper.txt",
file_format="caliper",
hbr_m=15.0
)
コード例 - 一意のIDで軌道暦をセカンダリとして使用
# 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]
)

しきい値半径の値の変更​

しきい値半径とは、宇宙領域の2つの物体が接近事象(最接近)にあると見なされる距離です。Satcat Launchでは、セカンダリ物体のカテゴリごとに異なるしきい値半径の値を設定することもできます。

コード例 - しきい値半径の設定
configuration = satcat.ScreeningConfiguration(
...,
threshold_radius_km = 15.0
)
screening = client.screening.create_screening(
config=configuration,
...
)
コード例 - カテゴリ別のしきい値半径の設定
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,
...
)

Strict Coverage(厳密なカバレッジ)​

プライマリのカバレッジとは、プライマリの軌道暦のうち、セカンダリの軌道暦と時間的に重なっている量です。Satcat Launchには、オプションのstrict coverage(厳密なカバレッジ)設定パラメータ(デフォルトで有効)があります。このパラメータを無効にすると、PARTIALカバレッジでもスクリーニングを実行できます。

カバレッジについての詳細

コード例 - Strict Coverageの無効化
screening = client.screening.create_screening(
...
strict_coverage=False # manually disable the Strict Coverage setting
)

送信​

コード例 - 作成時の送信
screening = client.screening.create_screening(
...
submit=True # automatically submit the Screening during creation
)
コード例 - 手動での送信
client.screening.submit_screening(screening)

結果の待機​

Satcat Launchのスクリーニングは非同期の処理で、Kayhanのサーバー上のキューで処理されます。Satcat Launchには、スクリーニングのステータスを確認するツールと、サーバーを自動的にポーリングして完了を待機するツールがあります。

コード例 - スクリーニングの完了の待機
# 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)

接近事象の結果​

スクリーニングが完了したら、スクリーニングで特定された接近事象を確認できます。

コード例 - 接近事象の結果の一覧表示
conjunctions = client.screening.list_conjunctions(screening.id)

filters、sort_field、sort_direction、countのフィールドを使用して、スクリーニングの接近事象を直接クエリできます。衝突確率(Pc)が高い順に一覧を並べるには、次のようにします。

conjunctions = client.screening.list_conjunctions(
screening.id,
sort_field="collision_probability",
sort_direction="desc"
)

:::