ADCS.helpers.animations.godot.schema module

Channel registry for the adcs-vizlog format, version 1.

The normative description lives in docs/source/viz/vizlog_v1.rst. This module only depends on the standard library so that the format definition can be read, and ported to other languages, without the rest of ADCS.

class ADCS.helpers.animations.godot.schema.Channel(name, width, unit, frame, required=False, description='', labels=None, provenance=None)[source]

Bases: object

One time-series column of a vizlog run.

Stored as little-endian float64, row-major, shape (n_rows, width).

Parameters:
  • name (str) – Channel name; also its file stem (<name>.f64).

  • width (int) – Values per row.

  • unit (str) – Physical unit ("-" if dimensionless).

  • frame (str) – Frame the values are expressed in, or "-".

  • required (bool) – Whether every vizlog must contain it.

  • description (str) – Human-readable meaning.

  • labels (List[str] | None) – Optional per-column labels (length width).

  • provenance (str | None) – Optional note on how the values were obtained.

classmethod from_json(data)[source]
Parameters:

data (Dict[str, Any])

Return type:

Channel

to_json()[source]
Return type:

Dict[str, Any]

description: str = ''
frame: str
labels: List[str] | None = None
name: str
provenance: str | None = None
required: bool = False
unit: str
width: int
ADCS.helpers.animations.godot.schema.channel_spec(name, width=None, **overrides)[source]

Look up a registered channel, filling in a per-log width if needed.

Unregistered names with a family prefix are allowed: sensor_ (one per attitude sensor; give width and unit), joint_ (an articulated part’s angle, rad, width 1) and user_ (anything else the caller adds; give width).

Parameters:
  • name (str) – Channel name.

  • width (int | None) – Width for variable-width channels (registry width 0).

  • overrides (Any) – Fields to replace, e.g. labels or provenance.

Returns:

The channel description.

Raises:
  • KeyError – If the name is neither registered nor a sensor channel.

  • ValueError – If a variable-width channel is given no width, or a fixed-width channel a different one.

Return type:

Channel

