ADCS.environment.environment module¶
Shared model selection and resources for an orbital simulation.
- class ADCS.environment.environment.Environment(magnetic_field=None, atmosphere=None, ephemeris=None, star_catalogue=None)[source]¶
Bases:
objectModels used to evaluate one orbit’s environmental quantities.
The orbit samples these models;
Orbital_Statecarries the sampled values to sensors, actuators, disturbances, and the attitude integrator. Custom atmosphere and ephemeris implementations can also be supplied here.- Parameters:
magnetic_field (MagneticField | None)
atmosphere (Atmosphere | None)
ephemeris (Ephemeris | None)
star_catalogue (StarCatalogue | None)
- classmethod from_json(serialized)[source]¶
Rebuild an environment from
to_json()in a worker process.- Parameters:
serialized (str)
- Return type:
- same_models(other, roles=('magnetic_field', 'atmosphere', 'ephemeris'))[source]¶
Whether
otheruses equivalent models for every role inroles.- Parameters:
other (Environment) – Environment to compare with.
roles (tuple[str, ...]) – Model roles to compare. Defaults to the models whose values an orbital state stores (field, atmosphere, ephemeris).
- Returns:
True if every compared model is equivalent.
- Return type:
bool
- to_json()[source]¶
Serialize model names and JSON-safe settings for worker processes.
Custom models must implement
to_json_config()and a classmethodfrom_json_config(config). No model instances or binary handles cross the process boundary.- Return type:
str
- STATE_MODEL_ROLES = ('magnetic_field', 'atmosphere', 'ephemeris')¶
Models whose sampled values an
Orbital_Statestores (B, rho, S).
- property magnetic_model: str¶
Return the selected magnetic model’s canonical name.
Built-in models return the name used by legacy string selectors. A user model without a
namereturns its class name.- Returns:
Model identifier.
- Return type:
str