irfpy.cena.cena_mass

Easy syntax of CENA mass mode data retriever.

Internally, CenaLoader instance is stored. Therefore, if memory becomes too much, clearCache() should be called explicitly.

class irfpy.cena.cena_mass.CenaMassMatrixCache(rcfile=None)[source]

Bases: object

clearCache()[source]
getMassMatrix(t)[source]

Get a mass matrix of the specified time. The read data is stored to the cache. The returned data is a JdObject which includes data of (8,7,128) shaped numpy.array instance, which is copy()-ed new instance.

>>> jdobj=__cenamassmatrixcache.getMassMatrix(datetime.datetime(2009,4,18,1,30,0))
>>> jd=jdobj.getJd()
>>> data=jdobj.getData()
>>> data.shape
(8, 7, 128)
>>> data.sum()
5.0
irfpy.cena.cena_mass.clearCache()[source]

Clear a cache of CENA.

irfpy.cena.cena_mass.getdata(t, filter=[])[source]

Obtain CENA data for specified time t.

@param t Time @param filter Filter to the date applied after the data retrieval. not supported yet. @retval JdObject that includes data of (8,7,128) shaped numpy.array

>>> jddat=getdata(datetime.datetime(2009,4,18,1,30,0))
>>> dat=jddat.getData()
>>> print(dat.sum())
5.0
>>> jd=jddat.getJd()
>>> print(jd.juld())   
2454939.56251...
irfpy.cena.cena_mass.getobstime(orbit=None, timerange=None)[source]

Get the observation time of CENA in MASS mode for the specified orbit or the specified timerange.

Obtain the observation time as an array of Julday instance. If both orbit and timerange is not specified, RuntimeError will be raised.

@param orbit Orbit number. @param timerange Time range. @retval An array of Julday instance of observation time used mass accumulation mode for CENA. @except RuntimeError raised if both orbit and timerange is not specified.

>>> obt=getobstime(orbit=1945)
>>> len(obt)     # v3.2, 1735.  1767 is based on the old database?  On 100712, 1766 is returned via nfs.  On 110224, 1764 is returned based on v3 dataset.
1735
>>> print(obt[0])
 2454939.51960(2009-04-18T00:28:13.095)
>>> obt=getobstime(orbit=1951)
>>> len(obt)
0
>>> masst=getobstime(timerange=[datetime.datetime(2009,1,28,17,0,0), datetime.datetime(2009,1,28,19,0,0)])
>>> print(len(masst))   # 582 is based on the old data base? On 100712, 597 is returned via nfs.
597