Skip to content
Snippets Groups Projects
Commit 1085012c authored by Coda Phillips's avatar Coda Phillips
Browse files

Save only records pertaining to calibrated radiance (SUM file)

parent 8dc331e7
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@ from glob import glob
import re
import netCDF4
from aeri_tools.io.dmv.housekeeping import get_all_housekeeping
import pandas as pd
import numpy as np
from electronic_checks import electronic_checks
......@@ -22,6 +24,7 @@ levels = [
]
def save_quality(frame, qc_path):
frame = frame.ix[pd.notnull(frame.sum_index)].set_index('sum_index')
ncdf = netCDF4.Dataset(qc_path, 'w')
time = ncdf.createDimension('time', len(frame))
base_time = ncdf.createVariable('base_time', 'i8', ())
......@@ -41,8 +44,11 @@ def save_quality(frame, qc_path):
def read_frame(cxs_file, sum_file):
hk = get_all_housekeeping(cxs_file).combine_first(
get_all_housekeeping(sum_file))
cxs = get_all_housekeeping(cxs_file)
cxs['cxs_index'] = np.arange(len(cxs))
sum_ = get_all_housekeeping(sum_file)
sum_['sum_index'] = np.arange(len(sum_))
hk = cxs.combine_first(sum_).sort_values(['cxs_index','sum_index'])
hk.index.name = 'datetime'
return hk.reset_index()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment