irfpy.mima.gfactor0

Geometric factors for MEX/IMA.

Note

Among a lot of definitions of geometric factor, the current best knowledge of MEX/IMA at IRF is to use gfactor_func(). This is used for the official data archiving at PSA.

It is not straightforward, both theoretically and practically.

Here are some implementations, but carefully assess and use when you use them.

The current best proposal of the geometric factor for MEX IMA is only to use gfactor_func().

class irfpy.mima.gfactor0.GL_CR4[source]

Bases: object

Geometric factor defined in MEX-ASP-CR-0004.

P22 gives us impression on some values of g-factor.

This is \(G_0/\Delta\Phi\) [cm2 rad eV/eV].

I am not very sure what the absolute value indicate here, but the relative value should at least be meaningful.

>>> gl_h0 = GL_CR4.Proton.PAC0()
>>> print(gl_h0([0, 2000, 5000, 10000, 30000]))    
[0.00000000e+00 1.55148151e-07 4.89672821e-06 4.48326188e-05
 4.48326188e-05]
class Proton[source]

Bases: object

class PAC0[source]

Bases: object

class PAC1[source]

Bases: object

class PAC2[source]

Bases: object

class Alpha[source]

Bases: object

class PAC0[source]

Bases: object

class PAC1[source]

Bases: object

class PAC2[source]

Bases: object

class irfpy.mima.gfactor0.GL_extra[source]

Bases: object

Geometric factor (GL) in IMA extra.

Simplest way is to use the get() function.

>>> gl = GL_extra.get('Proton', 0, 4)    # PROM section 0 and PAC4 for proton.
>>> print(gl.shape)
(96,)
>>> print(gl[0], gl[10], gl[80], gl[95])
5.218046635641179e-06 8.392430885762372e-06 0.0 0.0

You can also get GL for arbitrary energy levels.

>>> gl_h0 = GL_extra.Proton.PAC0()
>>> print(gl_h0([0, 2000, 5000, 10000, 30000]))  
[             inf   6.59448303e-06   4.66195441e-06   3.58619490e-06
   2.36620604e-06]

NOTE that the PACC0 is not well calibrated but not frequently used :)

classmethod get(species, eeprom, pacc)[source]

Return the GL factor for the given EEPROM channel and PACC.

Parameters
  • species (str) – Either of ‘Proton’, ‘Ghost’, ‘Alpha’, or ‘Heavy’

  • eeprom – PROM/EEPROM section. Integer from 0 to 16.

  • pacc – PACC index. Integer from 0 to 6. (Only 0, 4, 7 supported)

Returns

Table of gl factor, with a unit of cm2 rad eV/eV

class Heavy[source]

Bases: object

class PAC0[source]

Bases: object

class PAC1[source]

Bases: object

class PAC2[source]

Bases: object

class Alpha[source]

Bases: object

class PAC0[source]

Bases: object

class PAC1[source]

Bases: object

class PAC2[source]

Bases: object

class Proton[source]

Bases: object

class PAC0[source]

Bases: object

class PAC1[source]

Bases: object

class PAC2[source]

Bases: object

class ProtonGhost[source]

Bases: object

class PAC0[source]

Bases: object

class PAC1[source]

Bases: object

class PAC2[source]

Bases: object

class irfpy.mima.gfactor0.GF_SWM_draft[source]

Bases: object

Geometric factor used in SWM report, Figure 6 middle. Read from the figure.

The geometric factor used in SWM project.

Warning

Do not use. Use gfactor_func() instead.

Only for H+ and He++. The unit is in cm-2 eV/eV which implies the omega is already multiplied. Only PAC1 (pacclevel4) supported.

class Proton[source]

Bases: object

class PAC1[source]

Bases: object

class ProtonGhost[source]

Bases: object

class PAC1[source]

Bases: object

class Alpha[source]

Bases: object

class PAC1[source]

Bases: object

irfpy.mima.gfactor0.GF_SWM

SWM gfactor, but deprecated. Use gfactor_func().

irfpy.mima.gfactor0.gfactor_func(species, eeprom, pacc)[source]

Geometric factor used in MEX IMA PSA archiving (2021-01-27)

Parameters
  • species – Species. Eitherof [‘heavy’, ‘proton’, ‘alpha’, ‘ghost’]

  • eeprom – Prom sectin number, 0-16.

  • pacc – PACC, either (0, 1, 2)

Returns

Geometric factor in cm2 sr eV/eV.

Raises

ValueError – Given the unsupported species name.

Note

This is the current (2021-01) best knowledge of geometric factor at IRF with the “normal” definition (in cm2 sr eV/eV) including the efficiency.

Provides the G factor [cm2 sr eV/eV] for a species at a specific eeprom and pacc level. Use pacc 0, 1, or 2 (corresponding to 0, 4, 7).

The G-factor is used as follows: diff_flux = counts / (tau[s] * energy[eV] * G) to calculate differential flux of unit [cm-2 s-1 sr-1 eV-1].

This version of the G-factor was used for the MEx IMA PSA archiving project as of 2021-01-27.

>>> from irfpy.mima import gfactor0
>>> gf = gfactor0.gfactor_func('proton', 16, 1)
>>> print(gf.shape)   # GEometric factor for each energy step is returned, so the shape should be (96,)
(96,)
>>> print('{:.2e}'.format(gf[20]))   # Geometric factor for energy step 20
4.12e-06
>>> gf = gfactor0.gfactor_func('oxygen', 16, 2)   # PACC level 2 (=7)
>>> print(gf.shape)
(96,)
>>> print("{:.2e}".format(gf[20]))
7.80e-06