# irfpy.vels.bible.gfactor¶

Module for g-factor.

G-factor, well, not simple.

But for simplicity, use gfactor().

>>> print('%.2e' % gfactor(3021, 5))   # Return the g-factor of 3021 eV for CH-5
7.40e-06
>>> print('%.2e' % gfactor(3021, 10))   # Return the g-factor of 3021 eV for CH-5
8.09e-06


The unit is cm2 sr eV/eV.

The module refers to table 6 in VEX/ELS bible (see lab_gfactor()). They are fitted using a linear function, and the fitted function will be returned from gfactor_func(). The returned function is the function to the energy. gfactor() is the simple way of getting the g-factor for the specified energy and the anode. This is the way that the VEX/ELS bible recommends.

irfpy.vels.bible.gfactor.lab_gfactor()[source]

Return 4 energy and 4 x 16 element np.array g-factor cm2 sr eV/eV. Table 6 in VEX/ELS bible.

irfpy.vels.bible.gfactor.lab_loggfactor()[source]
irfpy.vels.bible.gfactor.gfactor_fit_func(x, y)[source]
irfpy.vels.bible.gfactor.gfactor_func(anode, above=True)[source]

Return the g-factor as a function of energy.

You can get g-factor from this function. The function returns the g-factor of the specified anode.

Parameters

anode – The anode number

Returns

A function of the g-factor in the unit of cm2 sr eV/eV

Return type

function

>>> g0 = gfactor_func(0)   # Return the function of g-factor of CH-0
>>> print('%.1e' % g0(1000))   # 1 keV g-factor.
1.1e-05


According to the VEX/ELS bible, the g-factor should be get via the fitting of the laboratory data (lab_gfactor()).

The method will return the function (energy dependence) of the g-factor.

irfpy.vels.bible.gfactor.gfactor(energy, anode)[source]

Simplest g-factor accessor. Return the g-factor in the unit of cm2 sr eV/eV.

Parameters
• energy – Energy in eV.

• anode – Anode id, 0 to 15.

Returns

G-factor in the unit of cm2 sr eV/eV

For example, you can ge the g-factor for 10, 100 and 1000 eV for anode 3 as follows.

>>> print('%.3e' % gfactor(10, 3))
7.344e-06
>>> print('%.3e' % gfactor(100, 3))
8.371e-06
>>> print('%.3e' % gfactor(1000, 3))
9.579e-06

irfpy.vels.bible.gfactor.gfactor1d(energies, anode)[source]

Simplest g-factor accessor, with multiple dimensional version, in cm2 sr eV/eV.

Parameters
• energies – Energies in eV. Any shape of array

• anode – Anodes. 0 to 15 (inclusive), integer.

Returns

Gfactor.

Gfactor returned also have the same shape as energies.

>>> g = gfactor1d([10., 100., 1000.], 3)    # Gfactor of 10, 100 and 1000 eV for anode 3
>>> print('%.3e' % g)
7.344e-06
>>> print('%.3e' % g)
8.371e-06
>>> print('%.3e' % g)
9.579e-06