Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The TAT-C web application contains four major components:

The web application is configured to support the RabbitMQ Broker and Redis Backend.

The application requires TAT-C version 3.7 and accepts all of its space-domain
The application requires TAT-C version 3.8 and accepts all of its space-domain
platforms: satellites and Walker, train, MOG, and streets-of-coverage (SOC)
constellations, with every orbit type (including two line elements and repeat
ground track orbits), instrument type (simple, pointed, and conical), and
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"itsdangerous",
"msgpack-asgi",
"python-dotenv",
"tatc >= 3.7.0, < 3.8",
"tatc >= 3.8.0, < 3.9",
"tzlocal",
"uvicorn[standard]"
]
Expand Down
10 changes: 8 additions & 2 deletions src/static/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const SYSTEM_CLASS_LABELS = {
geostationary: "Geostationary"
};

const ROLE_LABELS = {
observing: "observing",
transmitting: "navigation (transmitting)",
relaying: "data relay (relaying)"
};

let catalogSystems = null;
let catalogUnchecked = {}; // instruments the user unchecked, by identifier

Expand Down Expand Up @@ -74,7 +80,7 @@ function loadCatalogSystems() {
}

function isActive(spacecraft) {
return spacecraft.status != "retired";
return spacecraft.status != "retired" && spacecraft.status != "storage";
}