ADCS.helpers.animations.godot.schema.OPTIONAL_CHANNELS: Dict[str, Channel] = {'b_field': Channel(name='b_field', width=3, unit='T', frame='GCRS', required=False, description='geomagnetic field at the spacecraft', labels=None, provenance=None), 'boresight_body': Channel(name='boresight_body', width=3, unit='-', frame='BODY', required=False, description='boresight of the active goal', labels=None, provenance=None), 'h_rw_body': Channel(name='h_rw_body', width=3, unit='N m s', frame='BODY', required=False, description='total wheel momentum as a body vector (sum h_i a_i)', labels=None, provenance=None), 'h_wheel': Channel(name='h_wheel', width=0, unit='N m s', frame='-', required=False, description='wheel momentum relative to the body, per wheel', labels=None, provenance=None), 'pointing_err': Channel(name='pointing_err', width=1, unit='rad', frame='-', required=False, description='angle between attitude and active goal', labels=None, provenance=None), 'q_est': Channel(name='q_est', width=4, unit='-', frame='-', required=False, description='estimated q_gcrs_body', labels=None, provenance=None), 'q_jupiter_gcrs': Channel(name='q_jupiter_gcrs', width=4, unit='-', frame='-', required=False, description='jupiter body-to-GCRS orientation', labels=None, provenance=None), 'q_mars_gcrs': Channel(name='q_mars_gcrs', width=4, unit='-', frame='-', required=False, description='mars body-to-GCRS orientation', labels=None, provenance=None), 'q_mercury_gcrs': Channel(name='q_mercury_gcrs', width=4, unit='-', frame='-', required=False, description='mercury body-to-GCRS orientation', labels=None, provenance=None), 'q_moon_gcrs': Channel(name='q_moon_gcrs', width=4, unit='-', frame='-', required=False, description='Moon body-to-GCRS orientation', labels=None, provenance=None), 'q_neptune_gcrs': Channel(name='q_neptune_gcrs', width=4, unit='-', frame='-', required=False, description='neptune body-to-GCRS orientation', labels=None, provenance=None), 'q_saturn_gcrs': Channel(name='q_saturn_gcrs', width=4, unit='-', frame='-', required=False, description='saturn body-to-GCRS orientation', labels=None, provenance=None), 'q_sun_gcrs': Channel(name='q_sun_gcrs', width=4, unit='-', frame='-', required=False, description='Sun body-to-GCRS orientation', labels=None, provenance=None), 'q_uranus_gcrs': Channel(name='q_uranus_gcrs', width=4, unit='-', frame='-', required=False, description='uranus body-to-GCRS orientation', labels=None, provenance=None), 'q_venus_gcrs': Channel(name='q_venus_gcrs', width=4, unit='-', frame='-', required=False, description='venus body-to-GCRS orientation', labels=None, provenance=None), 'r_est': Channel(name='r_est', width=3, unit='km', frame='GCRS', required=False, description='estimated spacecraft position', labels=None, provenance=None), 'r_jupiter': Channel(name='r_jupiter', width=3, unit='km', frame='GCRS', required=False, description='geocentric jupiter position', labels=None, provenance=None), 'r_mars': Channel(name='r_mars', width=3, unit='km', frame='GCRS', required=False, description='geocentric mars position', labels=None, provenance=None), 'r_mercury': Channel(name='r_mercury', width=3, unit='km', frame='GCRS', required=False, description='geocentric mercury position', labels=None, provenance=None), 'r_moon': Channel(name='r_moon', width=3, unit='km', frame='GCRS', required=False, description='apparent geocentric Moon position', labels=None, provenance=None), 'r_neptune': Channel(name='r_neptune', width=3, unit='km', frame='GCRS', required=False, description='geocentric neptune position', labels=None, provenance=None), 'r_saturn': Channel(name='r_saturn', width=3, unit='km', frame='GCRS', required=False, description='geocentric saturn position', labels=None, provenance=None), 'r_uranus': Channel(name='r_uranus', width=3, unit='km', frame='GCRS', required=False, description='geocentric uranus position', labels=None, provenance=None), 'r_venus': Channel(name='r_venus', width=3, unit='km', frame='GCRS', required=False, description='geocentric venus position', labels=None, provenance=None), 'rho': Channel(name='rho', width=1, unit='kg/m^3', frame='-', required=False, description='atmospheric density', labels=None, provenance=None), 'sunlit_binary': Channel(name='sunlit_binary', width=1, unit='-', frame='-', required=False, description='eclipse flag the simulation used (1 sunlit, 0 eclipse)', labels=None, provenance=None), 'target': Channel(name='target', width=4, unit='mixed', frame='GCRS', required=False, description='kind 1: [nan, unit dir]; 2: q_gcrs_body target; 3: [nan, position km]', labels=None, provenance=None), 'target_kind': Channel(name='target_kind', width=1, unit='-', frame='-', required=False, description='goal encoding, see TARGET_KIND', labels=None, provenance=None), 'tau_act_body': Channel(name='tau_act_body', width=3, unit='N m', frame='BODY', required=False, description='total actuator torque', labels=None, provenance=None), 'tau_dist_body': Channel(name='tau_dist_body', width=3, unit='N m', frame='BODY', required=False, description='total disturbance torque', labels=None, provenance=None), 'u_cmd': Channel(name='u_cmd', width=0, unit='mixed', frame='-', required=False, description='actuator commands in satellite.actuators order (MTQ A m^2, RW N m)', labels=None, provenance=None), 'v_est': Channel(name='v_est', width=3, unit='km/s', frame='GCRS', required=False, description='estimated spacecraft velocity', labels=None, provenance=None), 'w_est': Channel(name='w_est', width=3, unit='rad/s', frame='BODY', required=False, description='estimated angular velocity', labels=None, provenance=None), 'w_target': Channel(name='w_target', width=3, unit='rad/s', frame='GCRS', required=False, description='target angular velocity', labels=None, provenance=None), 'wheel_speed': Channel(name='wheel_speed', width=0, unit='rad/s', frame='-', required=False, description='wheel spin rate relative to the body, per wheel', labels=None, provenance=None)}

Optional channels. width of 0 means it is set per log (e.g. number of wheels).

ADCS.helpers.animations.godot.schema.REQUIRED_CHANNELS: Dict[str, Channel] = {'q_gcrs_body': Channel(name='q_gcrs_body', width=4, unit='-', frame='-', required=True, description='attitude; sign chosen for continuity with the previous row', labels=None, provenance=None), 'q_itrs_gcrs': Channel(name='q_itrs_gcrs', width=4, unit='-', frame='-', required=True, description='Earth orientation (GCRS to ITRS)', labels=None, provenance=None), 'r_sc': Channel(name='r_sc', width=3, unit='km', frame='GCRS', required=True, description='spacecraft position', labels=None, provenance=None), 'r_sun': Channel(name='r_sun', width=3, unit='km', frame='GCRS', required=True, description='apparent geocentric Sun position', labels=None, provenance=None), 'shadow_factor': Channel(name='shadow_factor', width=1, unit='-', frame='-', required=True, description='visible fraction of the solar disk (conical model, 0..1)', labels=None, provenance=None), 't_s': Channel(name='t_s', width=1, unit='s', frame='-', required=True, description='TT seconds since manifest epoch', labels=None, provenance=None), 'v_sc': Channel(name='v_sc', width=3, unit='km/s', frame='GCRS', required=True, description='spacecraft velocity', labels=None, provenance=None), 'w_body': Channel(name='w_body', width=3, unit='rad/s', frame='BODY', required=True, description='angular velocity of BODY relative to GCRS', labels=None, provenance=None)}

Channels every vizlog run contains. width is fixed.

ADCS.helpers.animations.godot.schema.TARGET_KIND = {'direction': 1, 'none': 0, 'position': 3, 'quaternion': 2}

Encoding of the target_kind channel.