ioos / ioos_qc

:ballot_box_with_check: :ocean: IOOS QARTOD and other Quality Control tests implemented in Python
https://ioos.github.io/ioos_qc/
Apache License 2.0
42 stars 27 forks source link

Check if the following tests from the QARTOD Currents manual as implemented and... #98

Open ocefpaf opened 1 year ago

ocefpaf commented 1 year ago

... if not, add them to ioos_qc:

Test 1

Screenshot from 2023-02-27 11-49-31

Test 3

Screenshot from 2023-02-27 11-51-46

Test 6

Screenshot from 2023-02-27 11-53-16

Test 10

Screenshot from 2023-02-27 11-54-16

Tests 12 and 13

image

ocefpaf commented 1 year ago

Pinging @RobUrick and @MathewBiddle. Let's move the e-mail thread here to make it easier to follow the discussion and implementation of these tests.

MathewBiddle commented 1 year ago

Initial question from @RobUrick:

Several of the tests specificified in the QARTOD manual for currents have either a minimum or a maximum - not both.

Is there a way to set the gross_range_test module to have only a min or max? It seems like you have to pass two values in a tuple to the module, so it seems to require both a min and max, but I wasn't sure if there was a workaround.

There's a few tests in question that only use a min or max - Test 1(p. 15), Test 3 (p. 16), Test 6 (p. 17), Test 10 (p. 20), Test 12, and Test 13 (p. 21).

Another issue I ran into is that the current speed test (test 10) does not use Fail flags, but only Suspect flags, but as far as I can tell the test function requires a fail span. I could also just use unrealistic values for the fail span range, though.

@MathewBiddle response to first question:

...you could set an unrealistic value for the min/max, which the test would always pass. Then, set your respective min/max for the value you want to test against?

For example, you want to test for current speeds that have a maximum above 5 m/s. So, set the min to -1000 m/s and the max to 5 m/s. Essentially the test would never fail because of the minimum value, but it would fail because of the maximum

RobUrick commented 1 year ago

Another limitation with the current implementation for Test 12 is that we have to test both across and along velocities, and if either fail, it's considered a fail for that datapoint.

Currently I am planning on just running two separate tests and then joining them such that it returns a fail flag if either velocity fails - but if this test is going to eventually be added to the IOOS module it would be ideal to allow to pass multiple sets of values into one test and return a single dataframe.

kwilcox commented 1 year ago

I'm actually surprised ioos_qc hasn't already had to capture a missing min or max in a gross range test. Is the Currents manual the first to identify ranges without bound on both ends?

RobUrick commented 1 year ago

Tagging @lorraine-heilman with Coastal and Estuarine Circulation Analysis Team (CECAT) so she can contribute as well.