Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add quailty column to SAS (auxiliary fits) #310

Merged
merged 5 commits into from
Nov 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add quailty column
nicHoch committed Sep 26, 2023
commit 7f7389cd4ccf02b38680d5d1b03eaee8c70d0ec5
9 changes: 7 additions & 2 deletions stixcore/products/level2/housekeepingL2.py
Original file line number Diff line number Diff line change
@@ -99,6 +99,7 @@ def from_level1(cls, l1product, parent='', idlprocessor=None):
data['y_srf'] = 0.0
data['z_srf'] = 0.0
data['calib'] = 0.0
data['quality'] = 3
samaloney marked this conversation as resolved.
Show resolved Hide resolved
data['error'] = ""
data['control_index'] = l2.data['control_index']

@@ -171,6 +172,7 @@ def __init__(self):
y_srf : hk_file.DATA.y_srf[i], $
z_srf : hk_file.DATA.z_srf[i], $
calib : hk_file.DATA.calib[i], $
quality : hk_file.DATA.quality[i], $
error : hk_file.DATA.error[i], $
control_index : hk_file.DATA.control_index[i], $
parentfits : file_index $
@@ -275,7 +277,10 @@ def postprocessing(self, result, fits_processor):
data['spice_disc_size'] = (idldata['spice_disc_size'] * u.arcsec).astype(np.float32)
data['y_srf'] = (idldata['y_srf'] * u.arcsec).astype(np.float32)
data['z_srf'] = (idldata['z_srf'] * u.arcsec).astype(np.float32)
# TODO do calculations
data['quality'] = (idldata['quality']).astype(np.byte)
# TODO fix full description to real quality enums
data['quality'].description = ("0: good, 1: suspicious, "
"2: very uncertain, 3: not usable")

data['solo_loc_carrington_lonlat'] = np.tile(np.array([0.0, 0.0]), (n, 1)).\
astype(np.float32) * u.deg
@@ -302,7 +307,7 @@ def postprocessing(self, result, fits_processor):
('STX_GSW', result.idlgswversion.decode(),
'Version of STX-GSW that provided data'))
aux.add_additional_header_keywords(
('HISTORY', 'some data processed by STX-GSW', ''))
('HISTORY', 'aspect data processed by STX-GSW', ''))
files.extend(fits_processor.write_fits(aux))
else:
logger.error("IDL ERROR")