Source code for irfpy.mels.dnf

""" Access to differential number flux data of MEX/ELS
"""
import logging as _logging
from irfpy.mels import rawdata as _rawdata
from irfpy.mels import calpds as _calpds

import warnings as _warnings

[docs] class DataCenterFlux128(_rawdata.DataCenterElsCounts): """ Data center for the E128 energy mode. >>> import datetime >>> import irfpy.mels.dnf as dnf >>> import numpy as np >>> dc = dnf.DataCenterFlux128() >>> tref = datetime.datetime(2021, 11, 16, 7) >>> t0, d0 = dc.nearest(tref) >>> print(t0) 2021-11-16 06:59:58.146000 >>> print(d0.shape) (128, 16) >>> print(np.nanmax(d0)) 22132500.0 """ def __init__(self, *args, **kwargs): _rawdata.DataCenterElsCounts.__init__(self, *args, **kwargs)
[docs] def read_file(self, filename): _warnings.warn('The MEX ELS/DNF module is *not* yet fully validated. (version 4.5.2a16)') _logger = _logging.getLogger(__name__) tlist, clist = _rawdata.DataCenterElsCounts.read_file(self, filename) tlist2 = [] dnflist2 = [] cnt2dnf = _calpds.cnt2dnf for t, cc in zip(tlist, clist): if cc.shape != (128, 16): _logger.debug("Data for {} is not in E128 mode.".format(t)) continue dnf = cc * cnt2dnf tlist2.append(t) dnflist2.append(dnf) # This must be changed to dnf. return tlist2, dnflist2