ecpi.common.instru.array_convention module¶
Section author: ECLAIRs GP team
Array convention to pass indices to cell positions
ECLAIRs general program pipeline convention (yzegp) of 2D array:¶
yzegp used cartesian convention where :
first coordinate is the position on horizontal axis, same as y axis in ECL_Los frame defined by CNES
second coordinate is the position on vertical axis, same as z axis in ECL_Los frame defined by CNES
so shield ECLAIRs is at the bottom and origin of epg is always in left corner
the value is associated to “pixel” that has the lower left corner at (y,z)
Note
Cartesian convention is use everywhere in ecpi library. Mainly used with class ArraySquareCell
to define sub-mask and detector geometry InstruECLAIRs in ECL_Los frame
example : a_epg[1,2] = 1
z axis (same direction that z_ECCLos)
^
|
|
3 + +-+
| |1|
2 + +-+
|
1 +
|
0 +-+-+-+----> y axis (same direction that y_ECCLos)
0 1 2 3
+---------------------+
| SHIELD ECLAIRs |
+---------------------+
ijDet convention of 2D array:¶
ijDet used row, column convention where :
‘i’ first coordinate is the row number along direction like z axis in ECLLos frame defined by CNES
‘j’ second coordinate is the column number along direction like inverse of y axis in ECLLos frame defined by CNES
so shield ECLAIRs is at the bottom and origin of ijDet is always in right corner
Example : a_epg[1,2] = 1
i
^
| 2
+-+ +
|1| | 1
+-+ +
| 0
j <----+-+-+-+
2 1 0
+---------------------+
| SHIELD ECLAIRs |
+---------------------+
Note
ijDet is only use for input and output data file requiring an “array detector convention”
Summary¶
Functions:
convert couple index in ijdet convention to yzegp convention |
|
convert array 2D in ijdet convention to yzegp convention |
|
convert array 2D in ijdet convention to yzegp convention |
|
|
|
|
|
convert couple index in yzegp convention to ijdet convention |
|
convert array 2D in yzegp convention to ijdet convention |
Reference¶
-
ijdet_to_yzegp(idet, jdet, idx_max=79)[source]¶ convert couple index in ijdet convention to yzegp convention
- Parameters
idet (integer) – first coordinate of ijdet
jdet (integer) – second coordinate of ijdet
idx_max (integer) – index max (ie MAX-1)
-
ijdet_to_yzegp_array(a_ijdet)[source]¶ convert array 2D in ijdet convention to yzegp convention
- Parameters
a_ijdet (numpy 2D array) – array in ijdet convention
-
ijdet_to_yzegp_array_slow(a_ijdet)[source]¶ convert array 2D in ijdet convention to yzegp convention
- Parameters
a_ijdet (numpy 2D array) – array in ijdet convention
-
plot_ecllos(array_yzegp, mes='')[source]¶ - Parameters
array_yzegp – in ecpi convention (see below)
mes – message for title
-
plot_ijdet(array_yzegp, mes='')[source]¶ - Parameters
array_yzegp – in ecpi convention (see below)
mes – message for title