Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions imap_processing/ialirt/generate_coverage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Coverage time for each station."""

import logging
from datetime import time as dt_time

import numpy as np

Expand Down Expand Up @@ -159,6 +160,17 @@ def generate_coverage( # noqa: PLR0912
time_range[outage_mask], format_str="ISOC"
)

# Mopra: fixed daily allocation (20:45-00:30 UTC), no geometry needed.
# Split into two same-day windows to avoid the midnight rollover.
mopra_evening = StationProperties(0, 0, 0, 0, dt_time(20, 45), dt_time(23, 59, 59))
mopra_morning = StationProperties(0, 0, 0, 0, dt_time(0, 0), dt_time(0, 30))
mopra_mask = create_schedule_mask(mopra_evening, time_range) | create_schedule_mask(
mopra_morning, time_range
)
total_visible_mask |= mopra_mask
coverage_dict["Mopra"] = et_to_utc(time_range[mopra_mask], format_str="ISOC")
outage_dict["Mopra"] = np.array([], dtype="<U23")
Comment on lines +163 to +172

# --- DSN Stations ---
if dsn:
for dsn_station, contacts in dsn.items():
Expand Down
20 changes: 19 additions & 1 deletion imap_processing/tests/ialirt/unit/test_generate_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def test_dsn(furnish_kernels):
)

assert "I-ALiRT Coverage Summary" in output["summary"]
assert 40.6 == output["total_coverage_percent"]
# Mopra's fixed daily allocation now contributes to total coverage.
assert 56.6 == output["total_coverage_percent"]


@patch("imap_processing.ialirt.generate_coverage.et_to_utc")
Expand Down Expand Up @@ -181,3 +182,20 @@ def test_create_schedule_mask(mock_et_to_utc):
)

np.testing.assert_array_equal(mask, expected)


@pytest.mark.external_kernel
def test_mopra_coverage(furnish_kernels):
"""
Test that Mopra's fixed daily allocation (20:45-00:30 UTC) is applied.
"""
kernels = ["naif0012.tls", "pck00011.tpc", "de440s.bsp", "imap_spk_demo.bsp"]

with furnish_kernels(kernels):
coverage_dict, _ = generate_coverage("2026-09-22T00:00:00Z")

mopra_times = coverage_dict["Mopra"]

assert "2026-09-22T20:45:00.000" in mopra_times
assert "2026-09-22T00:30:00.000" in mopra_times
assert "2026-09-22T12:00:00.000" not in mopra_times
Comment on lines +199 to +201
Loading