Skip to content

Pie uncertainty breakdowns crashing on negatives #349

@oceancolorcoder

Description

@oceancolorcoder

@ARamsay17 @juanchossn Unpredictably, this section of Uncertainty_Visualizer chokes on a negative value.

Image

File "/Users/daurin/GitRepos/HyperCP/Source/ProcessL2.py", line 1872, in ensemblesReflectance
    L1B_UNC = instrument.ClassBased(node, uncGroup, stats)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/daurin/GitRepos/HyperCP/Source/ProcessInstrumentUncertainties.py", line 314, in ClassBased
    p_unc.pie_plot_class(
  File "/Users/daurin/GitRepos/HyperCP/Source/Uncertainty_Visualiser.py", line 90, in pie_plot_class
    ax.pie(
  File "/Users/daurin/miniforge3/envs/hypercp/lib/python3.11/site-packages/matplotlib/_api/deprecation.py", line 453, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/daurin/miniforge3/envs/hypercp/lib/python3.11/site-packages/matplotlib/__init__.py", line 1521, in inner
    return func(
           ^^^^^
  File "/Users/daurin/miniforge3/envs/hypercp/lib/python3.11/site-packages/matplotlib/axes/_axes.py", line 3338, in pie
    raise ValueError("Wedge sizes 'x' must be non negative values")
ValueError: Wedge sizes 'x' must be non negative values

I recommend putting a catch in with a Warning Message. We should have rooted out negatives prior to this -- where they are instantiated; likely where they are multiplied by (ir)radiance to make uncertainties proportional. This is understandable in very low-signal bands, but if it's happening in the VIS, we need to know about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions