Skip to content

Commit 175553e

Browse files
Fix reliance on root TIME-STAMP and RADCAL reader
1 parent 6349e86 commit 175553e

File tree

4 files changed

+49
-23
lines changed

4 files changed

+49
-23
lines changed

Config/sample_TRIOS_NOTRACKER.cfg

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
"CalibrationFiles": {
77
"SAM_8329.ini": {
88
"enabled": true,
9-
"frameType": "ES"
9+
"frameType": "ES",
10+
"serialNumber": "SAM_8329"
1011
},
1112
"SAM_8166.ini": {
1213
"enabled": true,
13-
"frameType": "LI"
14+
"frameType": "LI",
15+
"serialNumber": "SAM_8166"
1416
},
1517
"SAM_8595.ini": {
1618
"enabled": true,
17-
"frameType": "LT"
19+
"frameType": "LT",
20+
"serialNumber": "SAM_8595"
1821
}
1922
},
2023
"SensorType": "TriOS",
@@ -76,7 +79,26 @@
7679
"fL1bDefaultSST": 26.0,
7780
"fL1bCal": 2,
7881
"fL1bThermal": 1,
79-
"neededCalCharsFRM": {},
82+
"neededCalCharsFRM": {
83+
"ES": [
84+
"SAM_8329_RADCAL",
85+
"SAM_8329_STRAY",
86+
"SAM_8329_THERMAL",
87+
"SAM_8329_ANGULAR"
88+
],
89+
"LI": [
90+
"SAM_8166_RADCAL",
91+
"SAM_8166_STRAY",
92+
"SAM_8166_THERMAL",
93+
"SAM_8166_POLAR"
94+
],
95+
"LT": [
96+
"SAM_8595_RADCAL",
97+
"SAM_8595_STRAY",
98+
"SAM_8595_THERMAL",
99+
"SAM_8595_POLAR"
100+
]
101+
},
80102
"MultiCal": 0,
81103
"preCal_ES": null,
82104
"preCal_LT": null,
@@ -136,7 +158,6 @@
136158
"seaBASSHeaderFileName": "sample_TRIOS_NOTRACKER.hdr",
137159
"bL2SaveSeaBASS": 1,
138160
"bL2WriteReport": 0,
139-
"bL2EnableQualityFlags": 1,
140161
"bL2PlotProd": 1,
141162
"bL2Prodoc3m": 1,
142163
"bL2Prodkd490": 0,

Source/CalCharWindow.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initUI(self):
2929
# SERIAL NUMBERS and cl/char files needed for full FRM case
3030
# NB: This is needed only for FRM regimes (class and full)
3131
ConfigFile.settings['neededCalCharsFRM'] = {}
32-
if ConfigFile.settings['SensorType'].lower == 'trios':
32+
if ConfigFile.settings['SensorType'].lower() == 'trios':
3333
for k,v in ConfigFile.settings['CalibrationFiles'].items():
3434
# sensorType is frameType only for TriOS
3535
sensorType = v['frameType']
@@ -110,20 +110,20 @@ def initUI(self):
110110

111111
# Class
112112
self.ClassCalRadioButton = QtWidgets.QRadioButton(
113-
f"FRM Class-Specific characterisation coefficients (in /Data/Class_Based_Characterizations/{ConfigFile.settings['SensorType']})\n"
114-
" NB: Sensor-Specific calibrations with uncertainties in the FidRadDB format required" )
113+
f"FRM Class-Specific characterisations\n"# (in /Data/Class_Based_Characterizations/{ConfigFile.settings['SensorType']})\n"
114+
" Sensor-Specific cal/char files with uncertainties in FidRadDB format required" )
115115
self.ClassCalRadioButton.setAutoExclusive(False)
116116
self.ClassCalRadioButton.clicked.connect(self.ClassCalRadioButtonClicked)
117117

118118
# Full
119119
self.FullCalRadioButton = QtWidgets.QRadioButton(
120-
"FRM Sensor-Specific characterisation coefficients (highest quality)\n"
121-
" NB: Sensor-Specific calibrations with uncertainties and characterizations in the FidRadDB format required")
120+
"FRM Sensor-Specific characterisations (highest quality)\n"
121+
" Sensor-Specific calibrations with uncertainties in FidRadDB format required")
122122
self.FullCalRadioButton.setAutoExclusive(False)
123123
self.FullCalRadioButton.clicked.connect(self.FullCalRadioButtonClicked)
124124

125125
# Disable FRM regimes for DALEC for the moment.
126-
if ConfigFile.settings['SensorType'] == 'Dalec':
126+
if ConfigFile.settings['SensorType'].lower() == 'dalec':
127127
self.ClassCalRadioButton.setDisabled(True)
128128
self.FullCalRadioButton.setDisabled(True)
129129

@@ -136,14 +136,14 @@ def initUI(self):
136136
self.FullCalRadioButton.setChecked(True)
137137

