cloudnetpy-qc 1.24.0__tar.gz → 1.24.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloudnetpy_qc-1.24.0/cloudnetpy_qc.egg-info → cloudnetpy_qc-1.24.2}/PKG-INFO +1 -1
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/data/data_quality_config.ini +1 -1
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/quality.py +31 -28
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/version.py +1 -1
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2/cloudnetpy_qc.egg-info}/PKG-INFO +1 -1
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/LICENSE +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/MANIFEST.in +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/README.md +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/__init__.py +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/data/area-type-table.xml +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/data/cf-standard-name-table.xml +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/data/standardized-region-list.xml +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/py.typed +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/utils.py +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/variables.py +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc.egg-info/SOURCES.txt +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc.egg-info/dependency_links.txt +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc.egg-info/requires.txt +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc.egg-info/top_level.txt +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/pyproject.toml +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/setup.cfg +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/tests/test_qc.py +0 -0
- {cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/tests/test_utils.py +0 -0
|
@@ -830,38 +830,41 @@ class TestCoordinates(Test):
|
|
|
830
830
|
description = "Check that file coordinates match site coordinates."
|
|
831
831
|
|
|
832
832
|
def run(self):
|
|
833
|
-
|
|
833
|
+
required_vars = {"latitude", "longitude"}
|
|
834
|
+
if self.nc.cloudnet_file_type != "model":
|
|
835
|
+
required_vars.add("altitude")
|
|
836
|
+
for key in required_vars:
|
|
834
837
|
if key not in self.nc.variables:
|
|
835
838
|
self._add_error(f"Variable '{key}' is missing")
|
|
836
|
-
return
|
|
837
|
-
if self.site_meta[key] is None:
|
|
838
|
-
return
|
|
839
839
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
self.
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
840
|
+
if "latitude" in self.nc.variables and "longitude" in self.nc.variables:
|
|
841
|
+
site_lat = self.site_meta["latitude"]
|
|
842
|
+
site_lon = self.site_meta["longitude"]
|
|
843
|
+
file_lat = np.atleast_1d(self.nc["latitude"][:])
|
|
844
|
+
file_lon = np.atleast_1d(self.nc["longitude"][:])
|
|
845
|
+
dist = utils.haversine(site_lat, site_lon, file_lat, file_lon)
|
|
846
|
+
i = np.argmax(dist)
|
|
847
|
+
max_dist = 100 if self.nc.cloudnet_file_type == "model" else 10
|
|
848
|
+
if dist[i] > max_dist:
|
|
849
|
+
self._add_error(
|
|
850
|
+
f"Variables 'latitude' and 'longitude' do not match "
|
|
851
|
+
f"the site coordinates: "
|
|
852
|
+
f"expected ({site_lat:.3f},\u00a0{site_lon:.3f}) "
|
|
853
|
+
f"but received ({file_lat[i]:.3f},\u00a0{file_lon[i]:.3f}), "
|
|
854
|
+
f"distance {round(dist[i])}\u00a0km"
|
|
855
|
+
)
|
|
854
856
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
857
|
+
if "altitude" in self.nc.variables:
|
|
858
|
+
site_alt = self.site_meta["altitude"]
|
|
859
|
+
file_alt = np.atleast_1d(self.nc["altitude"][:])
|
|
860
|
+
diff_alt = np.abs(site_alt - file_alt)
|
|
861
|
+
i = np.argmax(diff_alt)
|
|
862
|
+
if diff_alt[i] > 100:
|
|
863
|
+
self._add_error(
|
|
864
|
+
f"Variable 'altitude' doesn't match the site altitude: "
|
|
865
|
+
f"expected {round(site_alt)}\u00a0m "
|
|
866
|
+
f"but received {round(file_alt[i])}\u00a0m"
|
|
867
|
+
)
|
|
865
868
|
|
|
866
869
|
|
|
867
870
|
# ------------------------------#
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cloudnetpy_qc-1.24.0 → cloudnetpy_qc-1.24.2}/cloudnetpy_qc/data/standardized-region-list.xml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|