From 7ca83fa59f74839c0b7985dd1763452ebc5298c4 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Thu, 21 Mar 2024 10:21:37 +0000 Subject: [PATCH 01/29] Re-write rules attrs checks in check_var to be more general --- checksit/generic.py | 79 +++++++++++++++++- .../amof-acoustic-backscatter-winds.yml | 24 +++--- .../amof-aerosol-backscatter-radial-winds.yml | 8 +- .../amof-aerosol-backscatter.yml | 4 +- .../amof-aerosol-concentration.yml | 4 +- .../amof-aerosol-extinction.yml | 8 +- ...-aerosol-no3-so4-nh3-org-concentration.yml | 16 ++-- .../amof-aerosol-optical-depth.yml | 4 +- .../amof-aerosol-size-distribution.yml | 4 +- ...of-boundary-layer-temperature-profiles.yml | 80 +++++++++---------- .../amof-brightness-temperature.yml | 80 +++++++++---------- .../amof-ch4-concentration.yml | 4 +- .../ncas-amof-2.0.0/amof-cloud-base.yml | 4 +- .../ncas-amof-2.0.0/amof-cloud-coverage.yml | 4 +- .../ncas-amof-2.0.0/amof-co-concentration.yml | 4 +- .../amof-co-h2-concentration.yml | 8 +- .../amof-co2-concentration.yml | 4 +- .../amof-depolarisation-ratio.yml | 12 +-- .../groups/ncas-amof-2.0.0/amof-dew-point.yml | 4 +- .../ncas-amof-2.0.0/amof-flux-components.yml | 52 ++++++------ .../ncas-amof-2.0.0/amof-flux-estimates.yml | 60 +++++++------- ...-full-troposphere-temperature-profiles.yml | 80 +++++++++---------- .../ncas-amof-2.0.0/amof-h2-concentration.yml | 4 +- .../amof-halocarbon-concentration.yml | 36 ++++----- specs/groups/ncas-amof-2.0.0/amof-iwv-lwp.yml | 80 +++++++++---------- .../amof-liquid-water-content.yml | 4 +- .../ncas-amof-2.0.0/amof-mean-co2-h2o.yml | 16 ++-- .../amof-mean-winds-profile.yml | 4 +- .../ncas-amof-2.0.0/amof-mean-winds.yml | 24 +++--- .../amof-moisture-profiles.yml | 80 +++++++++---------- .../amof-n2o-concentration.yml | 4 +- .../amof-n2o-sf6-concentration.yml | 8 +- .../amof-no2-concentration.yml | 4 +- .../amof-nox-noxy-concentration.yml | 16 ++-- .../amof-o2n2-concentration-ratio.yml | 4 +- .../amof-o3-concentration-profile.yml | 4 +- .../ncas-amof-2.0.0/amof-o3-concentration.yml | 4 +- .../ncas-amof-2.0.0/amof-oh-concentration.yml | 4 +- .../amof-particle-size-distribution.yml | 16 ++-- ...mof-peroxyacetyl-nitrate-concentration.yml | 4 +- .../ncas-amof-2.0.0/amof-pm-concentration.yml | 36 ++++----- .../groups/ncas-amof-2.0.0/amof-radiation.yml | 24 +++--- .../amof-rain-lwc-velocity-reflectivity.yml | 4 +- .../amof-size-concentration-spectra.yml | 4 +- .../groups/ncas-amof-2.0.0/amof-snr-winds.yml | 20 ++--- .../amof-so2-concentration.yml | 4 +- specs/groups/ncas-amof-2.0.0/amof-soil.yml | 12 +-- .../amof-solar-actinic-flux.yml | 4 +- specs/groups/ncas-amof-2.0.0/amof-sonde.yml | 4 +- .../ncas-amof-2.0.0/amof-surface-met.yml | 36 ++++----- .../amof-tgm-concentration.yml | 4 +- .../amof-voc-concentration.yml | 36 ++++----- 52 files changed, 561 insertions(+), 490 deletions(-) diff --git a/checksit/generic.py b/checksit/generic.py index acfe1d6..b0290e7 100644 --- a/checksit/generic.py +++ b/checksit/generic.py @@ -185,13 +185,15 @@ def check_dim_exists(dct, dimensions, skip_spellcheck=False): return errors, warnings -def check_var(dct, variable, defined_attrs, attr_rules=[], skip_spellcheck=False): +def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=False): """ Check variable exists and has attributes defined. """ errors = [] warnings = [] + rules_attrs = rules_attrs or {} + if isinstance(variable, list): variable = variable[0] if ':__OPTIONAL__' in variable: @@ -233,11 +235,43 @@ def check_var(dct, variable, defined_attrs, attr_rules=[], skip_spellcheck=False f"[variable**************:{variable}]: Attribute '{attr_key}' must have definition '{attr_value}', " f"not '{dct['variables'][variable].get(attr_key).encode('unicode_escape').decode('utf-8')}'." ) - for rule_to_check in attr_rules: - if rule_to_check == "rule-func:check-qc-flags": - rule_errors, rule_warnings = rules.check(rule_to_check, dct['variables'][variable].get("flag_values"), context=dct['variables'][variable].get("flag_meanings"), label=f"[variable******:{variable}]: ") + + for attr in rules_attrs: + if isinstance(attr, dict) and len(attr.keys()) == 1: + for key, value in attr.items(): + attr = f"{key}:{value}" + attr_key = attr.split(":")[0] + attr_rule = ":".join(attr.split(":")[1:]) + if attr_key not in dct["variables"][variable]: + errors.append( + f"[variable:**************:{variable}]: Attribute '{attr_key}' does not exist. " + f"{search_close_match(attr_key, dct['variables'][variable].keys()) if not skip_spellcheck else ''}" + ) + elif is_undefined(dct["variables"][variable].get(attr_key)): + errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") + elif attr_rule.startswith("rule-func:same-type-as"): + var_checking_against = attr_rule.split(":")[-1] + errors.extend(rules.check( + attr_rule, + dct["variables"][variable].get(attr_key), + context = dct["variables"][var_checking_against].get("type"), + label = f"[variables:******:{attr_key}]***", + )) + elif attr_rule.strip() == ("rule-func:check-qc-flags"): + rule_errors, rule_warnings = rules.check( + attr_rule, + dct["variables"][variable].get("flag_values"), + context = dct["variables"][variable].get("flag_meanings"), + label = f"[variable******:{variable}]: ", + ) errors.extend(rule_errors) warnings.extend(rule_warnings) + else: + errors.extend(rules.check( + attr_rule, + dct["variables"][variable].get(attr_key), + label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", + )) else: @@ -264,6 +298,43 @@ def check_var(dct, variable, defined_attrs, attr_rules=[], skip_spellcheck=False f"not '{dct['variables'][variable].get(attr_key)}'." ) + for attr in rules_attrs: + if isinstance(attr, dict) and len(attr.keys()) == 1: + for key, value in attr.items(): + attr = f"{key}:{value}" + attr_key = attr.split(":")[0] + attr_rule = ":".join(attr.split(":")[1:]) + if attr_key not in dct["variables"][variable]: + errors.append( + f"[variable:**************:{variable}]: Attribute '{attr_key}' does not exist. " + f"{search_close_match(attr_key, dct['variables'][variable].keys()) if not skip_spellcheck else ''}" + ) + elif is_undefined(dct["variables"][variable].get(attr_key)): + errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") + elif attr_rule.startswith("rule-func:same-type-as"): + var_checking_against = attr_rule.split(":")[-1] + errors.extend(rules.check( + attr_rule, + dct["variables"][variable].get(attr_key), + context = dct["variables"][var_checking_against].get("type"), + label = f"[variables:******:{attr_key}]***", + )) + elif attr_rule.strip() == "rule-func:check-qc-flags": + rule_errors, rule_warnings = rules.check( + attr_rule, + dct["variables"][variable].get("flag_values"), + context = dct["variables"][variable].get("flag_meanings"), + label = f"[variable******:{variable}]: ", + ) + errors.extend(rule_errors) + warnings.extend(rule_warnings) + else: + errors.extend(rules.check( + attr_rule, + dct["variables"][variable].get(attr_key), + label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", + )) + return errors, warnings diff --git a/specs/groups/ncas-amof-2.0.0/amof-acoustic-backscatter-winds.yml b/specs/groups/ncas-amof-2.0.0/amof-acoustic-backscatter-winds.yml index e286876..2164815 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-acoustic-backscatter-winds.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-acoustic-backscatter-winds.yml @@ -165,8 +165,8 @@ var-requires10: - dimension:time, altitude - units:1 - long_name:Data Quality flag: Mean Winds - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -177,8 +177,8 @@ var-requires11: - dimension:time, altitude - units:1 - long_name:Data Quality flag: Eastward Wind Component (U) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -189,8 +189,8 @@ var-requires12: - dimension:time, altitude - units:1 - long_name:Data Quality flag: Northward Wind Component (V) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -201,8 +201,8 @@ var-requires13: - dimension:time, altitude - units:1 - long_name:Data Quality flag: Upward Air Velocity (W) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -213,8 +213,8 @@ var-requires14: - dimension:time, altitude - units:1 - long_name:Data Quality flag: Backscatter - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -225,8 +225,8 @@ var-requires15: - dimension:time, altitude - units:1 - long_name:Data Quality flag: Background Noise - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter-radial-winds.yml b/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter-radial-winds.yml index ea1a235..b9eb6b2 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter-radial-winds.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter-radial-winds.yml @@ -123,8 +123,8 @@ var-requires8: - type:byte - units:1 - long_name:Data Quality flag: Radial Velocity of Scatterers Away From Instrument - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -134,8 +134,8 @@ var-requires9: - type:byte - units:1 - long_name:Data Quality flag: Backscatter - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter.yml b/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter.yml index e448552..bc8284a 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-aerosol-backscatter.yml @@ -206,8 +206,8 @@ var-requires13: - dimension:time, altitude - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-aerosol-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-aerosol-concentration.yml index 1cea91d..3064bb6 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-aerosol-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-aerosol-concentration.yml @@ -23,5 +23,5 @@ var-requires1: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-aerosol-extinction.yml b/specs/groups/ncas-amof-2.0.0/amof-aerosol-extinction.yml index cd506ea..c88002a 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-aerosol-extinction.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-aerosol-extinction.yml @@ -52,8 +52,8 @@ var-requires3: - dimension:time, altitude - units:1 - long_name:Data Quality flag: 355nm - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires4: func: checksit.generic.check_var params: @@ -64,8 +64,8 @@ var-requires4: - dimension:time, altitude - units:1 - long_name:Data Quality flag: 316nm - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-aerosol-no3-so4-nh3-org-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-aerosol-no3-so4-nh3-org-concentration.yml index 0db1b5f..edd7894 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-aerosol-no3-so4-nh3-org-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-aerosol-no3-so4-nh3-org-concentration.yml @@ -68,8 +68,8 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag: NO3 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires5: func: checksit.generic.check_var params: @@ -80,8 +80,8 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag: SO4 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires6: func: checksit.generic.check_var params: @@ -92,8 +92,8 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag: NH3 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires7: func: checksit.generic.check_var params: @@ -104,5 +104,5 @@ var-requires7: - dimension:time - units:1 - long_name:Data Quality flag: Organics - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-aerosol-optical-depth.yml b/specs/groups/ncas-amof-2.0.0/amof-aerosol-optical-depth.yml index e932171..5f02ecd 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-aerosol-optical-depth.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-aerosol-optical-depth.yml @@ -52,8 +52,8 @@ var-requires3: - dimension:time, index - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-aerosol-size-distribution.yml b/specs/groups/ncas-amof-2.0.0/amof-aerosol-size-distribution.yml index 49f8058..73f8f44 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-aerosol-size-distribution.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-aerosol-size-distribution.yml @@ -159,8 +159,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-boundary-layer-temperature-profiles.yml b/specs/groups/ncas-amof-2.0.0/amof-boundary-layer-temperature-profiles.yml index 196d47f..0662956 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-boundary-layer-temperature-profiles.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-boundary-layer-temperature-profiles.yml @@ -40,8 +40,8 @@ var-requires2: - dimension:time - units:1 - long_name:Data Quality flag: Surface Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires3: func: checksit.generic.check_var params: @@ -52,8 +52,8 @@ var-requires3: - dimension:time - units:1 - long_name:Data Quality flag: Surface Relative Humidity - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires4: func: checksit.generic.check_var params: @@ -64,8 +64,8 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag: Surface Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires5: func: checksit.generic.check_var params: @@ -76,8 +76,8 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag: Precipitation - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires6: func: checksit.generic.check_var params: @@ -88,8 +88,8 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 1 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires7: func: checksit.generic.check_var params: @@ -100,8 +100,8 @@ var-requires7: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 2 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires8: func: checksit.generic.check_var params: @@ -112,8 +112,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 3 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -124,8 +124,8 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 4 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires10: func: checksit.generic.check_var params: @@ -136,8 +136,8 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 5 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -148,8 +148,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 6 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -160,8 +160,8 @@ var-requires12: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 7 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -172,8 +172,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 8 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -184,8 +184,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 9 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -196,8 +196,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 10 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -208,8 +208,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 11 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -220,8 +220,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 12 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -232,8 +232,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 13 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -244,8 +244,8 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 14 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -256,8 +256,8 @@ var-requires20: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of temperature receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -268,8 +268,8 @@ var-requires21: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of moisture receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-brightness-temperature.yml b/specs/groups/ncas-amof-2.0.0/amof-brightness-temperature.yml index 7bb9719..cdc386b 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-brightness-temperature.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-brightness-temperature.yml @@ -54,8 +54,8 @@ var-requires3: - dimension:time - units:1 - long_name:Data Quality flag: Surface Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires4: func: checksit.generic.check_var params: @@ -66,8 +66,8 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag: Surface Relative Humidity - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires5: func: checksit.generic.check_var params: @@ -78,8 +78,8 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag: Surface Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires6: func: checksit.generic.check_var params: @@ -90,8 +90,8 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag: Precipitation - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires7: func: checksit.generic.check_var params: @@ -102,8 +102,8 @@ var-requires7: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 1 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires8: func: checksit.generic.check_var params: @@ -114,8 +114,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 2 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -126,8 +126,8 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 3 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires10: func: checksit.generic.check_var params: @@ -138,8 +138,8 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 4 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -150,8 +150,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 5 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -162,8 +162,8 @@ var-requires12: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 6 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -174,8 +174,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 7 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -186,8 +186,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 8 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -198,8 +198,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 9 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -210,8 +210,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 10 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -222,8 +222,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 11 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -234,8 +234,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 12 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -246,8 +246,8 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 13 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -258,8 +258,8 @@ var-requires20: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 14 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -270,8 +270,8 @@ var-requires21: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of temperature receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires22: func: checksit.generic.check_var params: @@ -282,8 +282,8 @@ var-requires22: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of moisture receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-ch4-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-ch4-concentration.yml index e1a33dc..ba0d8c5 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-ch4-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-ch4-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-cloud-base.yml b/specs/groups/ncas-amof-2.0.0/amof-cloud-base.yml index 2b8e792..a949d12 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-cloud-base.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-cloud-base.yml @@ -176,8 +176,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: Cloud Base - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-cloud-coverage.yml b/specs/groups/ncas-amof-2.0.0/amof-cloud-coverage.yml index a614a43..6ead453 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-cloud-coverage.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-cloud-coverage.yml @@ -191,8 +191,8 @@ var-requires12: - dimension:time. layer_index - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-co-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-co-concentration.yml index 339a61c..d07c9f3 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-co-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-co-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-co-h2-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-co-h2-concentration.yml index e2b3590..156555b 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-co-h2-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-co-h2-concentration.yml @@ -132,8 +132,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: CO - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -144,5 +144,5 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: H2 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-co2-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-co2-concentration.yml index ea71727..95b34e3 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-co2-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-co2-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-depolarisation-ratio.yml b/specs/groups/ncas-amof-2.0.0/amof-depolarisation-ratio.yml index 80cbd95..e28bca5 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-depolarisation-ratio.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-depolarisation-ratio.yml @@ -153,8 +153,8 @@ var-requires10: - dimension:time, index_of_range, index_of_angle - units:1 - long_name:Data Quality flag: Attenuated backscatter coefficient (Planar Polarised) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -165,8 +165,8 @@ var-requires11: - dimension:time, index_of_range, index_of_angle - units:1 - long_name:Data Quality flag: Attenuated backscatter coefficient (Cross Polarised) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -177,8 +177,8 @@ var-requires12: - dimension:time, index_of_range, index_of_angle - units:1 - long_name:Data Quality flag: Depolarisation R - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-dew-point.yml b/specs/groups/ncas-amof-2.0.0/amof-dew-point.yml index 5a209c0..996ca2a 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-dew-point.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-dew-point.yml @@ -99,5 +99,5 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-flux-components.yml b/specs/groups/ncas-amof-2.0.0/amof-flux-components.yml index 6c5db7e..6ce042b 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-flux-components.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-flux-components.yml @@ -1125,8 +1125,8 @@ var-requires74: - dimension:time - units:1 - long_name:Quality flag: Skew U - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires75: func: checksit.generic.check_var params: @@ -1137,8 +1137,8 @@ var-requires75: - dimension:time - units:1 - long_name:Quality flag: Skew V - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires76: func: checksit.generic.check_var params: @@ -1149,8 +1149,8 @@ var-requires76: - dimension:time - units:1 - long_name:Quality flag: Skew W - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires77: func: checksit.generic.check_var params: @@ -1161,8 +1161,8 @@ var-requires77: - dimension:time - units:1 - long_name:Quality flag: Skew Ts - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires78: func: checksit.generic.check_var params: @@ -1173,8 +1173,8 @@ var-requires78: - dimension:time - units:1 - long_name:Quality flag: Kurtosis U - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires79: func: checksit.generic.check_var params: @@ -1185,8 +1185,8 @@ var-requires79: - dimension:time - units:1 - long_name:Quality flag: Kurtosis V - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires80: func: checksit.generic.check_var params: @@ -1197,8 +1197,8 @@ var-requires80: - dimension:time - units:1 - long_name:Quality flag: Kurtosis W - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires81: func: checksit.generic.check_var params: @@ -1209,8 +1209,8 @@ var-requires81: - dimension:time - units:1 - long_name:Quality flag: Kurtosis Ts - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires82: func: checksit.generic.check_var params: @@ -1221,8 +1221,8 @@ var-requires82: - dimension:time - units:1 - long_name:Quality flag: Steady State Class WU - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires83: func: checksit.generic.check_var params: @@ -1233,8 +1233,8 @@ var-requires83: - dimension:time - units:1 - long_name:Quality flag: Steady State Class WV - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires84: func: checksit.generic.check_var params: @@ -1245,8 +1245,8 @@ var-requires84: - dimension:time - units:1 - long_name:Quality flag: Steady State Class WTs - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires85: func: checksit.generic.check_var params: @@ -1257,8 +1257,8 @@ var-requires85: - dimension:time - units:1 - long_name:Quality flag: WU - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires86: func: checksit.generic.check_var params: @@ -1268,8 +1268,8 @@ var-requires86: - type:byte - dimension:time - units:1 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-flux-estimates.yml b/specs/groups/ncas-amof-2.0.0/amof-flux-estimates.yml index 0156d38..06710b8 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-flux-estimates.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-flux-estimates.yml @@ -172,8 +172,8 @@ var-requires11: - dimension:time - units:1 - long_name:Quality flag: Skew U - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -184,8 +184,8 @@ var-requires12: - dimension:time - units:1 - long_name:Quality flag: Skew V - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -196,8 +196,8 @@ var-requires13: - dimension:time - units:1 - long_name:Quality flag: Skew W - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -208,8 +208,8 @@ var-requires14: - dimension:time - units:1 - long_name:Quality flag: Skew Ts - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -220,8 +220,8 @@ var-requires15: - dimension:time - units:1 - long_name:Quality flag: Kurtosis U - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -232,8 +232,8 @@ var-requires16: - dimension:time - units:1 - long_name:Quality flag: Kurtosis V - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -244,8 +244,8 @@ var-requires17: - dimension:time - units:1 - long_name:Quality flag: Kurtosis W - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -256,8 +256,8 @@ var-requires18: - dimension:time - units:1 - long_name:Quality flag: Kurtosis Ts - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -268,8 +268,8 @@ var-requires19: - dimension:time - units:1 - long_name:Quality flag: Steady State Class WU - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -280,8 +280,8 @@ var-requires20: - dimension:time - units:1 - long_name:Quality flag: Steady State Class WV - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -292,8 +292,8 @@ var-requires21: - dimension:time - units:1 - long_name:Quality flag: Steady State Class WTs - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires22: func: checksit.generic.check_var params: @@ -304,8 +304,8 @@ var-requires22: - dimension:time - units:1 - long_name:Quality flag: WU - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires23: func: checksit.generic.check_var params: @@ -316,8 +316,8 @@ var-requires23: - dimension:time - units:1 - long_name:Quality flag: WV - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires24: func: checksit.generic.check_var params: @@ -328,8 +328,8 @@ var-requires24: - dimension:time - units:1 - long_name:Quality flag: WTs - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires25: func: checksit.generic.check_var params: @@ -340,5 +340,5 @@ var-requires25: - dimension:time - units:1 - long_name:Quality flag: General Turbulent Characteristic of W Class - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-full-troposphere-temperature-profiles.yml b/specs/groups/ncas-amof-2.0.0/amof-full-troposphere-temperature-profiles.yml index 2c0da28..b44ea97 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-full-troposphere-temperature-profiles.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-full-troposphere-temperature-profiles.yml @@ -40,8 +40,8 @@ var-requires2: - dimension:time - units:1 - long_name:Data Quality flag: Surface Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires3: func: checksit.generic.check_var params: @@ -52,8 +52,8 @@ var-requires3: - dimension:time - units:1 - long_name:Data Quality flag: Surface Relative Humidity - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires4: func: checksit.generic.check_var params: @@ -64,8 +64,8 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag: Surface Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires5: func: checksit.generic.check_var params: @@ -76,8 +76,8 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag: Precipitation - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires6: func: checksit.generic.check_var params: @@ -88,8 +88,8 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 1 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires7: func: checksit.generic.check_var params: @@ -100,8 +100,8 @@ var-requires7: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 2 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires8: func: checksit.generic.check_var params: @@ -112,8 +112,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 3 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -124,8 +124,8 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 4 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires10: func: checksit.generic.check_var params: @@ -136,8 +136,8 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 5 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -148,8 +148,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 6 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -160,8 +160,8 @@ var-requires12: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 7 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -172,8 +172,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 8 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -184,8 +184,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 9 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -196,8 +196,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 10 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -208,8 +208,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 11 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -220,8 +220,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 12 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -232,8 +232,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 13 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -244,8 +244,8 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 14 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -256,8 +256,8 @@ var-requires20: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of temperature receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -268,8 +268,8 @@ var-requires21: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of moisture receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-h2-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-h2-concentration.yml index e106b0d..0d6cff3 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-h2-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-h2-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-halocarbon-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-halocarbon-concentration.yml index d5c74f5..e8fafd0 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-halocarbon-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-halocarbon-concentration.yml @@ -534,8 +534,8 @@ var-requires36: - dimension:time - units:1 - long_name:Data Quality flag: CCl4 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires37: func: checksit.generic.check_var params: @@ -546,8 +546,8 @@ var-requires37: - dimension:time - units:1 - long_name:Data Quality flag: CHBr3 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires38: func: checksit.generic.check_var params: @@ -558,8 +558,8 @@ var-requires38: - dimension:time - units:1 - long_name:Data Quality flag: CH2I2 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires39: func: checksit.generic.check_var params: @@ -570,8 +570,8 @@ var-requires39: - dimension:time - units:1 - long_name:Data Quality flag: CH2ICl - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires40: func: checksit.generic.check_var params: @@ -582,8 +582,8 @@ var-requires40: - dimension:time - units:1 - long_name:Data Quality flag: CHBrCl2 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires41: func: checksit.generic.check_var params: @@ -594,8 +594,8 @@ var-requires41: - dimension:time - units:1 - long_name:Data Quality flag: CH2Br2 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires42: func: checksit.generic.check_var params: @@ -606,8 +606,8 @@ var-requires42: - dimension:time - units:1 - long_name:Data Quality flag: CHCl3 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires43: func: checksit.generic.check_var params: @@ -618,8 +618,8 @@ var-requires43: - dimension:time - units:1 - long_name:Data Quality flag: CH3I - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires44: func: checksit.generic.check_var params: @@ -630,5 +630,5 @@ var-requires44: - dimension:time - units:1 - long_name:Data Quality flag: CH2BrCl - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-iwv-lwp.yml b/specs/groups/ncas-amof-2.0.0/amof-iwv-lwp.yml index 3893184..028c94f 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-iwv-lwp.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-iwv-lwp.yml @@ -38,8 +38,8 @@ var-requires2: - dimension:time - units:1 - long_name:Data Quality flag: Surface Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires3: func: checksit.generic.check_var params: @@ -50,8 +50,8 @@ var-requires3: - dimension:time - units:1 - long_name:Data Quality flag: Surface Relative Humidity - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires4: func: checksit.generic.check_var params: @@ -62,8 +62,8 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag: Surface Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires5: func: checksit.generic.check_var params: @@ -74,8 +74,8 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag: Precipitation - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires6: func: checksit.generic.check_var params: @@ -86,8 +86,8 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 1 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires7: func: checksit.generic.check_var params: @@ -98,8 +98,8 @@ var-requires7: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 2 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires8: func: checksit.generic.check_var params: @@ -110,8 +110,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 3 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -122,8 +122,8 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 4 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires10: func: checksit.generic.check_var params: @@ -134,8 +134,8 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 5 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -146,8 +146,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 6 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -158,8 +158,8 @@ var-requires12: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 7 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -170,8 +170,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 8 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -182,8 +182,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 9 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -194,8 +194,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 10 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -206,8 +206,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 11 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -218,8 +218,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 12 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -230,8 +230,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 13 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -242,8 +242,8 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 14 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -254,8 +254,8 @@ var-requires20: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of temperature receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -266,5 +266,5 @@ var-requires21: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of moisture receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-liquid-water-content.yml b/specs/groups/ncas-amof-2.0.0/amof-liquid-water-content.yml index fcdfbaa..daf468f 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-liquid-water-content.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-liquid-water-content.yml @@ -22,5 +22,5 @@ var-requires1: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-mean-co2-h2o.yml b/specs/groups/ncas-amof-2.0.0/amof-mean-co2-h2o.yml index 0adfc48..a5dd9fc 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-mean-co2-h2o.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-mean-co2-h2o.yml @@ -198,8 +198,8 @@ var-requires12: - dimension:time - units:1 - long_name:Data Quality flag: Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -210,8 +210,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -222,8 +222,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Carbon Dioxide concentration - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -234,5 +234,5 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Water Vapor concentration - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-mean-winds-profile.yml b/specs/groups/ncas-amof-2.0.0/amof-mean-winds-profile.yml index 4a2d322..2981f34 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-mean-winds-profile.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-mean-winds-profile.yml @@ -211,8 +211,8 @@ var-requires13: - dimension:time, altitude - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-mean-winds.yml b/specs/groups/ncas-amof-2.0.0/amof-mean-winds.yml index 01da663..513aabd 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-mean-winds.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-mean-winds.yml @@ -225,8 +225,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Sonic Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -237,8 +237,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Wind Speed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -249,8 +249,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Wind Direction - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -261,8 +261,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Eastward Wind Component (U) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -273,8 +273,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: Northward Wind Component (V) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -285,5 +285,5 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: Upward Air Velocity Component (W) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-moisture-profiles.yml b/specs/groups/ncas-amof-2.0.0/amof-moisture-profiles.yml index a767a51..2e3434a 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-moisture-profiles.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-moisture-profiles.yml @@ -55,8 +55,8 @@ var-requires3: - dimension:time - units:1 - long_name:Data Quality flag: Surface Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires4: func: checksit.generic.check_var params: @@ -67,8 +67,8 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag: Surface Relative Humidity - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires5: func: checksit.generic.check_var params: @@ -79,8 +79,8 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag: Surface Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires6: func: checksit.generic.check_var params: @@ -91,8 +91,8 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag: Precipitation - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires7: func: checksit.generic.check_var params: @@ -103,8 +103,8 @@ var-requires7: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 1 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires8: func: checksit.generic.check_var params: @@ -115,8 +115,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 2 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -127,8 +127,8 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 3 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires10: func: checksit.generic.check_var params: @@ -139,8 +139,8 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 4 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -151,8 +151,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 5 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -163,8 +163,8 @@ var-requires12: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 6 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -175,8 +175,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 7 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -187,8 +187,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 8 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -199,8 +199,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 9 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -211,8 +211,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 10 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -223,8 +223,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 11 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -235,8 +235,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 12 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -247,8 +247,8 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 13 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -259,8 +259,8 @@ var-requires20: - dimension:time - units:1 - long_name:Data Quality flag: Receiver channel 14 failed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -271,8 +271,8 @@ var-requires21: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of temperature receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires22: func: checksit.generic.check_var params: @@ -283,8 +283,8 @@ var-requires22: - dimension:time - units:1 - long_name:Data Quality flag: Thermal stability of moisture receiver bank - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-n2o-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-n2o-concentration.yml index f913067..77599d7 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-n2o-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-n2o-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-n2o-sf6-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-n2o-sf6-concentration.yml index a9dadcb..4105e9f 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-n2o-sf6-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-n2o-sf6-concentration.yml @@ -128,8 +128,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: N2O - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -140,5 +140,5 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: SF6 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-no2-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-no2-concentration.yml index b680fce..febb054 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-no2-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-no2-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-nox-noxy-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-nox-noxy-concentration.yml index 883f78e..06c16cd 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-nox-noxy-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-nox-noxy-concentration.yml @@ -248,8 +248,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: NO - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -260,8 +260,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: NO2 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -272,8 +272,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: NOx - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -284,5 +284,5 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: NOy - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-o2n2-concentration-ratio.yml b/specs/groups/ncas-amof-2.0.0/amof-o2n2-concentration-ratio.yml index d0f7278..df63c9f 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-o2n2-concentration-ratio.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-o2n2-concentration-ratio.yml @@ -22,5 +22,5 @@ var-requires1: - dimension:time - units:1 - long_name:Data Quality Flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-o3-concentration-profile.yml b/specs/groups/ncas-amof-2.0.0/amof-o3-concentration-profile.yml index 38d6e31..2694eb2 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-o3-concentration-profile.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-o3-concentration-profile.yml @@ -86,8 +86,8 @@ var-requires5: - dimension:time, altitude - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-o3-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-o3-concentration.yml index d3806f0..b99037d 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-o3-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-o3-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-oh-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-oh-concentration.yml index 526f7f0..69ffc04 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-oh-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-oh-concentration.yml @@ -64,5 +64,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-particle-size-distribution.yml b/specs/groups/ncas-amof-2.0.0/amof-particle-size-distribution.yml index c0aebf2..22c4493 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-particle-size-distribution.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-particle-size-distribution.yml @@ -145,8 +145,8 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -157,8 +157,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -169,8 +169,8 @@ var-requires12: - dimension:time, index - units:1 - long_name:Data Quality flag: Instrument Counts - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -181,8 +181,8 @@ var-requires13: - dimension:time, index - units:1 - long_name:Data Quality flag: Ambient Particle Number per Channel - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-peroxyacetyl-nitrate-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-peroxyacetyl-nitrate-concentration.yml index 38ed41f..f088d15 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-peroxyacetyl-nitrate-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-peroxyacetyl-nitrate-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag: - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-pm-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-pm-concentration.yml index da1d5b0..d21657a 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-pm-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-pm-concentration.yml @@ -144,8 +144,8 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: PM1 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires10: func: checksit.generic.check_var params: @@ -156,8 +156,8 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: PM2.5 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires11: func: checksit.generic.check_var params: @@ -168,8 +168,8 @@ var-requires11: - dimension:time - units:1 - long_name:Data Quality flag: PM4 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires12: func: checksit.generic.check_var params: @@ -180,8 +180,8 @@ var-requires12: - dimension:time - units:1 - long_name:Data Quality flag: PM10 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires13: func: checksit.generic.check_var params: @@ -192,8 +192,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Total PM - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -204,8 +204,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Total Number - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -216,8 +216,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -228,8 +228,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Relative Humidity - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -240,5 +240,5 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-radiation.yml b/specs/groups/ncas-amof-2.0.0/amof-radiation.yml index d649f39..59f67fc 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-radiation.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-radiation.yml @@ -85,8 +85,8 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag: upwelling shortwave - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires6: func: checksit.generic.check_var params: @@ -97,8 +97,8 @@ var-requires6: - dimension:time - units:1 - long_name:Data Quality flag: downwelling shortwave - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires7: func: checksit.generic.check_var params: @@ -109,8 +109,8 @@ var-requires7: - dimension:time - units:1 - long_name:Data Quality flag: upwelling longwave - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires8: func: checksit.generic.check_var params: @@ -121,8 +121,8 @@ var-requires8: - dimension:time - units:1 - long_name:Data Quality flag: downwelling longwave - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires9: func: checksit.generic.check_var params: @@ -133,8 +133,8 @@ var-requires9: - dimension:time - units:1 - long_name:Data Quality flag: Body Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires10: func: checksit.generic.check_var params: @@ -145,5 +145,5 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag: sensor cleaning - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-rain-lwc-velocity-reflectivity.yml b/specs/groups/ncas-amof-2.0.0/amof-rain-lwc-velocity-reflectivity.yml index 27817be..65c3c9d 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-rain-lwc-velocity-reflectivity.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-rain-lwc-velocity-reflectivity.yml @@ -115,8 +115,8 @@ var-requires7: - dimension:time, altitude - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-size-concentration-spectra.yml b/specs/groups/ncas-amof-2.0.0/amof-size-concentration-spectra.yml index fc4253b..a6ee5a3 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-size-concentration-spectra.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-size-concentration-spectra.yml @@ -69,8 +69,8 @@ var-requires4: - dimension:time, altitude, index_bin - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-snr-winds.yml b/specs/groups/ncas-amof-2.0.0/amof-snr-winds.yml index 9dda624..605d024 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-snr-winds.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-snr-winds.yml @@ -281,8 +281,8 @@ var-requires18: - dimension:time, altitude - units:1 - long_name:Data Quality flag: Mean Winds - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -293,8 +293,8 @@ var-requires19: - dimension:time, altitude - units:1 - long_name:Data Quality flag: SNR Beam 1 (back panel) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -305,8 +305,8 @@ var-requires20: - dimension:time, altitude - units:1 - long_name:Data Quality flag: SNR Beam 2 (side panel) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -317,8 +317,8 @@ var-requires21: - dimension:time, altitude - units:1 - long_name:Data Quality flag: SNR Beam 3 (vertical beam from centre panel) - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires22: func: checksit.generic.check_var params: @@ -329,8 +329,8 @@ var-requires22: - dimension:time - units:1 - long_name:Data Quality flag: Rain Detected - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-so2-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-so2-concentration.yml index 4acb587..f29aac8 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-so2-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-so2-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-soil.yml b/specs/groups/ncas-amof-2.0.0/amof-soil.yml index 5e8c71c..020dfb6 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-soil.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-soil.yml @@ -55,8 +55,8 @@ var-requires3: - dimension:time, index - units:1 - long_name:Data Quality flag: Soil Heat Flux - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires4: func: checksit.generic.check_var params: @@ -67,8 +67,8 @@ var-requires4: - dimension:time, index - units:1 - long_name:Data Quality flag: Soil Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires5: func: checksit.generic.check_var params: @@ -79,8 +79,8 @@ var-requires5: - dimension:time, index - units:1 - long_name:Data Quality flag: Soil Water Potential - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags dims-requires: func: checksit.generic.check_dim_exists params: diff --git a/specs/groups/ncas-amof-2.0.0/amof-solar-actinic-flux.yml b/specs/groups/ncas-amof-2.0.0/amof-solar-actinic-flux.yml index ebf993e..9aa6140 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-solar-actinic-flux.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-solar-actinic-flux.yml @@ -78,5 +78,5 @@ var-requires5: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-sonde.yml b/specs/groups/ncas-amof-2.0.0/amof-sonde.yml index 13d9f1d..a02d105 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-sonde.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-sonde.yml @@ -164,5 +164,5 @@ var-requires10: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-surface-met.yml b/specs/groups/ncas-amof-2.0.0/amof-surface-met.yml index 57bed30..f9bd7ea 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-surface-met.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-surface-met.yml @@ -212,8 +212,8 @@ var-requires13: - dimension:time - units:1 - long_name:Data Quality flag: Temperature - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires14: func: checksit.generic.check_var params: @@ -224,8 +224,8 @@ var-requires14: - dimension:time - units:1 - long_name:Data Quality flag: Relative Humidity - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires15: func: checksit.generic.check_var params: @@ -236,8 +236,8 @@ var-requires15: - dimension:time - units:1 - long_name:Data Quality flag: Pressure - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires16: func: checksit.generic.check_var params: @@ -248,8 +248,8 @@ var-requires16: - dimension:time - units:1 - long_name:Data Quality flag: Wind Speed - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires17: func: checksit.generic.check_var params: @@ -260,8 +260,8 @@ var-requires17: - dimension:time - units:1 - long_name:Data Quality flag: Wind From Direction - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires18: func: checksit.generic.check_var params: @@ -272,8 +272,8 @@ var-requires18: - dimension:time - units:1 - long_name:Data Quality flag: Radiation - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires19: func: checksit.generic.check_var params: @@ -284,8 +284,8 @@ var-requires19: - dimension:time - units:1 - long_name:Data Quality flag: Precipitation - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires20: func: checksit.generic.check_var params: @@ -296,8 +296,8 @@ var-requires20: - dimension:time - units:1 - long_name:Data Quality Flag: Downwelling Total Irradiance - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires21: func: checksit.generic.check_var params: @@ -308,5 +308,5 @@ var-requires21: - dimension:time - units:1 - long_name:Data Quality Flag: Net Total Irradiance - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-tgm-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-tgm-concentration.yml index 2e02851..9fb3f03 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-tgm-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-tgm-concentration.yml @@ -70,5 +70,5 @@ var-requires4: - dimension:time - units:1 - long_name:Data Quality flag - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags diff --git a/specs/groups/ncas-amof-2.0.0/amof-voc-concentration.yml b/specs/groups/ncas-amof-2.0.0/amof-voc-concentration.yml index 30bdf36..83dbbfa 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-voc-concentration.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-voc-concentration.yml @@ -1034,8 +1034,8 @@ var-requires68: - dimension:time - units:1 - long_name:Data Quality flag: C2H6 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires69: func: checksit.generic.check_var params: @@ -1046,8 +1046,8 @@ var-requires69: - dimension:time - units:1 - long_name:Data Quality flag: C2H4 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires70: func: checksit.generic.check_var params: @@ -1058,8 +1058,8 @@ var-requires70: - dimension:time - units:1 - long_name:Data Quality flag: C3H8 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires71: func: checksit.generic.check_var params: @@ -1070,8 +1070,8 @@ var-requires71: - dimension:time - units:1 - long_name:Data Quality flag: C3H6 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires72: func: checksit.generic.check_var params: @@ -1082,8 +1082,8 @@ var-requires72: - dimension:time - units:1 - long_name:Data Quality flag: C4H10 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires73: func: checksit.generic.check_var params: @@ -1094,8 +1094,8 @@ var-requires73: - dimension:time - units:1 - long_name:Data Quality flag: C2H2 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires74: func: checksit.generic.check_var params: @@ -1106,8 +1106,8 @@ var-requires74: - dimension:time - units:1 - long_name:Data Quality flag: C5H12 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires75: func: checksit.generic.check_var params: @@ -1118,8 +1118,8 @@ var-requires75: - dimension:time - units:1 - long_name:Data Quality flag: C5H8 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags var-requires76: func: checksit.generic.check_var params: @@ -1130,5 +1130,5 @@ var-requires76: - dimension:time - units:1 - long_name:Data Quality flag: C6H6 - attr_rules: - - rule-func:check-qc-flags + rules_attrs: + - flag_values: rule-func:check-qc-flags From dc2d8f5f98cd5398eb84617d6cbf7c8a966859e9 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Thu, 21 Mar 2024 10:38:24 +0000 Subject: [PATCH 02/29] Correct dealing with errors and warnings from rules_attrs checks --- checksit/generic.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/checksit/generic.py b/checksit/generic.py index b0290e7..cb6b209 100644 --- a/checksit/generic.py +++ b/checksit/generic.py @@ -251,12 +251,14 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") elif attr_rule.startswith("rule-func:same-type-as"): var_checking_against = attr_rule.split(":")[-1] - errors.extend(rules.check( + rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), context = dct["variables"][var_checking_against].get("type"), label = f"[variables:******:{attr_key}]***", - )) + ) + errors.extend(rule_errors) + warnings.extend(rule_warnings) elif attr_rule.strip() == ("rule-func:check-qc-flags"): rule_errors, rule_warnings = rules.check( attr_rule, @@ -267,11 +269,14 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa errors.extend(rule_errors) warnings.extend(rule_warnings) else: - errors.extend(rules.check( + rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", - )) + ) + errors.extend(rule_errors) + warnings.extend(rule_warnings) + else: @@ -313,12 +318,14 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") elif attr_rule.startswith("rule-func:same-type-as"): var_checking_against = attr_rule.split(":")[-1] - errors.extend(rules.check( + rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), context = dct["variables"][var_checking_against].get("type"), label = f"[variables:******:{attr_key}]***", - )) + ) + errors.extend(rule_errors) + warnings.extend(rule_warnings) elif attr_rule.strip() == "rule-func:check-qc-flags": rule_errors, rule_warnings = rules.check( attr_rule, @@ -329,11 +336,13 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa errors.extend(rule_errors) warnings.extend(rule_warnings) else: - errors.extend(rules.check( + rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", - )) + ) + errors.extend(rule_errors) + warnings.extend(rule_warnings) return errors, warnings From 216410b6509bad042a22d3402330a27baf3faf2e Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Fri, 22 Mar 2024 10:05:57 +0000 Subject: [PATCH 03/29] Remove optional wording for non-optional variables --- checksit/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checksit/generic.py b/checksit/generic.py index cb6b209..c4b6719 100644 --- a/checksit/generic.py +++ b/checksit/generic.py @@ -282,7 +282,7 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa else: if variable not in dct["variables"].keys(): errors.append( - f"[variable**************:{variable}]: Optional variable does not exist in file. " + f"[variable**************:{variable}]: Variable does not exist in file. " f"{search_close_match(variable, dct['variables'].keys()) if not skip_spellcheck else ''}" ) else: From 7c98537d9ac891a0c0d78cee0d3345f38a94eaa9 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Fri, 22 Mar 2024 10:06:53 +0000 Subject: [PATCH 04/29] Add datetimeZ regex rule --- checksit/rules/rules.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/checksit/rules/rules.py b/checksit/rules/rules.py index 4802e53..43b6ee6 100644 --- a/checksit/rules/rules.py +++ b/checksit/rules/rules.py @@ -44,6 +44,10 @@ def __init__(self): "regex-rule": r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?", "example": "2023-11-17T15:00:00" }, + "datetimeZ": { + "regex-rule": r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z", + "example": "2023-11-17T15:00:00Z" + }, "datetime-or-na": { "regex-rule": r"(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?)|" + _NOT_APPLICABLE_RULES, "example": "2023-11-17T15:00:00" From 460d243f819f3c8d47eb19b98550525113e54281 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Fri, 22 Mar 2024 10:10:05 +0000 Subject: [PATCH 05/29] Change rule splitter from ", " to "||" --- checksit/rules/rules.py | 2 +- specs/groups/ncas-amof-2.0.0/amof-file-name.yml | 2 +- specs/groups/ncas-amof-2.0.0/amof-global-attrs.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/checksit/rules/rules.py b/checksit/rules/rules.py index 43b6ee6..f269e53 100644 --- a/checksit/rules/rules.py +++ b/checksit/rules/rules.py @@ -119,7 +119,7 @@ def check(self, rule_lookup, value, context=None, label=""): rule_lookup = re.sub(f"^{rules_prefix}:", "", rule_lookup) - rule_lookup_list = rule_lookup.split(", ") + rule_lookup_list = rule_lookup.split("||") for i in rule_lookup_list: diff --git a/specs/groups/ncas-amof-2.0.0/amof-file-name.yml b/specs/groups/ncas-amof-2.0.0/amof-file-name.yml index 1330394..c392120 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-file-name.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-file-name.yml @@ -5,4 +5,4 @@ file-name-format: instrument: __URL__raw.githubusercontent.com/ncasuk/ncas-data-instrument-vocabs/__latest__/AMF_CVs/AMF_ncas_instrument.json:ncas_instrument:__all__ data_product: __vocabs__:AMF_CVs/2.0.0/AMF_product:product rule_checks: - platform: rule-func:ceda-platform, rule-func-warning:ncas-platform + platform: rule-func:ceda-platform||rule-func-warning:ncas-platform diff --git a/specs/groups/ncas-amof-2.0.0/amof-global-attrs.yml b/specs/groups/ncas-amof-2.0.0/amof-global-attrs.yml index 24b843c..f81c2e4 100644 --- a/specs/groups/ncas-amof-2.0.0/amof-global-attrs.yml +++ b/specs/groups/ncas-amof-2.0.0/amof-global-attrs.yml @@ -4,7 +4,7 @@ required-global-attrs: vocab_attrs: source: __URL__raw.githubusercontent.com/ncasuk/ncas-data-instrument-vocabs/__latest__/AMF_CVs/AMF_ncas_instrument.json:ncas_instrument:__all__:description rules_attrs: - platform: rule-func:ceda-platform, rule-func-warning:ncas-platform + platform: rule-func:ceda-platform||rule-func-warning:ncas-platform Conventions: regex:CF-1.6,\sNCAS-AMF-2.0.0 instrument_manufacturer: rule-func:string-of-length:2+ instrument_model: rule-func:string-of-length:3+ From d24d23016b0fa06c2459ec1482101c93a04bac52 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Fri, 22 Mar 2024 10:16:36 +0000 Subject: [PATCH 06/29] Initial specs for metadata and global variables and attributes --- .../ncas-radar-1.0.0/coordinate-variables.yml | 26 +++++++++++ specs/groups/ncas-radar-1.0.0/dimensions.yml | 7 +++ .../groups/ncas-radar-1.0.0/global-attrs.yml | 46 +++++++++++++++++++ .../ncas-radar-1.0.0/global-variables.yml | 43 +++++++++++++++++ .../ncas-radar-1.0.0/location-variables.yml | 21 +++++++++ .../sensor-pointing-variables.yml | 24 ++++++++++ .../ncas-radar-1.0.0/sweep-variables.yml | 41 +++++++++++++++++ 7 files changed, 208 insertions(+) create mode 100644 specs/groups/ncas-radar-1.0.0/coordinate-variables.yml create mode 100644 specs/groups/ncas-radar-1.0.0/dimensions.yml create mode 100644 specs/groups/ncas-radar-1.0.0/global-attrs.yml create mode 100644 specs/groups/ncas-radar-1.0.0/global-variables.yml create mode 100644 specs/groups/ncas-radar-1.0.0/location-variables.yml create mode 100644 specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml create mode 100644 specs/groups/ncas-radar-1.0.0/sweep-variables.yml diff --git a/specs/groups/ncas-radar-1.0.0/coordinate-variables.yml b/specs/groups/ncas-radar-1.0.0/coordinate-variables.yml new file mode 100644 index 0000000..08fab02 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/coordinate-variables.yml @@ -0,0 +1,26 @@ +var-requires0: + func: checksit.generic.check_var + params: + variable: + - time + defined_attrs: + - type:double + - dimension:time + - standard_name:time + rules_attrs: + - long_name: rule-func:match-one-of:time_in_seconds_since_volume_start|time_since_time_reference + - units: regex:seconds since \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z +var-requires1: + func: checksit.generic.check_var + params: + variable: + - range + defined_attrs: + - type:float + - standard_name:projection_range_coordinate + - axis:radial_range_coordinate + rules_attrs: + - dimension: rule-func:match-one-of:range|sweep, range + - units: rule-func:match-one-of:metres|meters + - long_name: rule-func:string-of-length:5+ + - spacing_is_constant: rule-func:match-one-of:true|false diff --git a/specs/groups/ncas-radar-1.0.0/dimensions.yml b/specs/groups/ncas-radar-1.0.0/dimensions.yml new file mode 100644 index 0000000..114fb2e --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/dimensions.yml @@ -0,0 +1,7 @@ +dims-requires: + func: checksit.generic.check_dim_exists + params: + dimensions: + - time + - range + - sweep diff --git a/specs/groups/ncas-radar-1.0.0/global-attrs.yml b/specs/groups/ncas-radar-1.0.0/global-attrs.yml new file mode 100644 index 0000000..7ee8e45 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/global-attrs.yml @@ -0,0 +1,46 @@ +required-gloabl-attrs: + func: checksit.generic.check_global_attrs + params: + defined_attrs: + - Conventions + - title + - institution + - references + - history + - comment + - instrument_manufacturer + - instrument_model + - instrument_serial_number + - instrument_software + - instrument_software_version + - creator_name + - processing_software_version + - product_version + - processing_level + - project + - project_principal_investigator + - licence + - acknowledgement + - geospatial_bounds + - platform_altitude + - location_keywords + - processing_software_url + vocab_attrs: + source: __URL__raw.githubusercontent.com/ncasuk/ncas-data-instrument-vocabs/__latest__/AMF_CVs/AMF_ncas_instrument.json:ncas_instrument:__all__:description + instrument_name: __URL__raw.githubusercontent.com/ncasuk/ncas-data-instrument-vocabs/__latest__/AMF_CVs/AMF_ncas_instrument.json:ncas_instrument:__all__ + rules_attrs: + platform_is_mobile: rule-func:match-one-of:true|false + instrument_pid: regex-rule:valid-url-or-na + creator_email: regex-rule:valid-email + creator_url: regex-rule:valid-url||rule-func-warning:validate-orcid-ID + processing_level: rule-func:match-one-of:1|2|3 + last_revised_date: regex-rule:datetime + project_principal_investigator_email: regex-rule:valid-email + project_principal_investigator_url: regex-rule:valid-url||rule-func-warning:validate-orcid-ID + platform: rule-func:ceda-platform||rule-func-warning:ncas-platform + deployment_mode: rule-func:match-one-of:land|sea|air + time_coverage_start: regex-rule:datetimeZ + time_coverage_end: regex-rule:datetimeZ + regex_attrs: + product_version: ^v\d+\.\d+\.\d+$ + diff --git a/specs/groups/ncas-radar-1.0.0/global-variables.yml b/specs/groups/ncas-radar-1.0.0/global-variables.yml new file mode 100644 index 0000000..796db67 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/global-variables.yml @@ -0,0 +1,43 @@ +var-requires0: + func: checksit.generic.check_var + params: + variable: + - time_coverage_start + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:string_length[^,]* +var-requires1: + func: checksit.generic.check_var + params: + variable: + - time_coverage_end + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:string_length[^,]* +var-optional0: + func: checksit.generic.check_var + params: + variable: + - platform_type:__OPTIONAL__ + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:string_length[^,]* +var-optional1: + func: checksit.generic.check_var + params: + variable: + - time_reference:__OPTIONAL__ + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:string_length[^,]* +var-optional2: + func: checksit.generic.check_var + params: + variable: + - volume_number:__OPTIONAL__ + defined_attrs: + - type:int diff --git a/specs/groups/ncas-radar-1.0.0/location-variables.yml b/specs/groups/ncas-radar-1.0.0/location-variables.yml new file mode 100644 index 0000000..dd15e1c --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/location-variables.yml @@ -0,0 +1,21 @@ +var-requires0: + func: checksit.generic.check_var + params: + variable: + - latitude + defined_attrs: + - type:double +var-requires1: + func: checksit.generic.check_var + params: + variable: + - longitude + defined_attrs: + - type:double +var-requires2: + func: checksit.generic.check_var + params: + variable: + - altitude + defined_attrs: + - type:double diff --git a/specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml b/specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml new file mode 100644 index 0000000..1f26313 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml @@ -0,0 +1,24 @@ +var-requires0: + func: checksit.generic.check_var + params: + variable: + - azimuth + defined_attrs: + - type:float + - dimension:time + - units:degrees + - standard_name:ray_azimuth_angle + - long_name:azimuth_angle_from_true_north + - axis:radial_azimuth_coordinate +var-requires1: + func: checksit.generic.check_var + params: + variable: + - elevation + defined_attrs: + - type:float + - dimension:time + - units:degrees + - standard_name:ray_elevation_angle + - long_name:elevation_angle_from_horizontal_plane + - axis:radial_elevaton_coordinate diff --git a/specs/groups/ncas-radar-1.0.0/sweep-variables.yml b/specs/groups/ncas-radar-1.0.0/sweep-variables.yml new file mode 100644 index 0000000..c189523 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/sweep-variables.yml @@ -0,0 +1,41 @@ +var-requires0: + func: checksit.generic.check_var + params: + variable: + - sweep_number + defined_attrs: + - type:int + - dimension:sweep +var-requires1: + func: checksit.generic.check_var + params: + variable: + - sweep_mode + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:sweep, string_length[^,]* +var-requires2: + func: checksit.generic.check_var + params: + variable: + - fixed_angle + defined_attrs: + - type:float + - dimension:sweep +var-optional0: + func: checksit.generic.check_var + params: + variable: + - sweep_start_ray_index:__OPTIONAL__ + defined_attrs: + - type:int + - dimension:sweep +var-optional1: + func: checksit.generic.check_var + params: + variable: + - sweep_end_ray_index:__OPTIONAL__ + defined_attrs: + - type:int + - dimension:sweep From 14235cfbbfda107752c1f7489bcf67c3e5a82769 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 27 Mar 2024 09:37:40 +0000 Subject: [PATCH 07/29] Change rule splitter in specs --- .../ncas-image-v1.0/amof-image-global-attrs.yml | 12 ++++++------ specs/groups/ncas-image-v1.0/amof-photo.yml | 6 +++--- specs/groups/ncas-image-v1.0/amof-plot.yml | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/specs/groups/ncas-image-v1.0/amof-image-global-attrs.yml b/specs/groups/ncas-image-v1.0/amof-image-global-attrs.yml index 12c41ac..4a6f3ab 100644 --- a/specs/groups/ncas-image-v1.0/amof-image-global-attrs.yml +++ b/specs/groups/ncas-image-v1.0/amof-image-global-attrs.yml @@ -15,12 +15,12 @@ required-global-attrs: XMP-xmpRights:WebStatement: regex-warning:http://www.nationalarchives.gov.uk/doc/open-government-licence/ XMP-photoshop:Credit: regex-warning:National\sCentre\sfor\sAtmospheric\sScience\s\(NCAS\) # Source of the image - XMP-dc:Title: regex-rule:title, regex-rule-warning:title-data-product, rule-func:title_check + XMP-dc:Title: regex-rule:title||regex-rule-warning:title-data-product||rule-func:title_check # Instrument Scientist’s Details XMP-dc:Creator: rule-func-warning:list_of_names - XMP-iptcCore:CreatorWorkEmail: regex-rule-warning:ncas-email, regex-rule:valid-email - XMP-iptcExt:CreatorIdentifier: rule-func:validate_orcid_ID, rule-func-warning:url_checker + XMP-iptcCore:CreatorWorkEmail: regex-rule-warning:ncas-email||regex-rule:valid-email + XMP-iptcExt:CreatorIdentifier: rule-func:validate_orcid_ID||rule-func-warning:url_checker # Principal Investigator’s Details - XMP-iptcExt:ContributorName: regex-rule-warning:name-format, regex-rule-warning:name-characters - XMP-iptcExt:ContributorIdentifier: rule-func:validate_orcid_ID, rule-func-warning:url_checker - XMP-iptcExt:ContributorRole: regex:Project\sPrincipal\sInvestigator \ No newline at end of file + XMP-iptcExt:ContributorName: regex-rule-warning:name-format||regex-rule-warning:name-characters + XMP-iptcExt:ContributorIdentifier: rule-func:validate_orcid_ID||rule-func-warning:url_checker + XMP-iptcExt:ContributorRole: regex:Project\sPrincipal\sInvestigator diff --git a/specs/groups/ncas-image-v1.0/amof-photo.yml b/specs/groups/ncas-image-v1.0/amof-photo.yml index de31d3e..f64e57b 100644 --- a/specs/groups/ncas-image-v1.0/amof-photo.yml +++ b/specs/groups/ncas-image-v1.0/amof-photo.yml @@ -4,9 +4,9 @@ required-global-attrs: rules_attrs: # Location of a camera or an instrument (photo) XMP-iptcExt:LocationCreatedLocationName: regex-rule-warning:location - XMP-iptcExt:LocationCreatedGPSAltitude: regex-rule-warning:altitude-image-warning, regex-rule:altitude-image - XMP-iptcExt:LocationCreatedGPSLatitude: regex-rule:latitude-image, rule-func:latitude - XMP-iptcExt:LocationCreatedGPSLongitude: regex-rule:longitude-image, rule-func:longitude + XMP-iptcExt:LocationCreatedGPSAltitude: regex-rule-warning:altitude-image-warning||regex-rule:altitude-image + XMP-iptcExt:LocationCreatedGPSLatitude: regex-rule:latitude-image||rule-func:latitude + XMP-iptcExt:LocationCreatedGPSLongitude: regex-rule:longitude-image||rule-func:longitude # (Relation for photos) XMP-dc:Relation: regex-warning:(((i|I)sPartOf\shttps://catalogue.ceda.ac.uk/uuid/)|((i|I)sFormatOf\shttps://catalogue.ceda.ac.uk/uuid/))[a-z0-9]{32} XMP-dc:Relation: rule-func-warning:relation_url_checker diff --git a/specs/groups/ncas-image-v1.0/amof-plot.yml b/specs/groups/ncas-image-v1.0/amof-plot.yml index 935f5ff..c865b25 100644 --- a/specs/groups/ncas-image-v1.0/amof-plot.yml +++ b/specs/groups/ncas-image-v1.0/amof-plot.yml @@ -4,9 +4,9 @@ required-global-attrs: rules_attrs: # Location of a camera or an instrument (plots) XMP-iptcExt:LocationShownLocationName: regex-rule-warning:location - XMP-iptcExt:LocationShownGPSAltitude: regex-rule-warning:altitude-image-warning, regex-rule:altitude-image - XMP-iptcExt:LocationShownGPSLatitude: regex-rule:latitude-image, rule-func:latitude - XMP-iptcExt:LocationShownGPSLongitude: regex-rule:longitude-image, rule-func:longitude + XMP-iptcExt:LocationShownGPSAltitude: regex-rule-warning:altitude-image-warning||regex-rule:altitude-image + XMP-iptcExt:LocationShownGPSLatitude: regex-rule:latitude-image||rule-func:latitude + XMP-iptcExt:LocationShownGPSLongitude: regex-rule:longitude-image||rule-func:longitude # (For plots only) XMP-iptcExt:TemporalCoverageFrom: rule-func:validate-image-date-time XMP-iptcExt:TemporalCoverageTo: rule-func:validate-image-date-time From 155588070de0d9a1eff83912ab38b5875c0ed976 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 27 Mar 2024 11:22:15 +0000 Subject: [PATCH 08/29] Update tests for correct errors on non-optional variables --- tests/test_generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_generic.py b/tests/test_generic.py index dc48519..94a5853 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -278,7 +278,7 @@ def test_check_var(): variable = "var3" defined_attrs = ["long_name:Variable 3", "units:s"] errors, warnings = cg.check_var(dct, variable, defined_attrs, skip_spellcheck=True) - assert errors == ["[variable**************:var3]: Optional variable does not exist in file. "] + assert errors == ["[variable**************:var3]: Variable does not exist in file. "] assert warnings == [] # Test that the function correctly handles optional variables @@ -339,7 +339,7 @@ def test_check_var(): variable = "var2" dct = {"variables": {}} errors, warnings = cg.check_var(dct, variable, defined_attrs) - assert errors == ["[variable**************:var2]: Optional variable does not exist in file. "] + assert errors == ["[variable**************:var2]: Variable does not exist in file. "] assert warnings == [] From 2d0dfab2e4da11e826b6489402e1bfa41e7db9b1 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 27 Mar 2024 13:30:21 +0000 Subject: [PATCH 09/29] Set dimensions for scaler variables to --none-- Some variables in CfRadial and NCAS-RADAR require variables to either be scaler (i.e. have no dimensions) or have a defined dimension, which may result in the need to check the dimensions of a scaler variable. Previously, with scaler variables having dimensions listed as "" in the output from CDLReader.to_dict() function, trying to check dimensions would say it is undefined. This change allows checking whether a variable is a scaler (defined_attrs dimension:--none--) and allows checking if a variable is a scaler or has a defined dimension (rules_attrs dimension: rule-func:match-one-of:--none--|time). --- checksit/readers/cdl.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/checksit/readers/cdl.py b/checksit/readers/cdl.py index a040e40..6f5541a 100644 --- a/checksit/readers/cdl.py +++ b/checksit/readers/cdl.py @@ -12,7 +12,7 @@ def get_output(cmd): class CDLParser: - + CDL_SPLITTERS = ("dimensions:", "variables:", "data:", "}") def __init__(self, inpt, verbose=False): @@ -22,14 +22,14 @@ def __init__(self, inpt, verbose=False): self._check_format() def _parse(self, inpt): - if self.verbose: print(f"[INFO] Parsing input: {inpt[:100]}...") + if self.verbose: print(f"[INFO] Parsing input: {inpt[:100]}...") if inpt.endswith(".nc"): self.cdl = get_output(f"ncdump -h {inpt}") elif inpt.endswith(".cdl"): self.cdl = open(inpt).read() else: self.cdl = inpt - + cdl_lines = self.cdl.strip().split("\n") # Add "data:" and "}" to the CDL if they are not present - to aid parsing @@ -43,7 +43,7 @@ def _parse(self, inpt): if s not in cdl_lines: print(f"Please check your command - invalid file or CDL contents provided: '{inpt[:100]}...'") sys.exit(1) - + sections = self._get_sections(cdl_lines, split_patterns=self.CDL_SPLITTERS, start_at=1) # Re-split section 1 to separate variables from global attrs @@ -57,7 +57,7 @@ def _check_format(self): min_chars = 10 if len(source) < min_chars: - self.fmt_errors.append(f"[FORMAT:global_attributes:source] Must be at least {min_chars} characters, not {source}") + self.fmt_errors.append(f"[FORMAT:global_attributes:source] Must be at least {min_chars} characters, not {source}") def _get_sections(self, lines, split_patterns, start_at): split_patterns = deque(split_patterns) @@ -81,7 +81,7 @@ def _get_sections(self, lines, split_patterns, start_at): line_no_comments = re.split(r";\s+//.*$", line)[0].strip().rstrip(";").strip() if not line_no_comments.startswith("//"): current.append(line_no_comments) - + return sections def _split_vars_globals(self, content): @@ -127,11 +127,15 @@ def _construct_variables(self, content): variables[vocab_var_id] = vocabs.lookup(vocab_lookup) elif not var_id or not line.startswith(f"{var_id}:") and last_line.strip()[-1] != ",": # Add current collected variable to list if it exists - if current: + if current: variables[var_id] = current.copy() var_id, dtype, dimensions = self._parse_var_dtype_dims(line) - current = {"type": dtype, "dimension": ', '.join(dimensions)} + if dimensions == [""]: + dimensions = "--none--" + else: + dimensions = ", ".join(dimensions) + current = {"type": dtype, "dimension": dimensions} else: # key, value = [x.strip() for x in line.split(":", 1)[1].split("=", 1)] # Send last key and last value (from last iteration of loop) and line to get new value @@ -166,9 +170,9 @@ def _ordered_dict(self, content): for line in content: if self.verbose: print(f"WORKING ON LINE: {line}") - + # Cater for continuation lines for arrays of strings, etc -# if "=" in line: +# if "=" in line: # A new (key, value) pair is found # key, value = [x.strip() for x in line.lstrip(":").split("=", 1)] # else: @@ -184,7 +188,7 @@ def _ordered_dict(self, content): return resp def to_yaml(self): - return yaml.dump(self.to_dict(), Dumper=yaml.SafeDumper, + return yaml.dump(self.to_dict(), Dumper=yaml.SafeDumper, default_flow_style=False, sort_keys=False) def to_dict(self): From 819327f6558778a148587218b7d39a15b846cd22 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 27 Mar 2024 13:30:46 +0000 Subject: [PATCH 10/29] Add dimension rule funcs --- specs/groups/ncas-radar-1.0.0/location-variables.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specs/groups/ncas-radar-1.0.0/location-variables.yml b/specs/groups/ncas-radar-1.0.0/location-variables.yml index dd15e1c..984de77 100644 --- a/specs/groups/ncas-radar-1.0.0/location-variables.yml +++ b/specs/groups/ncas-radar-1.0.0/location-variables.yml @@ -5,6 +5,8 @@ var-requires0: - latitude defined_attrs: - type:double + rules_attrs: + - dimension: rule-func:match-one-of:--none--|time var-requires1: func: checksit.generic.check_var params: @@ -12,6 +14,8 @@ var-requires1: - longitude defined_attrs: - type:double + rules_attrs: + - dimension: rule-func:match-one-of:--none--|time var-requires2: func: checksit.generic.check_var params: @@ -19,3 +23,5 @@ var-requires2: - altitude defined_attrs: - type:double + rules_attrs: + - dimension: rule-func:match-one-of:--none--|time From 7b7111601d80e47efa521de14e98ed8fab81151f Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 27 Mar 2024 14:44:28 +0000 Subject: [PATCH 11/29] Add instrument parameters specs --- .../instrument-parameters.yml | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 specs/groups/ncas-radar-1.0.0/instrument-parameters.yml diff --git a/specs/groups/ncas-radar-1.0.0/instrument-parameters.yml b/specs/groups/ncas-radar-1.0.0/instrument-parameters.yml new file mode 100644 index 0000000..87e4ab7 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/instrument-parameters.yml @@ -0,0 +1,166 @@ +dims-optional: + func: checksit.generic.check_dim_exists + params: + dimensions: + - frequency:__OPTIONAL__ + - n_prts:__OPTIONAL__ + +var-optional0: + func: checksit.generic.check_var + params: + variable: + - frequency:__OPTIONAL__ + defined_attrs: + - dimension:frequency + - type:float + - units:s-1 + +var-optional1: + func: checksit.generic.check_var + params: + variable: + - follow_mode:__OPTIONAL__ + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:^sweep, string_length[^,]*$ + +var-optional2: + func: checksit.generic.check_var + params: + variable: + - pulse_width:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + - units:seconds + +var-requries3: + func: checksit.generic.check_var + params: + variable: + - rx_range_resolution:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + rules_attrs: + - units: rule-func:match-one-of:meters|metres + +var-optional4: + func: checksit.generic.check_var + params: + variable: + - prt_mode:__OPTIONAL__ + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:^sweep, string_length[^,]*$ + +var-optional5: + func: checksit.generic.check_var + params: + variable: + - prt:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + - units:seconds + +var-optional6: + func: checksit.generic.check_var + params: + variable: + - prt_ratio:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + +var-optional7: + func: checksit.generic.check_var + params: + variable: + - prt_sequence:__OPTIONAL__ + defined_attrs: + - dimension:time, n_prts + - type:float + - units:seconds + +var-optional8: + func: checksit.generic.check_var + params: + variable: + - polarization_mode:__OPTIONAL__ + defined_attrs: + - type:char + rules_attrs: + - dimension: regex:^sweep, string_length[^,]*$ + +var-optional9: + func: checksit.generic.check_var + params: + variable: + - polarization_sequence:__OPTIONAL__ + defined_attrs: + - dimension:sweep, n_prts + - type:char + +var-optional10: + func: checksit.generic.check_var + params: + variable: + - nyquist_velocity:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + rules_attrs: + - units: rule-func:match-one-of:m/s|m s-1 + +var-optional11: + func: checksit.generic.check_var + params: + variable: + - unambiguous_range:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + rules_attrs: + - units: rule-func:match-one-of:meters|metres + +var-optional12: + func: checksit.generic.check_var + params: + variable: + - n_samples:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:int + +var-optional13: + func: checksit.generic.check_var + params: + variable: + - radar_measured_sky_noise:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + - units:dBm + +var-optional14: + func: checksit.generic.check_var + params: + variable: + - radar_measured_cold_noise:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + - units:dBm + +var-optional15: + func: checksit.generic.check_var + params: + variable: + - radar_measured_hot_noise:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + - units:dBm From 8d0e336646b3730fce768687cd2cf769629b59fd Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 27 Mar 2024 15:06:26 +0000 Subject: [PATCH 12/29] Add radar parameters specs --- .../ncas-radar-1.0.0/radar-parameters.yml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 specs/groups/ncas-radar-1.0.0/radar-parameters.yml diff --git a/specs/groups/ncas-radar-1.0.0/radar-parameters.yml b/specs/groups/ncas-radar-1.0.0/radar-parameters.yml new file mode 100644 index 0000000..f64d0d6 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/radar-parameters.yml @@ -0,0 +1,70 @@ +var-optional0: + func: checksit.generic.check_var + params: + variable: + - radar_antenna_gain_h:__OPTIONAL__ + defined_attrs: + - dimension:--none-- + - type:float + - units:dB + +var-optional1: + func: checksit.generic.check_var + params: + variable: + - radar_antenna_gain_v:__OPTIONAL__ + defined_attrs: + - dimension:--none-- + - type:float + - units:dB + +var-optional2: + func: checksit.generic.check_var + params: + variable: + - radar_beam_width_h:__OPTIONAL__ + defined_attrs: + - dimension:--none-- + - type:float + - units:degrees + +var-optional3: + func: checksit.generic.check_var + params: + variable: + - radar_beam_width_v:__OPTIONAL__ + defined_attrs: + - dimension:--none-- + - type:float + - units:degrees + +var-optional4: + func: checksit.generic.check_var + params: + variable: + - radar_receiver_bandwidth:__OPTIONAL__ + defined_attrs: + - dimension:--none-- + - type:float + - units:s-1 + +var-optional5: + func: checksit.generic.check_var + params: + variable: + - radar_measured_transmit_power_h:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + - units:dBm + +var-optional6: + func: checksit.generic.check_var + params: + variable: + - radar_measured_transmit_power_v:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:float + - units:dBm + From 539625e3d437eae9d8324f8b1153d8a11a01904e Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Mon, 8 Apr 2024 09:16:46 +0100 Subject: [PATCH 13/29] Initial upload of radar calibration spec --- .../ncas-radar-1.0.0/radar-calibration.yml | 501 ++++++++++++++++++ 1 file changed, 501 insertions(+) create mode 100644 specs/groups/ncas-radar-1.0.0/radar-calibration.yml diff --git a/specs/groups/ncas-radar-1.0.0/radar-calibration.yml b/specs/groups/ncas-radar-1.0.0/radar-calibration.yml new file mode 100644 index 0000000..961a542 --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/radar-calibration.yml @@ -0,0 +1,501 @@ +dims-optional: + func: checksit.generic.check_dim_exists + params: + dimensions: + - r_calib:__OPTIONAL__ + +var-optional1: + func: checksit.generic.check_var + params: + variable: + - r_calib_index:__OPTIONAL__ + defined_attrs: + - dimension:time + - type:byte + +var-optional2: + func: checksit.generic.check_var + params: + variable: + - r_calib_time:__OPTIONAL__ + defined_attrs: + - type:char + - units:UTC + rules_attrs: + - dimension: regex:^r_calib, string_length[^,]*$ + +var-optional3: + func: checksit.generic.check_var + params: + variable: + - r_calib_pulse_width:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:seconds + +var-optional4: + func: checksit.generic.check_var + params: + variable: + - r_calib_antenna_gain_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional5: + func: checksit.generic.check_var + params: + variable: + - r_calib_antenna_gain_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional6: + func: checksit.generic.check_var + params: + variable: + - r_calib_xmit_power_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional7: + func: checksit.generic.check_var + params: + variable: + - r_calib_xmit_power_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional8: + func: checksit.generic.check_var + params: + variable: + - r_calib_two_way_waveguide_loss_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional9: + func: checksit.generic.check_var + params: + variable: + - r_calib_two_way_waveguide_loss_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional10: + func: checksit.generic.check_var + params: + variable: + - r_calib_two_way_radome_loss_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional11: + func: checksit.generic.check_var + params: + variable: + - r_calib_two_way_radome_loss_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional12: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_mismatch_loss:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional13: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_mismatch_loss_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional14: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_mismatch_loss_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional15: + func: checksit.generic.check_var + params: + variable: + - r_calib_radar_constant_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional16: + func: checksit.generic.check_var + params: + variable: + - r_calib_radar_constant_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional17: + func: checksit.generic.check_var + params: + variable: + - r_calib_probert_jones_correction:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional18: + func: checksit.generic.check_var + params: + variable: + - r_calib_dielectric_factor_used:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + +var-optional19: + func: checksit.generic.check_var + params: + variable: + - r_calib_noise_hc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional20: + func: checksit.generic.check_var + params: + variable: + - r_calib_noise_vc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional21: + func: checksit.generic.check_var + params: + variable: + - r_calib_noise_hx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional22: + func: checksit.generic.check_var + params: + variable: + - r_calib_noise_vx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional23: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_gain_hc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional24: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_gain_vc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional25: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_gain_hx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional26: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_gain_vx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional27: + func: checksit.generic.check_var + params: + variable: + - r_calib_base_1km_hc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBZ + +var-optional28: + func: checksit.generic.check_var + params: + variable: + - r_calib_base_1km_vc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBZ + +var-optional29: + func: checksit.generic.check_var + params: + variable: + - r_calib_base_1km_hx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBZ + +var-optional30: + func: checksit.generic.check_var + params: + variable: + - r_calib_base_1km_vx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBZ + +var-optional31: + func: checksit.generic.check_var + params: + variable: + - r_calib_sun_power_hc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional32: + func: checksit.generic.check_var + params: + variable: + - r_calib_sun_power_vc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional33: + func: checksit.generic.check_var + params: + variable: + - r_calib_sun_power_hx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional34: + func: checksit.generic.check_var + params: + variable: + - r_calib_sun_power_vx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional35: + func: checksit.generic.check_var + params: + variable: + - r_calib_noise_source_power_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional36: + func: checksit.generic.check_var + params: + variable: + - r_calib_noise_source_power_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional37: + func: checksit.generic.check_var + params: + variable: + - r_calib_power_measure_loss_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional38: + func: checksit.generic.check_var + params: + variable: + - r_calib_power_measure_loss_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional39: + func: checksit.generic.check_var + params: + variable: + - r_calib_coupler_forward_loss_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional40: + func: checksit.generic.check_var + params: + variable: + - r_calib_coupler_forward_loss_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional41: + func: checksit.generic.check_var + params: + variable: + - r_calib_zdr_correction:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional42: + func: checksit.generic.check_var + params: + variable: + - r_calib_ldr_correction_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional43: + func: checksit.generic.check_var + params: + variable: + - r_calib_ldr_correction_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dB + +var-optional44: + func: checksit.generic.check_var + params: + variable: + - r_calib_system_phidp:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:degrees + +var-optional45: + func: checksit.generic.check_var + params: + variable: + - r_calib_test_power_h:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional46: + func: checksit.generic.check_var + params: + variable: + - r_calib_test_power_v:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + - units:dBm + +var-optional47: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_slope_hc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + +var-optional48: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_slope_vc:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + +var-optional49: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_slope_hx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + +var-optional50: + func: checksit.generic.check_var + params: + variable: + - r_calib_receiver_slope_vx:__OPTIONAL__ + defined_attrs: + - dimension:r_calib + - type:float + From df65861bdcc98d0328d8dad72e961287b2ae45b2 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Mon, 8 Apr 2024 10:13:34 +0100 Subject: [PATCH 14/29] Update Conventions and remove duplicates --- specs/groups/ncas-radar-1.0.0/global-attrs.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/specs/groups/ncas-radar-1.0.0/global-attrs.yml b/specs/groups/ncas-radar-1.0.0/global-attrs.yml index 7ee8e45..4681e84 100644 --- a/specs/groups/ncas-radar-1.0.0/global-attrs.yml +++ b/specs/groups/ncas-radar-1.0.0/global-attrs.yml @@ -2,7 +2,6 @@ required-gloabl-attrs: func: checksit.generic.check_global_attrs params: defined_attrs: - - Conventions - title - institution - references @@ -15,8 +14,6 @@ required-gloabl-attrs: - instrument_software_version - creator_name - processing_software_version - - product_version - - processing_level - project - project_principal_investigator - licence @@ -42,5 +39,6 @@ required-gloabl-attrs: time_coverage_start: regex-rule:datetimeZ time_coverage_end: regex-rule:datetimeZ regex_attrs: + Conventions: CfRadial-1.4 NCAS-Radar-1.0 instrument_parameters radar-parameters radar-calibration product_version: ^v\d+\.\d+\.\d+$ From 9be90c033735bd0b017681dfb3007b34307a3eb9 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Mon, 8 Apr 2024 15:34:47 +0100 Subject: [PATCH 15/29] Add new check_radar_moment_variables function --- checksit/generic.py | 61 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/checksit/generic.py b/checksit/generic.py index c4b6719..3d972d0 100644 --- a/checksit/generic.py +++ b/checksit/generic.py @@ -415,3 +415,64 @@ def check_file_name(file_name, vocab_checks=None, rule_checks=None, **kwargs): errors.append(f"[file name]: Invalid file name format - too many options in file name") return errors, warnings + +def check_radar_moment_variables(dct, exist_attrs=None, rule_attrs=None, one_of_attrs=None, skip_spellcheck=False): + """ + Finds moment variables in radar file, runs checks against all those variables + """ + exist_attrs = exist_attrs or [] + rule_attrs = rule_attrs or {} + one_of_attrs = one_of_attrs or [] + + errors = [] + warnings = [] + + moment_variables = [] + for radarvariable, radarattributes in dct["variables"].items(): + if isinstance(radarattributes, dict) and "coordinates" in radarattributes.keys(): + moment_variables.append(radarvariable) + + for variable in moment_variables: + for attr in exist_attrs: + if attr not in dct["variables"][variable]: + errors.append( + f"[variable**************:{variable}]: Attribute '{attr}' does not exist. " + f"{search_close_match(attr, dct["variables"][variable]) if not skip_spellcheck else ''}" + ) + for attr in rule_attrs: + if isinstance(attr, dict) and len(attr.keys()) == 1: + for key, value in attr.items(): + attr = f"{key}:{value}" + attr_key = attr.split(":")[0] + attr_rule = ":".join(attr.split(":")[1:]) + if attr_key not in dct["variables"][variable]: + errors.append( + f"[variable:**************:{variable}]: Attribute '{attr_key}' does not exist. " + f"{search_close_match(attr_key, dct['variables'][variable].keys()) if not skip_spellcheck else ''}" + ) + elif is_undefined(dct["variables"][variable].get(attr_key)): + errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") + else: + rule_errors, rule_warnings = rules.check( + attr_rule, + dct["variables"][variable].get(attr_key), + label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", + ) + errors.extend(rule_errors) + warnings.extend(rule_warnings) + for attrs in one_of_attrs: + attr_options = attrs.split("|") + matches = 0 + for attr in attr_options: + if attr in dct['variables'][variable]: + matches += 1 + if matches == 0: + errors.append( +f"[variable:**************:{variable}]: One attribute of '{attr_options}' must be defined." + ) + elif matches > 1: + errors.append( +f"[variable:**************:{variable}]: Only one of '{attr_options}' should be defined, {matches} found." + ) + + return errors, warnings From a9dc8cecf49e87ac043c45f30fdf2dc3d478fbf6 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Mon, 8 Apr 2024 15:35:29 +0100 Subject: [PATCH 16/29] Add moment variables spec --- specs/groups/ncas-radar-1.0.0/moment-variables.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 specs/groups/ncas-radar-1.0.0/moment-variables.yml diff --git a/specs/groups/ncas-radar-1.0.0/moment-variables.yml b/specs/groups/ncas-radar-1.0.0/moment-variables.yml new file mode 100644 index 0000000..11983dc --- /dev/null +++ b/specs/groups/ncas-radar-1.0.0/moment-variables.yml @@ -0,0 +1,11 @@ +var-requires: + func: checksit.generic.check_radar_moment_variables + params: + exist_attrs: + - units + - long_name + - _FillValue + rule_attrs: + - coordinates: rule-func:match-one-of:elevation azimuth range|elevation azimuth range heading roll pitch rotation tilt + one_of_attrs: + - standard_name|proposed_standard_name From 3793169f5edca6e1538288fb8ed831a34b071625 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Tue, 9 Apr 2024 11:25:54 +0100 Subject: [PATCH 17/29] Allow slightly different ordering in conventions --- specs/groups/ncas-radar-1.0.0/global-attrs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/groups/ncas-radar-1.0.0/global-attrs.yml b/specs/groups/ncas-radar-1.0.0/global-attrs.yml index 4681e84..5c15635 100644 --- a/specs/groups/ncas-radar-1.0.0/global-attrs.yml +++ b/specs/groups/ncas-radar-1.0.0/global-attrs.yml @@ -39,6 +39,6 @@ required-gloabl-attrs: time_coverage_start: regex-rule:datetimeZ time_coverage_end: regex-rule:datetimeZ regex_attrs: - Conventions: CfRadial-1.4 NCAS-Radar-1.0 instrument_parameters radar-parameters radar-calibration + Conventions: ^(NCAS-Radar-1\.0|CfRadial-1\.4) (NCAS-Radar-1\.0|CfRadial-1\.4) instrument_parameters radar_parameters radar_calibration$ product_version: ^v\d+\.\d+\.\d+$ From 506f256d6a997b1fb9c0b2807e72a7027cab580e Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Tue, 9 Apr 2024 11:26:48 +0100 Subject: [PATCH 18/29] Remove fill value existence check --- specs/groups/ncas-radar-1.0.0/moment-variables.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/specs/groups/ncas-radar-1.0.0/moment-variables.yml b/specs/groups/ncas-radar-1.0.0/moment-variables.yml index 11983dc..d992ff6 100644 --- a/specs/groups/ncas-radar-1.0.0/moment-variables.yml +++ b/specs/groups/ncas-radar-1.0.0/moment-variables.yml @@ -4,7 +4,6 @@ var-requires: exist_attrs: - units - long_name - - _FillValue rule_attrs: - coordinates: rule-func:match-one-of:elevation azimuth range|elevation azimuth range heading roll pitch rotation tilt one_of_attrs: From 9b460ee79a52b3abf97eddec38ff34f721067d20 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Tue, 9 Apr 2024 12:51:08 +0100 Subject: [PATCH 19/29] Typo correction --- specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml b/specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml index 1f26313..3985161 100644 --- a/specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml +++ b/specs/groups/ncas-radar-1.0.0/sensor-pointing-variables.yml @@ -21,4 +21,4 @@ var-requires1: - units:degrees - standard_name:ray_elevation_angle - long_name:elevation_angle_from_horizontal_plane - - axis:radial_elevaton_coordinate + - axis:radial_elevation_coordinate From e5170b2f117a85490c4cd16ce6c039e13f1bf8f9 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Tue, 9 Apr 2024 13:04:53 +0100 Subject: [PATCH 20/29] Fix nested quotes inside f strings for pre python 3.12 --- checksit/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checksit/generic.py b/checksit/generic.py index 3d972d0..1a632a6 100644 --- a/checksit/generic.py +++ b/checksit/generic.py @@ -437,7 +437,7 @@ def check_radar_moment_variables(dct, exist_attrs=None, rule_attrs=None, one_of_ if attr not in dct["variables"][variable]: errors.append( f"[variable**************:{variable}]: Attribute '{attr}' does not exist. " - f"{search_close_match(attr, dct["variables"][variable]) if not skip_spellcheck else ''}" + f"{search_close_match(attr, dct['variables'][variable]) if not skip_spellcheck else ''}" ) for attr in rule_attrs: if isinstance(attr, dict) and len(attr.keys()) == 1: From 68cb8d5d73429d9a20de504226947209653c040f Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 10 Apr 2024 11:32:07 +0100 Subject: [PATCH 21/29] Add function to check dimensions against regex --- checksit/generic.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/checksit/generic.py b/checksit/generic.py index 1a632a6..54f2fda 100644 --- a/checksit/generic.py +++ b/checksit/generic.py @@ -160,7 +160,7 @@ def check_var_exists(dct, variables, skip_spellcheck=False): def check_dim_exists(dct, dimensions, skip_spellcheck=False): """ - Check that variables exist + Check that dimensions exist E.g. check-dim-exists:dimensions:time|latitude """ @@ -185,6 +185,35 @@ def check_dim_exists(dct, dimensions, skip_spellcheck=False): return errors, warnings +def check_dim_regex(dct, regex_dims, skip_spellcheck=False): + """ + Check dimension exists matching regex + + E.g. check-dime-regex:regex-dims:^string_length[^,]*$ + """ + errors = [] + warnings = [] + for regex_dim in regex_dims: + if regex_dim.endswith(":__OPTIONAL__"): + regex_dim = ":".join(regex_dim.split(":")[:-1]) + r = re.compile(regex_dim) + matches = list(filter(r.match, dct["dimensions"].keys())) + #if not re.match(regex_dim, dct["dimensions"].keys()): + if len(matches) == 0: + warnings.append( + f"[dimension**************:{regex_dim}]: No dimension matching optional regex check in file. " + ) + else: + r = re.compile(regex_dim) + matches = list(filter(r.match, dct["dimensions"].keys())) + #if not re.match(regex_dim, dct["dimensions"].keys()): + if len(matches) == 0: + errors.append( + f"[dimension**************:{regex_dim}]: No dimension matching regex check in file. " + ) + return errors, warnings + + def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=False): """ Check variable exists and has attributes defined. From 9fe598eccd35a57a6f43b582a88064e00da86aed Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 10 Apr 2024 11:32:35 +0100 Subject: [PATCH 22/29] Regex check for string_length dimensions --- specs/groups/ncas-radar-1.0.0/dimensions.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specs/groups/ncas-radar-1.0.0/dimensions.yml b/specs/groups/ncas-radar-1.0.0/dimensions.yml index 114fb2e..23d1c0c 100644 --- a/specs/groups/ncas-radar-1.0.0/dimensions.yml +++ b/specs/groups/ncas-radar-1.0.0/dimensions.yml @@ -5,3 +5,9 @@ dims-requires: - time - range - sweep + +dim-requires1: + func: checksit.generic.check_dim_regex + params: + regex_dims: + - ^string_length[^,]*$ From 03148ec3e89a5d530c9e1818236c1ba1337ad53a Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Thu, 11 Apr 2024 08:43:54 +0100 Subject: [PATCH 23/29] Remove old commented out code --- checksit/generic.py | 53 ++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/checksit/generic.py b/checksit/generic.py index 8679c57..3742769 100644 --- a/checksit/generic.py +++ b/checksit/generic.py @@ -242,7 +242,6 @@ def check_dim_regex(dct, regex_dims, skip_spellcheck=False): regex_dim = ":".join(regex_dim.split(":")[:-1]) r = re.compile(regex_dim) matches = list(filter(r.match, dct["dimensions"].keys())) - #if not re.match(regex_dim, dct["dimensions"].keys()): if len(matches) == 0: warnings.append( f"[dimension**************:{regex_dim}]: No dimension matching optional regex check in file. " @@ -250,7 +249,6 @@ def check_dim_regex(dct, regex_dims, skip_spellcheck=False): else: r = re.compile(regex_dim) matches = list(filter(r.match, dct["dimensions"].keys())) - #if not re.match(regex_dim, dct["dimensions"].keys()): if len(matches) == 0: errors.append( f"[dimension**************:{regex_dim}]: No dimension matching regex check in file. " @@ -326,14 +324,16 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa f"{search_close_match(attr_key, dct['variables'][variable].keys()) if not skip_spellcheck else ''}" ) elif is_undefined(dct["variables"][variable].get(attr_key)): - errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") + errors.append( + f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'." + ) elif attr_rule.startswith("rule-func:same-type-as"): var_checking_against = attr_rule.split(":")[-1] rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), - context = dct["variables"][var_checking_against].get("type"), - label = f"[variables:******:{attr_key}]***", + context=dct["variables"][var_checking_against].get("type"), + label=f"[variables:******:{attr_key}]***", ) errors.extend(rule_errors) warnings.extend(rule_warnings) @@ -341,8 +341,8 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get("flag_values"), - context = dct["variables"][variable].get("flag_meanings"), - label = f"[variable******:{variable}]: ", + context=dct["variables"][variable].get("flag_meanings"), + label=f"[variable******:{variable}]: ", ) errors.extend(rule_errors) warnings.extend(rule_warnings) @@ -350,12 +350,11 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), - label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", + label=f"[variables:******:{variable}] Value of attribute '{attr_key}' -", ) errors.extend(rule_errors) warnings.extend(rule_warnings) - else: if variable not in dct["variables"].keys(): errors.append( @@ -392,14 +391,16 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa f"{search_close_match(attr_key, dct['variables'][variable].keys()) if not skip_spellcheck else ''}" ) elif is_undefined(dct["variables"][variable].get(attr_key)): - errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") + errors.append( + f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'." + ) elif attr_rule.startswith("rule-func:same-type-as"): var_checking_against = attr_rule.split(":")[-1] rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), - context = dct["variables"][var_checking_against].get("type"), - label = f"[variables:******:{attr_key}]***", + context=dct["variables"][var_checking_against].get("type"), + label=f"[variables:******:{attr_key}]***", ) errors.extend(rule_errors) warnings.extend(rule_warnings) @@ -407,8 +408,8 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get("flag_values"), - context = dct["variables"][variable].get("flag_meanings"), - label = f"[variable******:{variable}]: ", + context=dct["variables"][variable].get("flag_meanings"), + label=f"[variable******:{variable}]: ", ) errors.extend(rule_errors) warnings.extend(rule_warnings) @@ -416,7 +417,7 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), - label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", + label=f"[variables:******:{variable}] Value of attribute '{attr_key}' -", ) errors.extend(rule_errors) warnings.extend(rule_warnings) @@ -519,7 +520,10 @@ def check_file_name(file_name, vocab_checks=None, rule_checks=None, **kwargs): return errors, warnings -def check_radar_moment_variables(dct, exist_attrs=None, rule_attrs=None, one_of_attrs=None, skip_spellcheck=False): + +def check_radar_moment_variables( + dct, exist_attrs=None, rule_attrs=None, one_of_attrs=None, skip_spellcheck=False +): """ Finds moment variables in radar file, runs checks against all those variables """ @@ -532,7 +536,10 @@ def check_radar_moment_variables(dct, exist_attrs=None, rule_attrs=None, one_of_ moment_variables = [] for radarvariable, radarattributes in dct["variables"].items(): - if isinstance(radarattributes, dict) and "coordinates" in radarattributes.keys(): + if ( + isinstance(radarattributes, dict) + and "coordinates" in radarattributes.keys() + ): moment_variables.append(radarvariable) for variable in moment_variables: @@ -554,12 +561,14 @@ def check_radar_moment_variables(dct, exist_attrs=None, rule_attrs=None, one_of_ f"{search_close_match(attr_key, dct['variables'][variable].keys()) if not skip_spellcheck else ''}" ) elif is_undefined(dct["variables"][variable].get(attr_key)): - errors.append(f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'.") + errors.append( + f"[variable:**************:{variable}]: No value defined for attribute '{attr_key}'." + ) else: rule_errors, rule_warnings = rules.check( attr_rule, dct["variables"][variable].get(attr_key), - label = f"[variables:******:{variable}] Value of attribute '{attr_key}' -", + label=f"[variables:******:{variable}] Value of attribute '{attr_key}' -", ) errors.extend(rule_errors) warnings.extend(rule_warnings) @@ -567,15 +576,15 @@ def check_radar_moment_variables(dct, exist_attrs=None, rule_attrs=None, one_of_ attr_options = attrs.split("|") matches = 0 for attr in attr_options: - if attr in dct['variables'][variable]: + if attr in dct["variables"][variable]: matches += 1 if matches == 0: errors.append( -f"[variable:**************:{variable}]: One attribute of '{attr_options}' must be defined." + f"[variable:**************:{variable}]: One attribute of '{attr_options}' must be defined." ) elif matches > 1: errors.append( -f"[variable:**************:{variable}]: Only one of '{attr_options}' should be defined, {matches} found." + f"[variable:**************:{variable}]: Only one of '{attr_options}' should be defined, {matches} found." ) return errors, warnings From 2d7bc59a5cc9b7c5c1d842f82079d6265c6685c8 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Fri, 12 Apr 2024 10:32:15 +0100 Subject: [PATCH 24/29] Detect NCAS-Radar and apply specs --- checksit/check.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/checksit/check.py b/checksit/check.py index 2d0eaf6..89f92eb 100644 --- a/checksit/check.py +++ b/checksit/check.py @@ -375,8 +375,31 @@ def _get_ncas_specs( # don't need to do template check template = "off" - # NCAS-RADAR (coming soon...) - # if "NCAS-Radar" in conventions + # NCAS-Radar + elif "NCAS-Radar" in conventions: + version_number = ( + conventions[conventions.index("NCAS-") :] + .split("-")[2] + .split(" ")[0] + .replace('"', "") + ) + if version_number.count(".") == 1: + version_number = f"{version_number}.0" + template = "off" + spec_names = [ + "coordinate-variables", + "dimensions", + "global-attrs", + "global-variables", + "instrument-parameters", + "location-variables", + "moment-variables", + "radar-calibration", + "radar-parameters", + "sensor-pointing-variables", + "sweep-variables", + ] + specs = [f"ncas-radar-{version_number}/{spec}" for spec in spec_names] elif ( file_path.split(".")[-1].lower() in IMAGE_EXTENSIONS From 8aac884918b42223f70adce0b8496591ecf0942a Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Fri, 12 Apr 2024 14:47:22 +0100 Subject: [PATCH 25/29] Update tests with new functionality --- tests/test_generic.py | 84 +++++++++++++++++++++++++++ tests/test_readers.py | 5 +- tests/test_rules.py | 7 +++ tests/testdata/netcdf/test_netcdf.nc | Bin 16192 -> 16520 bytes 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/tests/test_generic.py b/tests/test_generic.py index 94a5853..1ef8d27 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -266,6 +266,54 @@ def test_check_dim_exists(): assert warnings == [] +def test_check_dim_regex(): + dct = { + "dimensions": { + "first_dim": {}, + "second_dim": {}, + } + } + # Test function correctly identifies no matching dimension + dim_regex = [r"^third_.*$"] + errors, warnings = cg.check_dim_regex(dct, dim_regex) + assert errors == ["[dimension**************:^third_.*$]: No dimension matching regex check in file. "] + assert warnings == [] + + # Test function correctly identifies no matching optional dimensions + dim_regex = [r"^third_.*$:__OPTIONAL__"] + errors, warnings = cg.check_dim_regex(dct, dim_regex) + assert errors == [] + assert warnings == ["[dimension**************:^third_.*$]: No dimension matching optional regex check in file. "] + + # Test function correctly identifies one and multiple matching dimensions + dim_regex = [r"first_.*$"] + errors, warnings = cg.check_dim_regex(dct, dim_regex) + assert errors == [] + assert warnings == [] + + dim_regex = [r"^[^_]*_dim$"] + errors, warnings = cg.check_dim_regex(dct, dim_regex) + assert errors == [] + assert warnings == [] + + # Test function correctly idenfies one and multiple matching optional dimensions + dim_regex = [r"second_.*$:__OPTIONAL__"] + errors, warnings = cg.check_dim_regex(dct, dim_regex) + assert errors == [] + assert warnings == [] + + dim_regex = [r"^[^_]*_dim$:__OPTIONAL__"] + errors, warnings = cg.check_dim_regex(dct, dim_regex) + assert errors == [] + assert warnings == [] + + # Test function correctly handles multiple regex checks + dim_regex = [r"first_.*$", r"^third_.*$:__OPTIONAL__"] + errors, warnings = cg.check_dim_regex(dct, dim_regex) + assert errors == [] + assert warnings == ["[dimension**************:^third_.*$]: No dimension matching optional regex check in file. "] + + def test_check_var(): # Test that the function correctly identifies missing variables dct = { @@ -414,3 +462,39 @@ def test_check_file_name(): errors, warnings = cg.check_file_name(file_name, vocab_checks, rule_checks) assert errors == [] assert warnings == [] + + +def test_check_radar_moment_variables(): + dct = { + "variables": { + "var1": { # moment variable + "coordinates": "some coordinates", + "attribute1": "attribute1_value", + "attribute2": "attribute2_value", + "attribute3": "attribute3_value", + }, + "var2": { # moment variable + "coordinates": "some other coordinates", + "attribute1": "attribute1_value", + "attribute2": "not_attribute2_value", + }, + "var3": { # not moment variable + "attribute1": "attribute1_value", + }, + }, + } + # Test for existence of some attributes in moment variables + exist_attrs = ["attribute1", "attribute2", "attribute3"] + errors, warnings = cg.check_radar_moment_variables(dct, exist_attrs = exist_attrs, skip_spellcheck = True) + assert errors == ["[variable**************:var2]: Attribute 'attribute3' does not exist. "] + assert warnings == [] + + # Test rule attrs and one_of_attrs + rule_attrs = ["attribute1:regex:attribute1_value", "attribute2:regex:attribute2_value"] + one_of_attrs = ["attribute3|attribute4"] + errors, warnings = cg.check_radar_moment_variables(dct, rule_attrs = rule_attrs, one_of_attrs = one_of_attrs) + assert errors == [ + "[variables:******:var2] Value of attribute 'attribute2' - Value 'not_attribute2_value' does not match regular expression: 'attribute2_value'.", + "[variable:**************:var2]: One attribute of '['attribute3', 'attribute4']' must be defined." + ] + assert warnings == [] diff --git a/tests/test_readers.py b/tests/test_readers.py index b1419bb..a8975c8 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -44,6 +44,7 @@ def test_cdl_reader_netcdf(): assert sorted(d.keys()) == sorted(["global_attributes", "dimensions", "variables", "inpt"]) assert list(d["global_attributes"].keys()) == ["test_attribute_name"] assert d["global_attributes"]["test_attribute_name"] == "test_attribute_value" - assert list(d["variables"].keys()) == ["T"] + assert list(d["variables"].keys()) == ["T", "P"] assert sorted(d["dimensions"].keys()) == sorted(["x", "y", "z"]) - assert d["inpt"] == ncfile \ No newline at end of file + assert d["variables"]["P"]["dimension"] == "--none--" + assert d["inpt"] == ncfile diff --git a/tests/test_rules.py b/tests/test_rules.py index 1581166..f24c117 100644 --- a/tests/test_rules.py +++ b/tests/test_rules.py @@ -307,6 +307,13 @@ def test_datetime_rule(rules): assert not re.fullmatch(rules['datetime']['regex-rule'], '2022-01-01T00:00') assert not re.fullmatch(rules['datetime']['regex-rule'], '2022-01-01') +def test_datetimeZ_rule(rules): + assert re.fullmatch(rules['datetimeZ']['regex-rule'], '2023-11-17T15:00:00Z') + assert re.fullmatch(rules['datetimeZ']['regex-rule'], '2023-11-17T15:00:00.000Z') + assert not re.fullmatch(rules['datetimeZ']['regex-rule'], '2023-11-17T15:00:00') + assert not re.fullmatch(rules['datetimeZ']['regex-rule'], '2023-11-17 15:00:00Z') + assert not re.fullmatch(rules['datetimeZ']['regex-rule'], '2023-11-17T15:00Z') + def test_datetime_or_na_rule(rules): assert re.fullmatch(rules['datetime-or-na']['regex-rule'], '2022-01-01T00:00:00') assert re.fullmatch(rules['datetime-or-na']['regex-rule'], '2022-01-01T00:00:00.123') diff --git a/tests/testdata/netcdf/test_netcdf.nc b/tests/testdata/netcdf/test_netcdf.nc index 27f90ca776a6536d02ceaa7e5419d1bdd4a21479..394815145d59bfe9c903afc025adae0225e06d5e 100644 GIT binary patch delta 194 zcmX?5*U`v0K}My+fdLE*AQZ!dHtkFP9xg#lJX@HQz+%j-6CKp~1q47G9|y1ygU!UM z99|X(n}LC4ADi^X_knh9V2z9njEq1jCZH@c4+EnB2T%c6r2+#h7Xu@+7Kq2lz|g=U r1XRKJ9}3{69hkh3;}AzH-)4V*XAkd*=}KZSDaHT?dx)K1OUmN_e?22G delta 68 zcmeBZWIRweK}N;Fo&gLDAQXfB%SoL69xg#lJX@HQz+%iS6CKni2RJBAY>njvi(F{m KQNQthpdA3`;}9DF From 26b25da641f43e72ed3bf69e678cbbcb4271adda Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Mon, 22 Apr 2024 17:07:20 +0100 Subject: [PATCH 26/29] Fix checking number of qc flag values and meanings --- checksit/rules/rule_funcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checksit/rules/rule_funcs.py b/checksit/rules/rule_funcs.py index f356086..118fc67 100644 --- a/checksit/rules/rule_funcs.py +++ b/checksit/rules/rule_funcs.py @@ -362,13 +362,13 @@ def check_qc_flags(value, context, extras=None, label=""): ) # check there are at least two values and they start with 0 and 1 - if not len(value) > 2: + if not len(value) >= 2: errors.append(f"{label} There must be at least two QC flag values.") elif not (np.all(value[:2] == [0, 1]) or np.all(value[:2] == (0, 1))): errors.append(f"{label} First two QC flag_values must be '[0, 1]'.") # check there are at least two meanings and the first two are correct - if not len(meanings) > 2: + if not len(meanings) >= 2: errors.append( f"{label} There must be at least two QC flag meanings (space separated)." ) From aa79aa34022182a9939bf8cb3eaeffb456a34ee8 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 24 Apr 2024 09:19:38 +0100 Subject: [PATCH 27/29] Change convention prefix definition for auto-detect NCAS files --- checksit/check.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/checksit/check.py b/checksit/check.py index 89f92eb..d4da8e1 100644 --- a/checksit/check.py +++ b/checksit/check.py @@ -17,6 +17,8 @@ from .make_specs import make_amof_specs AMOF_CONVENTIONS = ['"CF-1.6, NCAS-AMF-2.0.0"'] +GENERAL_CONVENTION_PREFIXES = ["NCAS-AMF", "NCAS-AMOF", "NCAS-GENERAL"] +RADAR_CONVENTION_PREFIXES = ["NCAS-RADAR"] IMAGE_EXTENSIONS = ["png", "jpg", "jpeg"] conf = get_config() @@ -271,8 +273,8 @@ def _get_ncas_specs( ) # NCAS-GENERAL file if any( - name in conventions - for name in ["NCAS-GENERAL", "NCAS-AMF", "NCAS-AMOF"] + name in conventions.upper() + for name in GENERAL_CONVENTION_PREFIXES ): if verbose: print("\nNCAS-AMOF file detected, finding correct spec files") @@ -376,7 +378,10 @@ def _get_ncas_specs( template = "off" # NCAS-Radar - elif "NCAS-Radar" in conventions: + elif any( + name in conventions.upper() + for name in RADAR_CONVENTION_PREFIXES + ): version_number = ( conventions[conventions.index("NCAS-") :] .split("-")[2] From 1949449616da055cbe06e8ad5042166c0047cc3a Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 24 Apr 2024 09:57:08 +0100 Subject: [PATCH 28/29] Restrict numpy to version 1 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index da22c4e..0fbc454 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ cf-python netcdf4 pandas requests +numpy>=1,<2 From 62999e500dbe48d1f4be0aa742419f4d65a84c84 Mon Sep 17 00:00:00 2001 From: Joshua Hampton Date: Wed, 24 Apr 2024 10:35:55 +0100 Subject: [PATCH 29/29] Updated docs with NCAS-Radar info --- docs/source/conf.py | 2 +- docs/source/dev/ncas_standard_specifics.rst | 9 +++++++- docs/source/dev/where_does_checksit_do_it.rst | 2 ++ docs/source/specifics.rst | 22 +++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b473326..04d2456 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -7,7 +7,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'checksit' -copyright = '2023, Ag Stephens, Hugo Ricketts, Joshua Hampton' +copyright = '2024, Ag Stephens, Hugo Ricketts, Joshua Hampton' author = 'Ag Stephens, Hugo Ricketts, Joshua Hampton' release = '0.1' diff --git a/docs/source/dev/ncas_standard_specifics.rst b/docs/source/dev/ncas_standard_specifics.rst index 327e774..23ae613 100644 --- a/docs/source/dev/ncas_standard_specifics.rst +++ b/docs/source/dev/ncas_standard_specifics.rst @@ -27,6 +27,13 @@ function within ``checksit/make_specs.py``. However, if ``checksit`` cannot find version, or does not have permission to write into the ``specs/groups`` folder, then an error is raised. +NCAS-Radar +---------- + +Similarly to the NCAS-GENERAL standard above, if ``NCAS-Radar`` is in the ``Conventions`` global attribute +of a netCDF file, then ``checksit`` will use specs defined for the identifed version of the ``NCAS-Radar`` +data standard. + NCAS-IMAGE ---------- @@ -36,4 +43,4 @@ one of ``png``, ``jpg`` or ``jpeg`` (or uppercase versions), and the file has th ``checksit`` will find specs related to NCAS-IMAGE. The version of the standard is identified using the ``Instructions`` tag, and specs relating to either the ``photo`` or ``plot`` data product are selected depending on the file name. The data product spec is combined with a global tags spec file -that covers tags required by the standard regardless of which data product is used. \ No newline at end of file +that covers tags required by the standard regardless of which data product is used. diff --git a/docs/source/dev/where_does_checksit_do_it.rst b/docs/source/dev/where_does_checksit_do_it.rst index aab1917..f014590 100644 --- a/docs/source/dev/where_does_checksit_do_it.rst +++ b/docs/source/dev/where_does_checksit_do_it.rst @@ -118,6 +118,8 @@ checks, managed by the ``Rules`` class in ``checksit/rules/rules.py``. There are - ``r"v\d\.\d"`` * - "datetime" - ``r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?"`` + * - "datetimeZ" + - ``r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z"`` * - "datetime-or-na" - ``r"(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?)" + _NOT_APPLICABLE_RULES`` * - "number" diff --git a/docs/source/specifics.rst b/docs/source/specifics.rst index 828992a..f4d610d 100644 --- a/docs/source/specifics.rst +++ b/docs/source/specifics.rst @@ -37,3 +37,25 @@ is the same as .. code-block:: checksit check -t off -s ncas-image-1.0.0/amof-image-global-attrs,ncas-image-1.0.0/amof-photo ncas-cam-9_cao_20231117_photo_v1.0.nc + +NCAS-Radar +---------- + +The NCAS-Radar standard is also recognised by ``checksit``\ , with the correct specs identified and +used if no template or spec options are specified. Unlike the NCAS-GENERAL and NCAS-IMAGE standards, +NCAS-Radar does not have specific data product specs, instead there are a number of different spec +files covering different areas of the standard. These spec files are: + +.. code-block:: + + coordinate-variables + dimensions + global-attrs + global-variables + instrument-parameters + location-variables + moment-variables + radar-calibration + radar-parameters + sensor-pointing-variables + sweep-variables