ecpi.simu.lib.context module

Section author: ECLAIRs GP team

Class ContextSimulator is a high-level facade design pattern to centralize information and functionality on the ECLAIRs instrument required for the simulation, like:

  • instrument geometry

  • detector effect

  • position and attitude of ECLAIRs

  • earth in FOV

  • range energy

  • time exposure

As this is information needed by many models we use the singleton design pattern to share it. So by default all the elements of the simulator:

work with the singleton GlobalContextSimulator.

Class ObservablePositionChange implemented the observer design pattern for sky sources sensitive to changes of satellite position. This architecture was introduced mainly to account the variation of CXB earth shadowing.

Note

If all the sources become sensitive to changes in the satellite’s position, this structure is no longer relevant and a systematic update would be more appropriate.

Summary

Classes:

ContextSimulator

Common data and functionalities for simulation

GlobalContextSimulator

Singleton version of class ContextSimulator

ObservablePositionChange

Design pattern observer for change of position of satellite

Class diagram:

Reference

class ContextSimulator[source]

Bases: ecpi.simu.lib.context.ObservablePositionChange

Common data and functionalities for simulation

Facade offering the data and common functionalities necessary to implement the simulation of sky sources through the ECLAIRs instrument

Note

From CNES document “SVOM Coordinate SystemsandConventions Document”, CSC-R-4.1-0011:

For SVOM applications, J2000 and GCRF can be considered as identical, J2000 is considered the baseline frame for coordinates

property duration

return duration in s of simulation :type: float

Type

getter

earth_frac()[source]
Returns

fraction (between 0 and 1) of earth in FOV

Return type

float

property earth_limb

size in degree of earth in FOV :type: degree

Type

getter

property earth_pos_fov_unit

return unit vector of earth in FOV :type: [X, Y, Z]

Type

getter

property eclairs_attitude

return object attitude of ECLAIRs instrument :type: AttitudeECLAIRs

Type

getter

property energy_range

return min max in keV of current energy channel :type: float, float

Type

getter

property idx_chan

return current energy channel index :type: int

Type

getter

is_in_fov()[source]
Returns

True if earth is in FOV

Return type

bool

property mdl_effect

return object of instrument effect :type: ECLAIRsDetectorEffect

Type

getter

open_fov_map()[source]
Returns

Open FOV map

Return type

numpy array

property pos_sat

position of SVOM in km in J2000 :type: [X, Y, Z]

Type

getter

set_duration(duration)[source]
Parameters

duration (float) – simulation time in s

set_idx_chan(num_chan)[source]

Set energy channel index

Parameters

idx_chan (int) – energy channel index

set_mdl_effect(mdl_effect)[source]
Parameters

mdl_effect (ECLAIRsDetectorEffect) – object defined instrument effect

set_pos_sat(pos)[source]

Change the position of SVOM satellite and call method update() for all sky recorded sources with add_observer()

Parameters

pos (array 3 float) – satellite position in km in J2000 frame

set_quaternion_svom(quater)[source]

Calculates the attitude of the ECLAIRs instrument with the attitude of the SVOM satellite.

Parameters

quater ([q0, q1, q2, q3]) – quaternion defined attitude of SVOM satellite

set_sim_geom(sim_pts)[source]
Parameters

sim_pts (TBD) – TBD

set_t_start(t_start)[source]
Parameters

t_start (float) – start time of the simulated observation in s from mjdref

property t_start

return time start of simulation

Type

getter

class GlobalContextSimulator(*args, **kargs)[source]

Bases: ecpi.simu.lib.context.ContextSimulator

Singleton version of class ContextSimulator

instance = None
reset_all()[source]

Reset all observers and initialize instrument effect with default object

reset_detec_effect()[source]

Initialize instrument effect with default object

Note

Some tests reduce channel or modify attribut _mdl_effect

reset_observer()[source]

Reset all observers of satellite position change

class ObservablePositionChange[source]

Bases: object

Design pattern observer for change of position of satellite

add_observer(observer)[source]

Add observer interested in a change of position of satellite

Parameters

observer (AbstractModelSrc) – Instance of model source

del_observer(observer)[source]

Delete observer from the list

Parameters

observer (AbstractModelSrc) – Instance of model source

notify_observer()[source]

Notify all observer that position of satellite change