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: object

Models used to evaluate one orbit’s environmental quantities.

The orbit samples these models; Orbital_State carries the sampled values to sensors, actuators, disturbances, and the attitude integrator. Custom atmosphere and ephemeris implementations can also be supplied here.

Parameters:
classmethod from_json(serialized)[source]

Rebuild an environment from to_json() in a worker process.

Parameters:

serialized (str)

Return type:

Environment

same_models(other, roles=('magnetic_field', 'atmosphere', 'ephemeris'))[source]

Whether other uses equivalent models for every role in roles.

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 classmethod from_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_State stores (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 name returns its class name.

Returns:

Model identifier.

Return type:

str

ADCS.environment.environment.default_environment()[source]

Return the lazily created process-wide default model set.

Return type:

Environment