Source code for irfpy.swim.SwimGfact

''' SWIM G-factor module.

Current version of SWIM G-Factor is based on a draft calibration report in July 2009.
Error bar is not supported.
'''
import logging

[docs]def getSimpleAbsG0(): ''' For testing softwares and quick browsing data purposes, very rough approximation of absolute g-factor [cm^2 sr eV/eV] multiplied by efficency is implemented. Get an approximated absolute g-factor * efficiency for SWIM is returned. Scalar value of 5e-5 is returned. This is NOT for the use of serious scientific purpose. ''' return 5e-5
[docs]class gfactor: ''' Class of gfactor. Gfactor class as a kind of testing purpose. ''' __version__='1' def __init__(self): ''' A constructor of g-factor class. ''' logging.debug('Gfactor for SWIM. Version %s.'%self.__version__)
[docs] def getAbsG0(self): ''' Obtain absolute geometric factors (G0) for H+. G0 is calculated in three energy: 500, 1300 and 3000 eV. G0[0] is for 500 eV, G0[1] is for 1300 eV, and G0[2] is for 3000 eV. The unit is in [cm^2 sr eV/eV]. Data is from Table 3.9 in draft calibration report in July 2009. @retval A tuple of absolute geometric factor in cm^2 sr eV/ev. ''' return (5.54e-5, 5.37e-5, 4.29e-5)
[docs] def getRelatG(self): ''' Obtain relative geometric factor for start counter (and coincidence event) for H+. Relative g-factor depending of directions. Data is from Table 3.8 in draft calibration report in July 2009. @retval A tuple of relative geometric factor. ''' return (0.33, 0.52, 0.69, 0.84 , 0.90, 0.84, 1.00, 0.85, 0.81, 0.91, 0.74, 0.77, 0.65, 0.77, 0.43, 0.71) ### 6H is not described in the document... So I guess it from picture.
[docs] def getAbsGProtonStart(self): ''' Obtain absolute geometric factor (G(n)) for start surface for proton. Returns a tuple of abosolute gfactor depending on energy and on direction. @retval A 2-D tuple of absolute geometric factor for start surface for proton in cm^2 sr eV/eV. ''' abs=self.getAbsG0() rel = self.getRelatG() g=[] for g0 in abs: ge = [] for gr in rel: ge.append(g0*gr) g.append(ge) return tuple(g)