cloudnetpy-qc 1.24.0__py3-none-any.whl → 1.24.2__py3-none-any.whl

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.
@@ -39,7 +39,7 @@ detection_status = 0, 9
39
39
  height = -420, 100000
40
40
  time = 0, 24
41
41
  latitude = -90, 90
42
- longitude = -180, 360
42
+ longitude = -180, 180
43
43
  altitude = -430, 6000
44
44
  cloud_base_height_agl = 0, 20000
45
45
  cloud_top_height_agl = 0, 20000
cloudnetpy_qc/quality.py CHANGED
@@ -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
- for key in ("latitude", "longitude", "altitude"):
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
- site_lat = self.site_meta["latitude"]
841
- site_lon = self.site_meta["longitude"]
842
- file_lat = np.atleast_1d(self.nc["latitude"][:])
843
- file_lon = np.atleast_1d(self.nc["longitude"][:])
844
- dist = utils.haversine(site_lat, site_lon, file_lat, file_lon)
845
- i = np.argmax(dist)
846
- if dist[i] > 10:
847
- self._add_error(
848
- f"Variables 'latitude' and 'longitude' do not match "
849
- f"the site coordinates: "
850
- f"expected ({site_lat:.3f},\u00a0{site_lon:.3f}) "
851
- f"but received ({file_lat[i]:.3f},\u00a0{file_lon[i]:.3}), "
852
- f"distance {round(dist[i])}\u00a0km"
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
- site_alt = self.site_meta["altitude"]
856
- file_alt = np.atleast_1d(self.nc["altitude"][:])
857
- diff_alt = np.abs(site_alt - file_alt)
858
- i = np.argmax(diff_alt)
859
- if diff_alt[i] > 100:
860
- self._add_error(
861
- f"Variable 'altitude' doesn't match the site altitude: "
862
- f"expected {round(site_alt)}\u00a0m "
863
- f"but received {round(file_alt[i])}\u00a0m"
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
  # ------------------------------#
cloudnetpy_qc/version.py CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  MAJOR = 1
4
4
  MINOR = 24
5
- PATCH = 0
5
+ PATCH = 2
6
6
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnetpy_qc
3
- Version: 1.24.0
3
+ Version: 1.24.2
4
4
  Summary: Quality control routines for CloudnetPy products
5
5
  Author-email: Finnish Meteorological Institute <actris-cloudnet@fmi.fi>
6
6
  License: MIT License
@@ -1,15 +1,15 @@
1
1
  cloudnetpy_qc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  cloudnetpy_qc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- cloudnetpy_qc/quality.py,sha256=DW9CgsnlY67-YB1l0JvAF2wgaE14YZxAArFrJiZY9KY,37116
3
+ cloudnetpy_qc/quality.py,sha256=jDf95OZyrawnKeSWyaV-IoohfXzQ0W_AJNqRSl7C4ZA,37448
4
4
  cloudnetpy_qc/utils.py,sha256=q_zD91g4eA4tBsW7M7y_UTKVkUZETDWT3NhAYPMOvcc,3909
5
5
  cloudnetpy_qc/variables.py,sha256=YrOw2qCdY8eTT3nlExpdtFU5YmVCC-yF9c0VQ-wWDzw,50851
6
- cloudnetpy_qc/version.py,sha256=LhLfdu-tqDx6ppRi_IDQ7tBbJNSEiTICHweIEmwSdNY,102
6
+ cloudnetpy_qc/version.py,sha256=zMZfX2V3iykAiInxcyfZcOq9OnURVKNtT1B88_xnPnw,102
7
7
  cloudnetpy_qc/data/area-type-table.xml,sha256=LQGp6rk8d-jZVjeFWPK_NjG2Kk1atvLlQXmV4UXggKI,17788
8
8
  cloudnetpy_qc/data/cf-standard-name-table.xml,sha256=NvW9oPvPwMR1YRIwxajTwvF83oarcwsxkUqnQgqPO3k,4406495
9
- cloudnetpy_qc/data/data_quality_config.ini,sha256=URRc93Du2_YFX6Q7GxMHptKIVl6kwxXw-kVyftmsEJk,1242
9
+ cloudnetpy_qc/data/data_quality_config.ini,sha256=tQpbRQUlA3iz_8wCRMJfdKrP8ByWiM2SxtqszSoxQeA,1242
10
10
  cloudnetpy_qc/data/standardized-region-list.xml,sha256=gLRE2G7RQLD9hmvW5dTzyK7XPhORxWv2bfbrvAp5Uto,6426
11
- cloudnetpy_qc-1.24.0.dist-info/licenses/LICENSE,sha256=P0wszB7Cq2M390SKaqT4DGvECfwGOMdTTdxsWBpEUUc,1094
12
- cloudnetpy_qc-1.24.0.dist-info/METADATA,sha256=BjFzWcTEszF3wlUKBsBKW293wTvYpNMwRd_wrRYGMMc,8168
13
- cloudnetpy_qc-1.24.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
14
- cloudnetpy_qc-1.24.0.dist-info/top_level.txt,sha256=shrf8A1KyrrnhbHocc4gHmTl38YY-DHflgf-gXiKnKs,14
15
- cloudnetpy_qc-1.24.0.dist-info/RECORD,,
11
+ cloudnetpy_qc-1.24.2.dist-info/licenses/LICENSE,sha256=P0wszB7Cq2M390SKaqT4DGvECfwGOMdTTdxsWBpEUUc,1094
12
+ cloudnetpy_qc-1.24.2.dist-info/METADATA,sha256=OozfDa4m1NV4OUr2K4GrpW0YBvuORkSBc1U-DATHEIE,8168
13
+ cloudnetpy_qc-1.24.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
14
+ cloudnetpy_qc-1.24.2.dist-info/top_level.txt,sha256=shrf8A1KyrrnhbHocc4gHmTl38YY-DHflgf-gXiKnKs,14
15
+ cloudnetpy_qc-1.24.2.dist-info/RECORD,,