irfpy.cena.cena_scicnt

cena_scicnt module is an implementaion for bridging Sadppac.

An implementation for bridging Sadppac. Benefit is syntax sugar, caching, and using irfpy.util.irfpyrc module for path setting.

Entry of [cena] bmuobase in .irfpyrc file is loaded.

class irfpy.cena.cena_scicnt.CenaLoader(rcfile=None)[source]

Bases: object

A CENA data loader.

CenaLoader is a class that treats CENA data. CENA data is saved by the orbit sorted files in BMU format. The reading routine is implemented in C++ library called libsadppac. Reading routine in the libsadppac is based on the file-based, therefore it is not convenient for daily analysis. This class may bridge the libsadppac to usual analysis, which is based on observation time.

>>> cl=CenaLoader()
>>> print(cl.load(50))
None
>>> arr=cl.load(1945)      # This will load cena data for orbit 1945.
>>> int(arr.size())   # Now v3.2, 1737.  The original database returned 1769, but new data base on 100710 (nfs) returned 1768.
1737

Initializer

@param rcfile Configure file name.

clearCache()[source]
printCache()[source]
load(orbitnr)[source]

Load a data of the specified orbit number. If no data exists, None is returned.

getObservationTime(orbitnr)[source]

Obtain a tuple of observation time in the format of Julday.

getTMmodes(orbitnr)[source]

Obtain a JdSeries of TM mode for the specified orbit.

Sensor mode is defined in Sadppac.CenaPacket.TMMODE_XXX. TMMODE_MASS_ACC, TMMODE_TOF_ACC, TMMODE_COUNT_ACC and TMMODE_NON_PROCESS is defined.

>>> c=CenaLoader()
>>> tm=c.getTMmodes(1945)
>>> isinstance(tm, JdSeries)
True
>>> print(tm.size())   # Now v3.2, 1737. The original value was 1769, but after the database update, 1768 is returned via nfs.
1737
>>> print(tm.first().getData())   # MASS_ACC=0x02
2
>>> tm=c.getTMmodes(1948)
>>> print(tm.first().getData())   # CNTR=0x03
3
>>> tm=c.getTMmodes(2040)   # In fact, this is no data orbit for CENA.
>>> print(tm.size())
0
getFullMassMatrix(orbitnr)[source]

Get mass matrix of the specified orbit.

Return the mass matrix for full model. Only data obtained in mass accumulation mode with binning parameters nE=8, nD=7, nM=128, nP=1 is returned.

@retval JdSeries of mass matrix. Mass matrix is E=8xD=7xM=128 numpy array.

>>> c=CenaLoader()
>>> mm=c.getFullMassMatrix(1945)    # mm is JdSeries with element of numpy.array
>>> isinstance(mm, JdSeries)
True
>>> print(mm.size())   ### v3.2, 1735.  The original value was 1767, but after the database update, 1766 is returned.
1735
>>> mass_arr = mm.first().getData()
>>> print(mass_arr.shape)
(8, 7, 128)
>>> mm2=c.getFullMassMatrix(1948)   # mm2 is JdSeries, but 1948 is in cntr mode.
>>> print(mm2.size())
0