138138
# Check completeness of calibration directory according to selected cal/char regime
139-
CalLabel2 = QtWidgets.QLabel("If FRM cal-char regime selected, then ...", self)
139+
FidRadDB_link = '<a href="https://ocdb.eumetsat.int/docs/fidrad-database.html">FidRadDB-formatted</a>'
140+
CalLabel2 = QtWidgets.QLabel("Checking for required {FidRadDB_link} cal/char files:", self)
140141
CalLabel2_font = CalLabel2.font()
141142
CalLabel2_font.setPointSize(12)
142143
CalLabel2_font.setBold(True)
143144
CalLabel2.setFont(CalLabel2_font)
144145

145-
FidRadDB_link = '<a href="https://ocdb.eumetsat.int/docs/fidrad-database.html">FidRadDB-formatted</a>'
146-
CalLabel2a = QtWidgets.QLabel(f'Checking for required {FidRadDB_link} cal/char files in: <br> {self.path_FidRadDB}', self)
146+
# CalLabel2a = QtWidgets.QLabel(f'Checking for required {FidRadDB_link} cal/char files in: <br> {self.path_FidRadDB}', self)
147147
# CalLabel2a_font = CalLabel2a.font()
148148
# CalLabel2a_font.setPointSize(9)
149149
# CalLabel2a_font.setBold(False)
@@ -155,19 +155,19 @@ def initUI(self):
155155
# CalLabel2b_font.setBold(False)
156156
# CalLabel2b.setFont(CalLabel2b_font)
157157

158-
CalLabel2cES = QtWidgets.QLabel("Downwelling irradiance, ES", self)
158+
CalLabel2cES = QtWidgets.QLabel(" Es:", self)
159159
# CalLabel2cES_font = CalLabel2cES.font()
160160
# CalLabel2cES_font.setPointSize(9)
161161
# CalLabel2cES_font.setBold(False)
162162
# CalLabel2cES.setFont(CalLabel2cES_font)
163163

164-
CalLabel2cLT = QtWidgets.QLabel("Total water radiance, LT (water)", self)
164+
CalLabel2cLT = QtWidgets.QLabel(" Lt:", self)
165165
# CalLabel2cLT_font = CalLabel2cLT.font()
166166
# CalLabel2cLT_font.setPointSize(9)
167167
# CalLabel2cLT_font.setBold(False)
168168
# CalLabel2cLT.setFont(CalLabel2cLT_font)
169169

170-
CalLabel2cLI = QtWidgets.QLabel("Sky radiance, LI (sky)", self)
170+
CalLabel2cLI = QtWidgets.QLabel(" Li:", self)
171171
# CalLabel2cLI_font = CalLabel2cLI.font()
172172
# CalLabel2cLI_font.setPointSize(9)
173173
# CalLabel2cLI_font.setBold(False)
@@ -291,7 +291,7 @@ def initUI(self):
291291

292292
# UT/FidRadDB files location
293293
VBox.addWidget(CalLabel2)
294-
VBox.addWidget(CalLabel2a)
294+
# VBox.addWidget(CalLabel2a)
295295
# VBox.addWidget(CalLabel2b)
296296

297297
# Check cal/char files: Es

Source/ProcessL1b.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ def read_FidRadDB_cal_char_files(root):
153153
gp.attributes['FrameType'] = 'NONE'
154154

155155
# Get measurement acquisition time stamp and convert to seconds to compare to cal/char files' timestamps
156-
# BUG: Some are unable to read this root attribute
157-
print(f"Root attribute TIME_STAMP: {root.attributes['TIME-STAMP']}")
158-
159-
acq_time_seconds = datetime.strptime(root.attributes['TIME-STAMP'], '%a %b %d %H:%M:%S %Y').timestamp()
156+
# BUG: Some are unable to read this root attribute due to OS language settings
157+
# print(f"Root attribute TIME-STAMP: {root.attributes['TIME-STAMP']}")
158+
# acq_time_seconds = datetime.strptime(root.attributes['TIME-STAMP'], '%a %b %d %H:%M:%S %Y').timestamp()
159+
# Alternative: Grab start time of Es
160+
esDatetime = root.getGroup('ES').datasets['DATETIME'].data[0]
161+
acq_time_seconds = esDatetime.timestamp()
160162

161163
# Check which cal/char files are needed for each of the 3 sensor types (ES, LT, LI) in cal/char regime = Full, i.e. ConfigFile.settings["fL1bCal"] == 3
162164
# ... then filter to RADCAL if cal'char regime = class, i.e. ConfigFile.settings["fL1bCal"] == 2

Source/Utilities.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,10 @@ def interpUncertainties_Class(node):
26412641
for data_type in ["_RADCAL_CAL"]:
26422642

26432643
ds = grp.getDataset(sensor+data_type)
2644-
ds.datasetToColumns()
2644+
try:
2645+
ds.datasetToColumns()
2646+
except:
2647+
print('erk')
26452648
for indx in range(len(ds.columns)):
26462649
indx_name = str(indx)
26472650
if indx_name != '':

0 commit comments

Comments
 (0)