ecpi.simu.lib.instru_x module
Section author: ECLAIRs GP team
Instrument simulation module of point source .. note:: TODO need to be update
Summary
Classes:
Simulation with geometric method square intersection |
|
Generic simulation of X instrument coded mask |
Class diagram:
Functions:
Projection of sub-mask on detector with numba library in ECL_Los. |
Reference
- class SimuECLAIRsMaskProjection(catalog_x: Optional[ecpi.common.sky.catalog.CatalogFovBasic] = None, p_nb_pixel=None)[source]
Bases:
ecpi.simu.lib.instru_x.SimuInstruXBaseSimulation with geometric method square intersection
- class SimuInstruXBase[source]
Bases:
objectGeneric simulation of X instrument coded mask
- add_all_evt(apos)[source]
Add one on pixel associated to position
- Parameters
apos (numpy array (n,2)) – array plan position of photon
- add_cxb(cxb_eclairs_level=1)[source]
- Parameters
cxb_eclairs_level (float [count/cm2/s]) – intensity of CXB
- get_cxb(cxb_eclairs_level=1, cxb_type='flat_nospectr', internal_noise=False, noise_level=0.003)[source]
OBSOLETE METHOD
- get_snr_sources(shadowgram_tot=None)[source]
compute the theoretical max snr of each source. Takes into account the mask is partially coded. SNRs are listed in the order of the sources catalog
- Parameters
shadowgram_tot (array(float)) – final shadowgram (default=from the simu object)
- Returns
list of the snr of each source
- Return type
list(float)
- save_evts(filename, t_start=<Time object: scale='tt' format='isot' value=2018-06-16T14:37:07.000>)[source]
- set_catalog(catalog_x: ecpi.common.sky.catalog.CatalogFovBasic)[source]
- projection_mask_numba(sub_mask, det_surf_out, rect_proj, max_p_mask, max_p_det, size_p_mask, size_p_det, trans_mask, trans_det)[source]
Projection of sub-mask on detector with numba library in ECL_Los. Return array detector with surface (in cm^2) illuminated by the source
Note
numba version of method get_proj_sub_mask() as function
Algo:
rect_proj is rectangle of intersection between sub-mask and detector in ECL_Los: RI
Find index array of mask in RI: mask_idx
loop on pixel mask PM in mask_idx
if PM isn’t open pass to next pixel mask
Find index array of detector in PM
loop on pixel detector PD in PM
compute surface intersection between PM and PD
add it to det_surf_out[PD]
Note
Index to physical position and inverse usually is performed by class
ArraySquareCellbut in numba function we can’t used python class, so we rewrite it ..- Parameters
sub_mask (array 2D) – just sub-mask value. Open pixel is 1
det_surf_out (array 2D) – output of the function, array detector surface illuminated in cm^2
rect_proj ([[x_lb, y_lb], [x_ru, y_ru]] lb: left bottom, ru: right upper in cm) – rectangle of intersection between sub-mask and detector in ECL_Los
max_p_mask (int) – max index pixel mask
max_p_det (int) – max index pixel detector
size_p_mask (float) – size mask pixel in cm
size_p_det (float) – size detector pixel in cm
trans_mask (vector 2D) – vector between the origin of the index of mask towards the origin ECL_Los
trans_det (vector 2D) – vector between the origin of the index of detector towards the origin ECL_Los