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¶ - Getter
return duration in s of simulation
- Type
float
-
property
earth_limb¶ - Getter
size in degree of earth in FOV
- Type
degree
-
property
earth_pos_fov_unit¶ - Getter
return unit vector of earth in FOV
- Type
[X, Y, Z]
-
property
eclairs_attitude¶ - Getter
return object attitude of ECLAIRs instrument
- Type
-
property
energy_range¶ - Getter
return min max in keV of current energy channel
- Type
float, float
-
property
idx_chan¶ - Getter
return current energy channel index
- Type
int
-
property
mdl_effect¶ - Getter
return object of instrument effect
- Type
-
property
pos_sat¶ - Getter
position of SVOM in km in J2000
- Type
[X, Y, Z]
-
set_idx_chan(idx_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¶ - Getter
return time start of simulation
-
property
-
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
-