Skip to content

Define arithmetics and transformations on containers

Arithmetics operations might be implemented on ForEachSC and ForEachMOSA types, such that data processing reads very natural and remains very close to model equations.

E.g.,

isc_carrier_fluctuations = local_isc_carrier_fluctuations - distant_isc_carrier_fluctuations

instead of the complicated current implementation

isc_carrier_fluctuations = ForEachMOSA(lambda mosa:
     local_isc_carrier_fluctuations[mosa] - distant_isc_carrier_fluctuations[mosa]
)

We currently use the following methods in our models:

  • Negation
  • Addition, subtraction, multiplication, division by scalars
  • Addition, subtraction, multiplication, division by object of the same type (MOSA-wise or SC-wise)
  • Power

On top of that, we want to implement some "re-ordering" or transformation operations on ForEachSC:

  • Broadcast to a ForEachMOSA by assigning MOSAs the data associated with the hosting spacecraft

and on ForEachMOSA:

  • Distant
  • Adjacent

The containers might be re-implemented as two-dimensional Numpy arrays for faster computations.

We should also still propose methods to convert indices:

  • Left and right local MOSA given a SC index
  • Left and right distant MOSA given a SC index
  • Spacecraft index given a MOSA index
  • Distant and adjacent MOSA given a MOSA index
Edited by Jean-Baptiste Bayle