function renderCatalogSystems() {
Expand Down Expand Up @@ -108,7 +114,7 @@ function renderCatalogSystem() {
return;
}
renderCatalogDetails(details, system.operator + " · "
+ (system.role == "transmitting" ? "navigation (transmitting)" : "observing"), system);
+ (ROLE_LABELS[system.role] || system.role), system);
_.forEach(system.spacecraft, function(spacecraft) {
const id = "catalog-member-" + spacecraft.id;
const label = $("<label>").addClass("form-check-label").attr("for", id).text(
Expand Down
2 changes: 1 addition & 1 deletion src/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h6 class="dropdown-header" id="user-email"></h6>
<!-- Information -->
<div class="tab-pane fade show active" id="nav-info" role="tabpanel" aria-labelledby="nav-info-tab">
<p><strong>Tradespace Analysis Tool for Constellations (TAT-C)</strong>: Mission engineering platform for distributed satellite missions.</p>
<p class="small text-muted">Application version <span id="app-version"></span>, based on the <a href="https://github.com/code-lab-org/tatc">TAT-C library</a> version 3.7.</p>
<p class="small text-muted">Application version <span id="app-version"></span>, based on the <a href="https://github.com/code-lab-org/tatc">TAT-C library</a> version 3.8.</p>
<p>Current project team:</p>
<ul>
<li>PI: Paul T. Grogan (<a href="mailto:paul.grogan@asu.edu">paul.grogan@asu.edu</a>)</li>
Expand Down
2 changes: 1 addition & 1 deletion src/static/schemas.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Declarative specifications of the space-domain schemas of the TAT-C library
// (version 3.7): satellites and constellations, orbits, and instruments, with
// (version 3.8): satellites and constellations, orbits, and instruments, with
// the units of form fields and their conversion to the library's SI units.
//
// Field properties:
Expand Down
9 changes: 4 additions & 5 deletions src/tatc_app/analysis/sufficiency.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ def compute_sufficiency( # pylint: disable=too-many-arguments,too-many-locals
geometry=points.geometry.values,
crs=points.crs or "EPSG:4326",
)
if observations is None or observations.empty:
# as `estimate_sampling_error` gives targets without samples (tatc
# 3.7.0 fails for observations without any rows): no error, and no
# effective samples
if observations is None:
# as `estimate_sampling_error` gives observations without any rows
# (which need its columns): no error, and no effective samples
error = pd.DataFrame(
{
"target_hash": targets["target_hash"],
Expand All @@ -95,7 +94,7 @@ def compute_sufficiency( # pylint: disable=too-many-arguments,too-many-locals
"effective_samples": 0.0,
}
)
observations = observations if observations is not None else pd.DataFrame()
observations = pd.DataFrame()
else:
error = estimate_sampling_error(
observations,
Expand Down
25 changes: 15 additions & 10 deletions src/tatc_app/system_catalog/systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
MAX_DURATION = timedelta(days=366)
"""Longest period for which to build instruments (some schedule by day)."""

NO_PAYLOAD_ROLES = ("transmitting", "relaying")
"""Roles of systems whose satellites carry no cataloged instruments."""


class CatalogInstrument(BaseModel):
"""An instrument a spacecraft carries: an entry of the instrument catalog."""
Expand All @@ -57,8 +60,8 @@ class CatalogSpacecraft(BaseModel):
id: str = Field(..., description="Spacecraft identifier.")
name: str = Field(..., description="Spacecraft name.")
norad_id: int = Field(..., description="NORAD catalog number.")
status: Literal["operational", "extended", "retired"] = Field(
..., description="Status on the date `as_of`."
status: Literal["operational", "extended", "storage", "retired"] = Field(
..., description="Status on the date `as_of` (`storage` for a spare in orbit)."
)
as_of: date = Field(..., description="Date of the status.")
instruments: list[CatalogInstrument] = Field(
Expand All @@ -77,7 +80,7 @@ class CatalogSatelliteSystem(BaseModel):
system_class: str = Field(
..., description="System class (sun_synchronous, inclined, geostationary)."
)
role: str = Field(..., description="Role (observing or transmitting).")
role: str = Field(..., description="Role (observing, transmitting, or relaying).")
operator: str = Field(..., description="Organizations that operate it.")
selection: str = Field(..., description="Why the system is cataloged.")
tier: str = Field(..., description="Validation tier of the system.")
Expand Down Expand Up @@ -130,7 +133,7 @@ class CatalogBuildRequest(CatalogPeriod):
None,
min_length=1,
description="Identifiers (or names) of the spacecraft to build "
+ "(default: those not retired).",
+ "(default: those neither retired nor in storage).",
)
instruments: bool | list[str] = Field(
True,
Expand Down Expand Up @@ -170,7 +173,7 @@ def _get_references(system: SatelliteSystem, spacecraft: Spacecraft) -> list[str
"""
Gets the identifiers of the cataloged instruments a spacecraft carries.
"""
if system.role == "transmitting":
if system.role in NO_PAYLOAD_ROLES:
return []
return system.get_payload_references(spacecraft.id)

Expand Down Expand Up @@ -255,20 +258,22 @@ def select_spacecraft(
Args:
system (SatelliteSystem): The system.
members (list[str] | None): The identifiers or names of the
spacecraft, or None for those not retired.
spacecraft, or None for those neither retired nor in storage.

Returns:
list[Spacecraft]: The spacecraft (without duplicates).

Raises:
ValueError: If a member is unknown, or (by default) every spacecraft
is retired.
is retired or in storage.
"""
if members is None:
selected = [s for s in system.spacecraft if s.status != "retired"]
defaults = system.get_default_members()
selected = [s for s in system.spacecraft if s.id in defaults]
if not selected:
raise ValueError(
f"Every spacecraft of {system.name} is retired: select members."
f"Every spacecraft of {system.name} is retired or in storage: "
"select members."
)
return selected
selected = []
Expand Down Expand Up @@ -395,7 +400,7 @@ def _build_satellite( # pylint: disable=too-many-arguments,too-many-positional-
satellite cannot carry together) are left out.
"""
if not references:
if request.instruments is not False and system.role != "transmitting":
if request.instruments is not False and system.role not in NO_PAYLOAD_ROLES:
notes.append(
f"{spacecraft.name} carries "
+ (
Expand Down
20 changes: 20 additions & 0 deletions tests/test_system_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ def test_build_default_members(self):
# Suomi NPP is retired
self.assertEqual([m["id"] for m in result["members"]], ["noaa-20", "noaa-21"])

def test_build_relay_satellites(self):
tdrs = next(s for s in list_satellite_systems() if s.id == "tdrs")
self.assertEqual(tdrs.role, "relaying")
statuses = {s.id: s.status for s in tdrs.spacecraft}
self.assertIn("storage", statuses.values())
result = self.build("tdrs")
# spares in storage are not built by default, as retired spacecraft
self.assertEqual(
[m["id"] for m in result["members"]],
[
i
for i, status in statuses.items()
if status not in ("retired", "storage")
],
)
# relay satellites carry no cataloged instruments, without a warning
satellite = adapter.validate_python(result["satellites"][0])
self.assertEqual([i.name for i in satellite.instruments], ["Default"])
self.assertFalse(any("cataloged instrument" in w for w in result["warnings"]))

def test_build_without_gp_elements(self):
result = self.build("trmm", members=["trmm"])
self.assertEqual(result["members"][0]["orbit_source"], "catalog")
Expand Down
Loading