In [1]:
from iuvs import hk
from iuvs.spice import load_kernels
load_kernels()
In [2]:
from iuvs import io
In [3]:
df = io.get_filename_df('l1a', env='stage')
df = df['2014':'2015']
df.head()
Out[3]:
In [4]:
from iuvs import meta
In [5]:
l1asum = meta.l1a_summary()
In [137]:
l1asum['orbit'] = l1asum.filename.map(lambda x: io.ScienceFilename(x).orbit)
In [141]:
l1asum['time'] = l1asum.filename.map(lambda x: io.ScienceFilename(x).time)
In [142]:
l1asum.set_index('time', inplace=True)
In [138]:
l1asum.columns
Out[138]:
In [139]:
%matplotlib inline
In [143]:
l1asum.orbit.plot(style='*')
Out[143]:
In [125]:
df.orbit.plot(style='*')
Out[125]:
In [9]:
def process_hk_fname(fname):
hkfile = hk.HKReader(str(fname))
hkfile.temp_df.to_hdf('/home/klay6683/to_keep/HK_DB_stage.h5', 'df', mode='a',
format='table', append=True)
In [8]:
currenthknames = io.get_current_hk_fnames(env='stage')
In [10]:
from IPython.display import display
from ipywidgets import FloatText
ft = FloatText()
display(ft)
for i,fname in enumerate(currenthknames):
ft.value = round(i*100/len(currenthknames), 1)
process_hk_fname(fname)
In [38]:
from pathlib import Path
dbpath = Path('/home/klay6683/to_keep/HK_DB_stage.h5')
timestring = '20150101'
with pd.HDFStore(str(dbpath)) as store:
c = store.select_column('df', 'index')
where = c[pd.DatetimeIndex(c).date==pd.Timestamp(timestring).date()].index
data = store.select('df', where=where)
In [40]:
instr_temps = ['FUV_CHIP_TEMP_C',
'FUV_DET_TEMP_C',
'FUV_INT_TEMP_C',
'MUV_CHIP_TEMP_C',
'MUV_DET_TEMP_C',
'MUV_INT_TEMP_C']
iuvs_temps = ['IUVS_1_TEMP_C',
'IUVS_2_TEMP_C',
'IUVS_3_TEMP_C',
'IUVS_4_TEMP_C']
htr_mot_temps = ['ZONE_1_HTR_TEMP_C', 'ZONE_2_HTR_TEMP_C',
'HV_POWR_TEMP_C', 'GRAT_MOT_TEMP_C', 'SCAN_MOT_TEMP_C']
In [42]:
set(data.columns) - set(instr_temps) - set(iuvs_temps) - set(htr_mot_temps)
Out[42]:
In [42]:
s = dtindex.to_series()
In [43]:
pd.DatetimeIndex(s)
Out[43]:
In [57]:
diff = pd.DatetimeIndex(pd.read_hdf(str(dbpath.parent / 'current_datediff.hdf')))
In [60]:
len(diff)
Out[60]:
In [56]:
for index, row in hkfname_df.loc[diff].iterrows():
print(index.date(), row.p)
In [ ]:
In [12]:
hkfilename.__dict__
Out[12]:
In [ ]: