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:

SimuECLAIRsMaskProjection

Simulation with geometric method square intersection

SimuInstruXBase

Generic simulation of X instrument coded mask

Class diagram:

Functions:

projection_mask_numba

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.SimuInstruXBase

Simulation with geometric method square intersection

get_det_pixel_surface()[source]
get_proj_mask()[source]
get_proj_sub_mask()[source]
get_shadow_apparent_surface(elev, direc)[source]

Return apparent surface

get_shadow_percent(elev, direc)[source]
get_shadow_surface(elev, direc)[source]
plot_proj_mask(p_title='')[source]
simu_catalog(time_expose, verbose=False)[source]
class SimuInstruXBase[source]

Bases: object

Generic 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_det_pixel_surface()[source]
get_shadowgram()[source]
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)

plot_shadowgram()[source]
raz_nb_photon()[source]
save_cal_evts(filename, t_start=0, l1=False)[source]

t_start in s from mjdref

save_catal_log(filename)[source]

save a fits log file of the simulation of each source

save_evts(filename, t_start=<Time object: scale='tt' format='isot' value=2018-06-16T14:37:07.000>)[source]
save_mask(name_fits)[source]
save_stack_evt_image(name_fits)[source]
set_catalog(catalog_x: ecpi.common.sky.catalog.CatalogFovBasic)[source]
simu_catalog(time_expose, verbose=None)[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 ArraySquareCell but 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