def read_fgga_na(ifile):
"""
Reads the FGGA data
:param ifile: nasaAmes input filename"""
try:
import nappy
except:
sys.stdout.write('Can not import nappy ...\n')
return
ds = nappy.openNAFile(ifile)
ds.readData()
timestamp = netCDF4.num2date(ds.X, ds.getIndependentVariable(0)[1])
from collections import OrderedDict
dict = OrderedDict()
dict['timestamp'] = timestamp
for i, v in enumerate(['co2_ppm', 'co2_flag', 'ch4_ppb', 'ch4_flag']):
dict[v] = ds.V[i]
df = pd.DataFrame(dict)
df = df.set_index('timestamp')
return df
评论列表
文章目录