irfpy.cena.gfactor
¶
An implementation of CENA g-factor.
G-Factor implementation according to the section 3.5 of the calibration report.
The implementation is done in GFactorH
class.
But this is somehow a test purpose, so the class will be re-implemented some day.
There are two implementations.
GFactorH_Table
starts with a tabulared G_i in Table 3.5 in the calibration report.
GFactorH_Component
starts with a calculation from component-based parameters.
One can start from
from irfpy.cena.gfactor import GFactorH_Table as GFactorH
or
from irfpy.cena.gfactor import GFactorH_Component as GFactorH
Warning
Apart from the updated definition in 3.19 in calibration report i1r2, the dead time is in the g-factor.
It concerns the class:GFactorH_Component. Also, to calculate the flux, you must use dt=0.5 sec.
- class irfpy.cena.gfactor.GFactorH_Base[source]¶
Bases:
object
An base class of GFactor classes.
This is an abstract class. Derived classes should implement
energyDependentGfactor()
(\(G_{n,i}\)).Constructor.
- G_n_i(sigma=0)[source]¶
Alias to
geometricFactor()
.
- G_i(sigma=0)[source]¶
Alias to
energyDependentGfactor()
.
- energyDependentGfactor(sigma=0)[source]¶
Return the energy dependent g-factor. (Abstract class)
Override this method in the subclass.
- geometricFactor(sigma=0)[source]¶
Return the g-factor.
The g-factor is a kind of conversion factor between the differential flux, J, and the counts, C.
Here, we denote \(J_{n,i}^{H}\) [#/cm^2 sr eV s] is the differential number flux seen by each sector n and energy step i for hydrogen ENA. The corresponding count rate, \(C_{n,i}^{H}\) [#] is calculated by
\[C_{n,i}^{H} = J_{n,i}^{H} \cdot G_{n,i}^{H} \cdot E_i \cdot \Delta t\]as in (3.15).
- param sigma
You can give an error parameter \(\sigma\).
- type sigma
float
- returns
geometric factor as a
numpy.ma.masked_array
. The dimension is [i=16][n=7]- rtype
Instance of
numpy.ma.masked_array
with dimensions of [i=16][n=7].
Usage
>>> gfH = GFactorH_Table() >>> gf = gfH.geometricFactor() >>> gf.shape (16, 7)
> print '%.1e' % gf[8][3] 5.8e-07 # While this method returns 6.6e-07 ...
Note Indeed, the calculated value is different by about 10% from the calibration report. Last column in Table 3.5 shows the gf[3][:], but the values are different….
Todo
The g-factor related classes is an objective of reimplementation. The inconsist g-factors in the calibration report.
cena_flux class also should be re-implemented.
- class irfpy.cena.gfactor.GFactorH_Table[source]¶
Bases:
irfpy.cena.gfactor.GFactorH_Base
An implementation of G-factor for hydrogen ENA.
This is based on section 3.5.2 in the calibration report.
For developer
The class is low-level class. Thus, in the near future, more high-level methods may be needed. However, so far I used this low-level class also for ebugging purpose. Thus, the class itself would also needed to be re-implemented.
Constructor.
- energyDependentGfactor(sigma=0)[source]¶
Return the energy dependent g-factor.
The energy dependent g-factor for \(H^0\), \(G_i^H\), is listed in
Table 3.5
. There are uncertainty of factor 3, corresponding to \(1\sigma\).- param sigma
You can give a error parameter \(\sigma\). For default value (
None
), central value of g-factor will be returned. If you give +1, the g-factor becomes 3 times larger than the default according to the uncertainty. If you give -1, the g-factor becomes 3 times smaller than the default.- type sigma
float
- returns
Energy depenent g-factor, as an array of 16 elements. Each index corresponds to the generic energy steps. (See also
irfpy.cena.energy
) However, the data is only available for 4 to 11. Thus, the unavailable element is a masked numpy array.- rtype
numpy.ma.masked_array
>>> gf = GFactorH_Table() >>> g_i_H = gf.energyDependentGfactor() >>> numpy.ma.is_masked(g_i_H[0]) True >>> numpy.ma.is_masked(g_i_H[5]) False
>>> print((g_i_H[8])) 4.5e-05
>>> g_i_H_lower = gf.energyDependentGfactor(sigma=-1) >>> print('%.2f' % (g_i_H_lower[5]/g_i_H[5])) 0.33 >>> g_i_H_upper = gf.energyDependentGfactor(sigma=1) >>> print('%.2f' % (g_i_H_upper[5]/g_i_H[5])) 3.00
- class irfpy.cena.gfactor.GFactorH_Component[source]¶
Bases:
irfpy.cena.gfactor.GFactorH_Base
Another implementation of G-factor for hydrogen ENA.
This is based on section 3.5.2 in the calibration report. The energy dependent geometric factors are calculated from scratch.
For developer
The class is low-level class. Thus, in the near future, more high-level methods may be needed. However, so far I used this low-level class also for ebugging purpose. Thus, the class itself would also needed to be re-implemented.
Constructor.
- energyDependentGfactor(sigma=0)[source]¶
Return the energy dependent g-factor.
The energy dependent g-factor for \(H^0\), \(G_i^H\), is listed in
Table 3.5
. However, the values are inconsistent with those calculate from the equations.Apaart from the inconsistency, There are uncertainty of factor 3, corresponding to \(1\sigma\).
- param sigma
You can give a error parameter \(\sigma\). For default value (
None
), central value of g-factor will be returned. If you give +1, the g-factor becomes 3 times larger than the default according to the uncertainty. If you give -1, the g-factor becomes 3 times smaller than the default.- type sigma
float
- returns
Energy depenent g-factor, as an array of 16 elements. Each index corresponds to the generic energy steps. (See also
irfpy.cena.energy
) However, the data is only available for 4 to 11. Thus, the unavailable element is a masked numpy array.- rtype
numpy.ma.masked_array
>>> gf = GFactorH_Component() >>> g_i_H = gf.energyDependentGfactor() >>> numpy.ma.is_masked(g_i_H[0]) False >>> numpy.ma.is_masked(g_i_H[5]) False
>>> print(('%.2e' % g_i_H[8])) 4.38e-05
>>> g_i_H_lower = gf.energyDependentGfactor(sigma=-1) >>> print('%.2f' % (g_i_H_lower[5]/g_i_H[5])) 0.33 >>> g_i_H_upper = gf.energyDependentGfactor(sigma=1) >>> print('%.2f' % (g_i_H_upper[5]/g_i_H[5])) 3.00
Definition of energy dependent g-factor
From equation 3.19 in calibration report, \(G_i^H\) is defined as
\[ \begin{align}\begin{aligned}G_i^H = \sigma{\cdot}A{\cdot}e_{i,H}{\cdot}\frac{\Delta E_i}{E_i}\\\sigma = T_1{\cdot}T_2{\cdot}r_{CS}{\cdot}\eta_{START}{\cdot} \eta_{MCP}{\cdot}\eta_{TOF}{\cdot}(1-\frac{t_D}{t_{SLOT}})\\A = 1.09 \textrm{cm}^2\end{aligned}\end{align} \]
- class irfpy.cena.gfactor.GFactorParams[source]¶
Bases:
object
- getSectorSensitivity()[source]¶
Returns the sector sensitivities.
Sensitivity depends on the sector of interest. This method returns the sensitivities, \(s_n\). Returned is 7-element
numpy.array
, which is listed inTable 3.4
in the calibration report.
- s_n()¶
Alias to
getSectorSensitivity()
.
- centralPixelsSensitivity()[source]¶
Return the sensitivity of the sector 2-3-4.
It is sometimes worth to consider the sectors 2-3-4 is a single sector. This method returns the sensitivity of this aggregated sector.
See also
sectorSensitivity()
.
- s_234()¶
Alias to
centralPixelsSensitivity()
- getTransparencyGrid1()[source]¶
Returns the first grid transparency, T1
This is geometrically defined. T1 = 0.88 (see calibration report)
- T1()¶
Alias to
getTransparencyGrid1()
- getTransparencyGrid2()[source]¶
Returns the second grid transparency, T2
This is geometrically defined. T2 = 0.88 (see calibration report)
- T2()¶
Alias to
getTransparencyGrid2()
- getCollectionEfficiencyCS()[source]¶
Returns the collection efficiency of wave system from CS.
Collection efficiency of wave system from conversion surface, r_CS is 0.7
- rcs()¶
Alias to
getCollectionEfficiencyCS()
.
- getPositiveIonYieldCS(energy_in_eV)[source]¶
Returns the positive ion yield at CS.
Positive ion yield at the conversion surface is taken from Wieser et al. 2002. The value depends on the energy of the impinging particle.
- param energy_in_ev
Energy of particle in eV
- type energy_in_ev
float
- returns
The yield
- rtype
float
- eta_i_H_plus(energy_in_eV)¶
Alias to
getPositiveIonYieldCS()
.
- eta_start()¶
Alias to
getStartMcpEfficiency()
.
- getStartMcpEfficiency()[source]¶
TOF efficiency.
Defining factors are found correted rate and start rate fro inflight data. Using 2.1 kV start MCP bias, the quantiy is defined to be 0.15
- eta_mcp()¶
Alias to
getStartMcpEfficiency()
- eta_tof()¶
Alias to
getTofEfficiency()
.
- A()¶
Alias to
getOpenAperture()