Skip to content

Commit

Permalink
Merge pull request #50 from cedadev/ncas-amf-1
Browse files Browse the repository at this point in the history
Add specs for NCAS General version 1
  • Loading branch information
joshua-hampton authored Oct 1, 2024
2 parents 6141f47 + a607ac3 commit 84d6ebb
Show file tree
Hide file tree
Showing 320 changed files with 40,410 additions and 5 deletions.
2 changes: 1 addition & 1 deletion checksit/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _check_file(
number = len(errors)
elif len(warnings) > 0 and not ignore_warnings:
highest = "WARNING"
endstr = ""
endstr = "\n"
number = len(warnings)
else:
highest = "NONE"
Expand Down
5 changes: 4 additions & 1 deletion checksit/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa
)
else:
for attr in defined_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_value = ":".join(attr.split(":")[1:])
if attr_key not in dct["variables"][variable]:
Expand All @@ -385,7 +388,7 @@ def check_var(dct, variable, defined_attrs, rules_attrs=None, skip_spellcheck=Fa
elif "<" in attr_value:
# work this out
pass
elif not dct["variables"][variable].get(attr_key) == attr_value:
elif not str(dct["variables"][variable].get(attr_key)) == attr_value:
errors.append(
f"[variable**************:{variable}]: Attribute '{attr_key}' must have definition '{attr_value}', "
f"not '{dct['variables'][variable].get(attr_key)}'."
Expand Down
2 changes: 1 addition & 1 deletion checksit/rules/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def check(self, rule_lookup, value, context=None, label=""):
if i.startswith("rule-func"):
rule_comps = i.split(":")
rule_func = getattr(rule_funcs, rule_comps[1].replace("-", "_"))
extras = rule_comps[2:]
extras = [":".join(rule_comps[2:])]
output.extend(rule_func(value, context, extras, label=label))

elif i.startswith("type-rule"):
Expand Down
20 changes: 20 additions & 0 deletions checksit/vocabs/AMF_CVs/1.0.0/AMF_platform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"platform": {
"wao": {
"platform_id": "wao",
"description": "weybourne atmospheric observatory"
},
"cvao": {
"platform_id": "cvao",
"description": "cape verde atmospheric observatory"
},
"iao": {
"platform_id": "iao",
"description": "icelandic atmospheric observatory"
},
"bt-tower-t35": {
"platform_id": "bt-tower-t35",
"description": "british telecoms tower observatory"
}
}
}
54 changes: 54 additions & 0 deletions checksit/vocabs/AMF_CVs/1.0.0/AMF_product.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"product": [
"snr-winds",
"aerosol-backscatter",
"aerosol-extinction",
"cloud-base",
"o3-concentration-profiles",
"sonde",
"aerosol-size-distribution",
"liquid-water-content",
"aerosol-no3-so4-nh3-org-concentration",
"aerosol-concentration",
"surface-met",
"so2-concentration",
"o3-concentration",
"co2-concentration",
"n2o-sf6-concentration",
"ch4-concentration",
"o2n2-concentration-ratio",
"co-h2-concentration",
"co-concentration",
"h2-concentration",
"halocarbon-concentration",
"nox-noxy-concentration",
"tgm-concentration",
"solar-actinic-flux",
"voc-concentration",
"peroxyacetyl-nitrate-concentration",
"dew-point",
"oh-concentration",
"o3-photolysis-frequencies",
"radar",
"aerosol-optical-depth",
"mean-winds",
"mean-winds-profile",
"aerosol- backscatter-radial-winds",
"radiation",
"soil",
"flux-components",
"flux-estimates",
"mean-co2-h2o",
"rain-lwc-velocity-reflectivity",
"size-concentration-spectra",
"boundary-layer-temperature-profiles",
"brightness-temperature",
"full-troposphere-temperature-profiles",
"iwv-lwp",
"moisture-profile",
"stability-indices",
"acoustic-backscatter-winds",
"depolarisation-ratio",
"boundary-layer-height"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"product_acoustic-backscatter-winds_dimension": {
"index": {
"length": "<i>",
"units": "1"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
"product_acoustic-backscatter-winds_variable": {
"altitude": {
"type": "float32",
"dimension": "time, index",
"units": "m",
"standard_name": "altitude",
"long_name": "Geometric height above geoid (WGS84).",
"_FillValue": -1e+20,
"axis": "Z",
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"coordinates": "latitude longitude"
},
"sound_intensity_level_in_air": {
"type": "float32",
"dimension": "time, index",
"units": "dB",
"standard_name": "sound_intensity_level_in_air",
"long_name": "Sound Intensity Level in Air",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: mean",
"coordinates": "latitude longitude"
},
"wind_speed": {
"type": "float32",
"dimension": "time, index",
"units": "m s-1",
"standard_name": "wind_speed",
"long_name": "Wind Speed",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: mean",
"coordinates": "latitude longitude"
},
"wind_from_direction": {
"type": "float32",
"dimension": "time, index",
"units": "degree",
"standard_name": "wind_from_direction",
"long_name": "Wind From Direction",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: mean",
"coordinates": "latitude longitude"
},
"eastward_wind": {
"type": "float32",
"dimension": "time, index",
"units": "m s-1",
"standard_name": "eastward_wind",
"long_name": "Eastward Wind Component (U)",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: mean",
"coordinates": "latitude longitude"
},
"northward_wind": {
"type": "float32",
"dimension": "time, index",
"units": "m s-1",
"standard_name": "northward_wind",
"long_name": "Northward Wind Component (V)",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: mean",
"coordinates": "latitude longitude"
},
"upward_air_velocity": {
"type": "float32",
"dimension": "time, index",
"units": "m s-1",
"standard_name": "upward_air_velocity",
"long_name": "Upward Air Velocity (W)",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: mean",
"coordinates": "latitude longitude"
},
"divergence_of_eastward_wind": {
"type": "float32",
"dimension": "time, index",
"units": "m s-1",
"long_name": "Divergence of Eastward Wind Component (Sigma U)",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: standard_deviation",
"coordinates": "latitude longitude"
},
"divergence_of_northward_wind": {
"type": "float32",
"dimension": "time, index",
"units": "m s-1",
"long_name": "Divergence of Northward Wind Component (Sigma V)",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: standard_deviation",
"coordinates": "latitude longitude"
},
"divergence_of_upward_air_velocity": {
"type": "float32",
"dimension": "time, index",
"units": "m s-1",
"long_name": "Divergence of Upward Air Velocity (Sigma W)",
"_FillValue": -1e+20,
"valid_min": "<derived from file>",
"valid_max": "<derived from file>",
"cell_methods": "time: standard_deviation",
"coordinates": "latitude longitude"
},
"qc_flag_mean_winds": {
"type": "byte",
"dimension": "time, index",
"units": "1",
"long_name": "Data Quality flag: Mean Winds",
"flag_values": "0b, 1b, 2b, 3b, 4b, 5b, 6b",
"flag_meanings": "not_used|good_data|suspect_data_wind_speed_value_outside_operational_range_(0_to_20_m_s-1)|suspect_data_wind_speed_==_0|bad_data_signal_consensus_poor|bad_data_gate_index_exceeds_number_of_measurement_gates_in_use|suspect_data_time_stamp_error"
},
"qc_flag_wind_component_eastward": {
"type": "byte",
"dimension": "time, index",
"units": "1",
"long_name": "Data Quality flag: Eastward Wind Component (U)",
"flag_values": "0b,1b, 2b, 3b, 4b, 5b",
"flag_meanings": "not_used|good_data|suspect_data_value_outside_operational_range_(-20_m_s-1_to_20_m_s-1)|bad_data_signal_consensus_poor|bad_data_gate_index_exceeds_number_of_measurement_gates_in_use|suspect_data_time_stamp_error"
},
"qc_flag_wind_component_northward": {
"type": "byte",
"dimension": "time, index",
"units": "1",
"long_name": "Data Quality flag: Northward Wind Component (V)",
"flag_values": "0b,1b, 2b, 3b, 4b, 5b",
"flag_meanings": "not_used|good_data|suspect_data_value_outside_operational_range_(-20_m_s-1_to_20_m_s-1)|bad_data_signal_consensus_poor|bad_data_gate_index_exceeds_number_of_measurement_gates_in_use|suspect_data_time_stamp_error"
},
"qc_flag_wind_component_upward_air_velocity": {
"type": "byte",
"dimension": "time, index",
"units": "1",
"long_name": "Data Quality flag: Upward Air Velocity (W)",
"flag_values": "0b,1b, 2b, 3b, 4b, 5b",
"flag_meanings": "not_used|good_data|suspect_data_value_outside_operational_range_(-20_m_s-1_to_20_m_s-1)|bad_data_signal_consensus_poor|bad_data_gate_index_exceeds_number_of_measurement_gates_in_use|suspect_data_time_stamp_error"
},
"qc_flag_backscatter": {
"type": "byte",
"dimension": "time, index",
"units": "1",
"long_name": "Data Quality flag: Backscatter",
"flag_values": "0b,1b, 2b, 3b, 4b, 5b",
"flag_meanings": "not_used|good_data |bad_data_value_outside_operational_range|bad_data_signal_consensus_poor|bad_data_gate_index_exceeds_number_of_measurement_gates_in_use|suspect_data_time_stamp_error"
},
"qc_flag_background_noise": {
"type": "byte",
"dimension": "time, index",
"units": "1",
"long_name": "Data Quality flag: Background Noise",
"flag_values": "0b,1b, 2b, 3b, 4b",
"flag_meanings": "not_used|good_data |suspect_data_background_noise_>_2_dB|bad_data_gate_index_exceeds_number_of_measurement_gates_in_use|suspect_data_time_stamp_error"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"product_aerosol-backscatter-radial-winds_dimension": {
"index_of_angle": {
"length": "<i>",
"units": "1"
},
"index_of_range": {
"length": "<r>",
"units": "1"
}
}
}
Loading

0 comments on commit 84d6ebb

Please sign in to comment.