Skip to content

Commit 0088a68

Browse files
Merge branch 'dev' into dev
2 parents 60ab53c + 0d28591 commit 0088a68

File tree

8 files changed

+27
-17
lines changed

8 files changed

+27
-17
lines changed

.github/actions/SetupEnvironment/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runs:
2929
shell: bash -el {0}
3030
run: |
3131
mamba env update -n hypercp -f environment.yml
32-
mamba install --channel=conda-forge pyinstaller==6.6
32+
mamba install --channel=conda-forge pyinstaller
3333
3434
- name: 📸 Capture Environment
3535
if: runner.os != 'Windows'
@@ -43,7 +43,7 @@ runs:
4343
shell: pwsh
4444
run: |
4545
mamba env update -n hypercp -f environment.yml
46-
mamba install --channel=conda-forge pyinstaller==6.6
46+
mamba install --channel=conda-forge pyinstaller
4747
4848
- name: 📸 Capture Environment [Windows]
4949
if: runner.os == 'Windows'

Main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,16 @@ def __init__(
614614
super().__init__()
615615

616616
# Confirm that core data files are in place. Download if necessary.
617-
fpfZhang = os.path.join(CODE_HOME, "Data", "Zhang_rho_db.mat")
617+
fpfZhang = os.path.join(CODE_HOME, "Data", "Zhang_rho_db_expanded.mat")
618618
if not os.path.exists(fpfZhang):
619619
Utilities.downloadZhangDB(fpfZhang, force=True)
620620

621+
# Confirm that core data files are in place. Download if necessary.
622+
# fpfZhangLUT = os.path.join(CODE_HOME, "Data", "Zhang_rho_LUT.nc")
623+
fpfZhangLUT = os.path.join(CODE_HOME, "Data", "Z17_LUT_v2.nc")
624+
if not os.path.exists(fpfZhangLUT):
625+
Utilities.downloadZhangLUT(fpfZhangLUT, force=True)
626+
621627
# Create a default main config to be filled with cmd argument
622628
# to avoid reading the one generated with the GUI
623629
MainConfig.createDefaultConfig("cmdline_main.config", VERSION)

Source/ProcessInstrumentUncertainties.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,16 @@ def ClassBased(self, node: HDFRoot, uncGrp: HDFGroup, stats: dict[str, np.array]
336336
with warnings.catch_warnings():
337337
warnings.filterwarnings("ignore", message="invalid value encountered in divide")
338338
# convert to relative in order to avoid a complex unit conversion process in ProcessL2.
339+
339340
ES_unc = es_unc / np.abs(es)
340341
LI_unc = li_unc / np.abs(li)
341342
LT_unc = lt_unc / np.abs(lt)
342343

344+
343345
# interpolation step - bringing uncertainties to common wavebands from radiometric calibration wavebands.
344346
data_wvl = np.asarray(list(stats['ES']['std_Signal_Interpolated'].keys()),
345347
dtype=float)
348+
346349
es_Unc = self.interp_common_wvls(ES_unc,
347350
np.array(uncGrp.getDataset(rad_cal_str).columns[cal_col_str],
348351
dtype=float)[ind_rad_wvl],
@@ -361,7 +364,7 @@ def ClassBased(self, node: HDFRoot, uncGrp: HDFGroup, stats: dict[str, np.array]
361364
data_wvl,
362365
return_as_dict=True
363366
)
364-
367+
365368
# return uncertainties to ProcessL2 as dictionary - will update xUnc dict with new uncs propagated to L1B
366369
return dict(
367370
esUnc=es_Unc,
@@ -2269,4 +2272,4 @@ def update_cal_rad(PANEL, S12_sl_corr, LAMP, int_time_t0, t1):
22692272
ind_nocal = ind_nan | ind_zero
22702273
updated_radcal_gain[
22712274
ind_nocal == True] = 1 # set 1 instead of 0 to perform calibration (otherwise division per 0)
2272-
return updated_radcal_gain
2275+
return updated_radcal_gain

Source/ProcessL1aqc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,12 @@ def processL1aqc(node, calibrationMap, ancillaryData=None):
502502
start = -1
503503
stop = None
504504
index = None
505+
# Threshold for an Es datetime distance from a Suntracker datetime:
506+
tThreshold = datetime.timedelta(seconds=30)
507+
505508
for index, esTimeI in enumerate(esDateTime):
506-
# Threshold for an Es datetime distance from a Suntracker datetime:
507-
tThreshold = datetime.timedelta(seconds=30)
508509

509-
tDiff = [x - esTimeI for x in sunTrackerDateTime]
510+
tDiff = [abs(x - esTimeI) for x in sunTrackerDateTime]
510511
if min(tDiff) > tThreshold:
511512
i += 1
512513
if start == -1:
@@ -516,7 +517,7 @@ def processL1aqc(node, calibrationMap, ancillaryData=None):
516517
if start != -1:
517518
startstop = [esDateTime[start],esDateTime[stop]]
518519
msg = f' Flag data from {startstop[0]} to {startstop[1]}'
519-
# print(msg)
520+
print(msg)
520521
Utilities.writeLogFile(msg)
521522
badTimes.append(startstop)
522523
start = -1

Source/ProcessL2.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,11 +1311,11 @@ def ensemblesReflectance(node, sasGroup, refGroup, ancGroup, uncGroup,
13111311
# no need to retain SZA
13121312
# Copy datasets to dictionary
13131313
diffuseData.datasetToColumns()
1314-
diffuseColumns = diffuseData.columns
1314+
# diffuseColumns = diffuseData.columns
13151315
directData.datasetToColumns()
1316-
directColumns = directData.columns
1316+
# directColumns = directData.columns
13171317
sixSesData.datasetToColumns()
1318-
sixSesColumns = sixSesData.columns
1318+
# sixSesColumns = sixSesData.columns
13191319

13201320
# diffuseSlice = ProcessL2.columnToSlice(diffuseColumns,start, end)
13211321
# directSlice = ProcessL2.columnToSlice(directColumns,start, end)
@@ -2328,7 +2328,6 @@ def stationsEnsemblesReflectance(node, root, station=None):
23282328
EndOfFileFlag = True # In case the whole file is shorter than the selected interval
23292329

23302330
for i in range(0, esLength):
2331-
# time = Utilities.timeTag2ToSec(tt2[i])
23322331
timei = timeStamp[i]
23332332
if (timei > endTime) or EndOfFileFlag: # end of increment reached
23342333
if EndOfFileFlag:

Source/Utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def dop(year):
227227
fp = 'Data/hybrid_reference_spectrum_p1nm_resolution_c2020-09-21_with_unc.nc'
228228
# fp = 'Data/Thuillier_F0.sb'
229229
# print("SB_support.readSB: " + fp)
230-
print("Reading : " + fp)
230+
# print("Reading : " + fp)
231231
if not HDFRoot.readHDF5(fp):
232232
msg = "Unable to read TSIS-1 netcdf file."
233233
print(msg)

Tests/test_sample_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def setUp(self):
4646
self.cfg_filename = os.path.join(root, "Config", "sample_SEABIRD_SOLARTRACKER.cfg")
4747
self.files = sorted(glob.glob(os.path.join(self.path_to_data, 'RAW', f'*.RAW')))
4848

49-
def test_pysas(self):
49+
def test_seabird_solar_tracker(self):
5050
from Main import Command
5151
os.chdir(root) # Need to switch to root as path in Config files are relative
5252
for file in self.files:

environment.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- pyqt=5.15
99
- requests=2.28
1010
- tqdm=4.65
11-
- numpy=1.23
11+
- numpy=1
1212
- h5py=3.7
1313
- pytz=2022.7
1414
- matplotlib
@@ -20,10 +20,11 @@ dependencies:
2020
- netcdf4=1.6
2121
- j6s
2222
- pytables=3.7
23-
- pyspectral=0.12
23+
- pyspectral=0.12.5
2424
- pyqtgraph
2525
- ocdb-client
2626
- pip
2727
- pip:
28+
- comet_maths<=1.0.3
2829
- punpy
2930
- fpdf2

0 commit comments

Comments
 (0)