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:
derived class of
AbstractModelSrc
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:
Common data and functionalities for simulation |
|
Singleton version of class ContextSimulator |
|
Design pattern observer for change of position of satellite |
Class diagram:
Reference
- class ContextSimulator[source]
Bases:
ecpi.simu.lib.context.ObservablePositionChangeCommon 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
- 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
- property mdl_effect
return object of instrument effect :type: ECLAIRsDetectorEffect
- Type
getter
- property pos_sat
position of SVOM in km in J2000 :type: [X, Y, Z]
- Type
getter
- 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 withadd_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_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.ContextSimulatorSingleton version of class ContextSimulator
- instance = None
- class ObservablePositionChange[source]
Bases:
objectDesign 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