nasa / HyperCP

Other
41 stars 22 forks source link

Uncertainty Visualizer negative values pie chart #262

Open oceancolorcoder opened 1 day ago

oceancolorcoder commented 1 day ago

@ARamsay17

For PACE-PAX_PACE-PAX_20240908_180000_L1BQC.hdf on the Box:

File "/Users/daurin/GitRepos/HyperCP/Source/ProcessL2.py", line 1800, in ensemblesReflectance xUNC.update(instrument.ClassBasedL2(node, uncGroup, rhoScalar, rhoVec, rhoUNC, waveSubset, xSlice)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/daurin/GitRepos/HyperCP/Source/ProcessInstrumentUncertainties.py", line 544, in ClassBasedL2 p_unc.pie_plot_class_l2( File "/Users/daurin/GitRepos/HyperCP/Source/Uncertainty_Visualiser.py", line 153, in pie_plot_class_l2 ax.pie([self._engine.getpct(results[product][key], values[product])[indx] for key in labels[product]], File "/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/matplotlib/init.py", line 1473, in inner return func( ^^^^^ File "/opt/anaconda3/envs/hypercp/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 3285, in pie raise ValueError("Wedge sizes 'x' must be non negative values") ValueError: Wedge sizes 'x' must be non negative values

ARamsay17 commented 12 hours ago

@oceancolorcoder It seems the issue relates to the Lw values for this cast, there are quite a few negative values as shown on the plot below. My question is how do we best deal with these values? Setting them to 0 raises another error with the pie chart. I think we need to discuss how we proceed further.

Lw_vals_issue_262

ARamsay17 commented 11 hours ago

I got this issue in testing after working around the Uncertainty_Breakdown problem:

Traceback (most recent call last): File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Main.py", line 523, in singleL2Clicked self.processSingle("L2") File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Main.py", line 491, in processSingle Controller.processFilesSingleLevel( File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Source/Controller.py", line 897, in processFilesSingleLevel Controller.processSingleLevel(pathOut, fp, calibrationMap, level, flag_Trios) File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Source/Controller.py", line 757, in processSingleLevel root = Controller.processL2(root,outFilePath) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Source/Controller.py", line 448, in processL2 node = ProcessL2.processL2(root,station) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Source/ProcessL2.py", line 2373, in processL2 if not ProcessL2.stationsEnsemblesReflectance(node, root,station): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Source/ProcessL2.py", line 2326, in stationsEnsemblesReflectance check = ProcessL2.filterData(newReflectanceGroup, badTimes, sensor = "HYPER") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ar17/PycharmProjects/FRM4SOC/HCP/Source/ProcessL2.py", line 650, in filterData if badTimes == []: ^^^^^^^^^^^^^^ ValueError: operands could not be broadcast together with shapes (1,2) (0,)

oceancolorcoder commented 10 hours ago

@oceancolorcoder It seems the issue relates to the Lw values for this cast, there are quite a few negative values as shown on the plot below. My question is how do we best deal with these values? Setting them to 0 raises another error with the pie chart. I think we need to discuss how we proceed further.

Lw_vals_issue_262

Ew. That's not good at all. How can that even be? Is that from this file? Looked okay this morning... PACE-PAX_PACE-PAX_20240908_180000_L2_LT

ARamsay17 commented 9 hours ago

@oceancolorcoder I'll have to do more searching for this one. I run Lt, Li and rho through the measurement function (Lt - rho*Li) to get Lw. The Li/Lt values I have don't seem to match any available in the L1BQC file but I don't know why that would be. I need to do more work to verify this.