''' Unified table definitions
'''
import numpy as np
import irfpy.util.exception as exc
from irfpy.util.sensortable import Table
[docs]class ElevationTable16Geom(Table):
''' Elevation table with a pure geometric FOV shape
This provides the elevation table for linearly separated FoV.
In reality, 2-D elevation table should be used for low energy part.
You may also use :class:`irfpy.mima.fov.SimpleFOV` for data analysis.
'''
version = "1.0"
units = "deg"
def __init__(self):
Table.__init__(self)
self.bnd = -45 + np.arange(17) * 90. / 16.
self.tbl = (self.bnd[1:] + self.bnd[:-1]) / 2.
[docs] def getTable(self):
return self.tbl[:]
[docs] def getBound(self):
return self.bnd[:]
[docs] def getRange(self):
lb = self.bnd[:-1]
ub = self.bnd[1:]
return np.array([lb, ub])
def __str__(self):
return "ElevationTable: SimpleGeometric (v%s)" % self.version
[docs]class ElevationTableFast24s(Table):
''' Elevation table for 24s mode
'''
version = '1.0'
units = 'deg'
def __init__(self):
Table.__init__(self)
self.bnd = np.array([-16.8, -11.2, -5.6, 0, 5.6, 11.2, 16.8])
self.tbl = (self.bnd[1:] + self.bnd[:-1]) / 2.
[docs] def getTable(self):
return self.tbl[:]
[docs] def getBound(self):
return self.bnd[:]
[docs] def getRange(self):
lb = self.bnd[:-1]
ub = self.bnd[1:]
return np.array([lb, ub])
def __str__(self):
return "ElevationTable: Fast24s (v%s)" % self.version
[docs]class EnergyTableProm(Table):
''' Energy table if the IMA sensor is booted from PROM
This table has been used from the beginning of the mission
to March 2007.
Characteristics is that the low-energy is not corectly measured.
In such a case, -1 is returned.
Also, you may refer to the function :func:`irfpy.mima.energy.get_default_table_v4`
'''
version = "1.0"
units = "eV/q"
resolution = 0.07
''' Energy resolution for calculating FWHM (RAnge) '''
def __init__(self):
Table.__init__(self)
self.tbl = np.array([32288.7, 29659.4, 27234.1, 25001.5, 22950.2,
21068.8, 19334.8, 17748.2, 16286.2, 14948.9, 13713.6,
12568.9, 11526.2, 10574.3, 9690.3, 8874.3, 8137.6,
7446.3, 6823.0, 6245.0, 5712.3, 5225.0, 4771.6,
4352.3, 3978.3, 3627.0, 3309.7, 3015.0, 2743.0,
2493.7, 2267.0, 2051.7, 1859.0, 1677.7, 1519.0,
1371.7, 1235.7, 1099.7, 986.3, 884.3, 782.3, 691.7,
612.3, 533.0, 465.0, 397.0, 340.3, 283.7, 227.0,
181.7, 147.7, 102.3, 68.3, 34.3, 0.3, -1.0, -1.0,
-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0,
-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, ])
self.bnd = np.zeros(97) - 1
self.bnd[1:55] = np.sqrt(self.tbl[0:54] * self.tbl[1:55])
self.bnd[55] = 0.01 # Preliminary...
self.bnd[0] = self.bnd[1] / 0.918
[docs] def getTable(self):
return self.tbl[:]
[docs] def getBound(self):
return self.bnd[:]
[docs] def getRange(self):
lb = self.tbl * (1 - self.resolution / 2.)
ub = self.tbl * (1 + self.resolution / 2.)
return np.array([lb, ub])
def __str__(self):
return '''EnergyTableProm: v%s, res=%g''' % (self.version, self.resolution)
[docs]class EnergyTableEEProm0(Table):
''' Energy table if the IMA sensor is booted from EEPROM0
This table has been used after March 2007 (to when? TBC).
Also, you may refer to the function :func:`irfpy.mima.energy.get_default_table_v5`
'''
version = "1.0"
units = "eV/q"
resolution = 0.07
''' Energy resolution for calculating FWHM (RAnge) '''
def __init__(self):
Table.__init__(self)
self.tbl = np.array([25001.5,23018.1,21204.8,19527.5,17986.2,
16558.2,15254.9,14042.2,12931.6,11911.6,10970.9,
10109.6,9304.9,8568.3,7888.3,7265.0,6698.3,6165.6,
5678.3,5225.0,4817.0,4431.6,4080.3,3763.0,3468.3,
3185.0,2935.7,2709.0,2493.7,2289.7,2108.3,1949.7,
1791.0,1655.0,1519.0,1394.3,1292.3,1190.3,1088.3,
1009.0,929.7,850.3,782.3,725.7,669.0,612.3,567.0,
521.7,476.3,442.3,408.3,374.3,340.3,317.7,295.0,
272.3,249.7,227.0,215.7,193.0,181.7,159.0,147.7,
136.3,125.0,113.701,113.7,102.3,92.4,85.1,78.4,72.2,
66.5,61.2,56.4,51.9,47.8,44.0,40.6,37.4,34.4,31.7,
29.2,26.9,24.7,22.8,21.0,19.3,17.8,16.4,15.1,13.9,
12.8,11.8,10.9,10.0])
self.bnd = np.zeros(97) - 1
self.bnd[1:96] = np.sqrt(self.tbl[0:95] * self.tbl[1:96])
self.bnd[0] = self.bnd[1] * 1.086
self.bnd[96] = 9.5
[docs] def getTable(self):
return self.tbl[:]
[docs] def getBound(self):
return self.bnd[:]
[docs] def getRange(self):
lb = self.tbl * (1 - self.resolution / 2.)
ub = self.tbl * (1 + self.resolution / 2.)
return np.array([lb, ub])
def __str__(self):
return '''EnergyTableEEProm0: v%s, res=%g''' % (self.version, self.resolution)
[docs]class EnergyTableFast24s(Table):
''' Energy table for 24s scan, implemented in 2013 Nov.
'''
version = "1.0"
units = "eV/q"
resolution = 0.07
''' Energy resolution for calculating FWHM '''
def __init__(self):
Table.__init__(self)
self.tbl = np.array([4000, 3407.3, 2902.4, 2472.3, 2105.9, 1793.9, 1528.0, 1301.6, 1108.7, 944.4, 804.5, 685.3, 583.7, 497.2, 423.5, 360.8, 307.3, 261.8, 223.0, 189.9, 161.8, 137.8, 117.4, 100.0, 88.8, 77.5, 66.2, 55.0, 43.8, 32.5, 21.2, 10.0])
bounds = np.zeros(33) # 33 bounds for 32 energy steps
bounds[1:-1] = np.sqrt(self.tbl[1:] * self.tbl[:-1])
bounds[0] = bounds[1] / 0.8518
bounds[24:-1] = (self.tbl[23:-1] + self.tbl[24:]) / 2.
bounds[-1] = bounds[-2] - 11.2
self.bnd = bounds
[docs] def getTable(self):
return self.tbl[:]
[docs] def getBound(self):
return self.bnd[:]
[docs] def getRange(self):
lb = self.tbl * (1 - self.resolution / 2.)
ub = self.tbl * (1 + self.resolution / 2.)
return np.array([lb, ub])
def __str__(self):
return '''EnergyTableFast24s: v%s, res=%g''' % (self.version, self.resolution)
[docs]class AzimuthTableSeriousError(Exception):
def __init__(self):
self.value = 'This table has provided swapped values. One must not use this for any purpose. Use ``AzimuthalTable`` instead. Check carefully your script now, if you meet this critical error. This may ruin your analysis...'
def __str__(self):
return repr(self.value)
[docs]class AzimuthTable(Table):
''' Azimuth angle table, in the IMA frame.
.. danger::
This table provide the swapped value.
One must not use this for any purpose.
Creating this class will always raise
:class:`AzimuthTableSeriousError`.
Use :class:`AzimuthalTable` instead.
'''
version = "1.0"
units = "deg"
def __init__(self):
raise AzimuthTableSeriousError()
Table.__init__(self)
self.tbl = 168.75 + 22.5 * np.arange(16)
self.bnd = np.zeros(17)
self.bnd[:-1] = self.tbl - 11.25
self.bnd[-1] = self.tbl[-1] + 11.25
[docs] def getTable(self):
return self.tbl[:]
[docs] def getBound(self):
return self.bnd[:]
[docs] def getRange(self):
lb = self.bnd[:-1]
ub = self.bnd[1:]
return np.array([lb, ub])
def __str__(self):
return "AzimuthTable: v%s" % AzimuthTable.version
[docs]class AzimuthalTable(Table):
''' Azimuth angle table, in the IMA frame.
'''
version = "1.0"
units = "deg"
def __init__(self):
Table.__init__(self)
self.tbl = -11.25 + 22.5 * np.arange(16)
self.bnd = np.zeros(17)
self.bnd[:-1] = self.tbl - 11.25
self.bnd[-1] = self.tbl[-1] + 11.25
[docs] def getTable(self):
return self.tbl[:]
[docs] def getBound(self):
return self.bnd[:]
[docs] def getRange(self):
lb = self.bnd[:-1]
ub = self.bnd[1:]
return np.array([lb, ub])
def __str__(self):
return "AzimuthalTable: v%s" % AzimuthalTable.version