@@ -335,9 +335,6 @@ def check(self, tinp, inp, zinp):
335
335
flag_arr = np .ma .empty (inp .size , dtype = 'uint8' )
336
336
flag_arr .fill (QartodFlags .UNKNOWN )
337
337
338
- # If the value is masked set the flag to MISSING
339
- flag_arr [inp .mask ] = QartodFlags .MISSING
340
-
341
338
# Iterate over each member and apply its spans on the input data.
342
339
# Member spans are applied in order and any data points that fall into
343
340
# more than one member are flagged by each one.
@@ -388,11 +385,14 @@ def check(self, tinp, inp, zinp):
388
385
fail_idx = np .zeros (inp .size , dtype = bool )
389
386
390
387
suspect_idx = (inp < m .vspan .minv ) | (inp > m .vspan .maxv )
391
-
388
+
392
389
with np .errstate (invalid = 'ignore' ):
393
390
flag_arr [(values_idx & fail_idx )] = QartodFlags .FAIL
394
391
flag_arr [(values_idx & ~ fail_idx & suspect_idx )] = QartodFlags .SUSPECT
395
392
flag_arr [(values_idx & ~ fail_idx & ~ suspect_idx )] = QartodFlags .GOOD
393
+
394
+ # If the value is masked set the flag to MISSING
395
+ flag_arr [inp .mask ] = QartodFlags .MISSING
396
396
397
397
return flag_arr
398
398
@@ -423,11 +423,11 @@ def climatology_test(config : Union[ClimatologyConfig, Sequence[Dict[str, Tuple]
423
423
config: A ClimatologyConfig object or a list of dicts containing tuples
424
424
that can be used to create a ClimatologyConfig object. See ClimatologyConfig
425
425
docs for more info.
426
+ inp: Input data as a numeric numpy array or a list of numbers.
426
427
tinp: Time data as a sequence of datetime objects compatible with pandas DatetimeIndex.
427
428
This includes numpy datetime64, python datetime objects and pandas Timestamp object.
428
429
ie. pd.DatetimeIndex([datetime.utcnow(), np.datetime64(), pd.Timestamp.now()]
429
430
If anything else is passed in the format is assumed to be seconds since the unix epoch.
430
- vinp: Input data as a numeric numpy array or a list of numbers.
431
431
zinp: Z (depth) data, in meters positive down, as a numeric numpy array or a list of numbers.
432
432
433
433
Returns:
0 commit comments