ceilopyter 0.2.2__tar.gz → 0.2.3__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.
Files changed (36) hide show
  1. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/CHANGELOG.md +5 -0
  2. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/PKG-INFO +1 -1
  3. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/instruments/chm15k.py +4 -1
  4. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/instruments/ct25k.py +4 -2
  5. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/instruments/ld40.py +24 -1
  6. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/noise.py +2 -2
  7. ceilopyter-0.2.3/ceilopyter/version.py +1 -0
  8. ceilopyter-0.2.2/ceilopyter/version.py +0 -1
  9. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/.github/workflows/publish.yml +0 -0
  10. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/.github/workflows/test.yml +0 -0
  11. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/.gitignore +0 -0
  12. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/.pre-commit-config.yaml +0 -0
  13. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/LICENSE +0 -0
  14. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/README.md +0 -0
  15. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/__init__.py +0 -0
  16. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/ceilo.py +0 -0
  17. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/ceilo_raw.py +0 -0
  18. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/cli.py +0 -0
  19. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/common.py +0 -0
  20. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/instruments/cl31.py +0 -0
  21. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/instruments/cl51.py +0 -0
  22. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/instruments/cl61.py +0 -0
  23. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/instruments/cs135.py +0 -0
  24. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/py.typed +0 -0
  25. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/readers/read_cl.py +0 -0
  26. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/readers/read_cs.py +0 -0
  27. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/readers/read_ct.py +0 -0
  28. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/ceilopyter/utils.py +0 -0
  29. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/pyproject.toml +0 -0
  30. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/tests/data/celio_chennai_2025-03-11.dat +0 -0
  31. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/tests/data/kauniainen_cl31.dat +0 -0
  32. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/tests/data/kenttarova_cl31_msg.dat +0 -0
  33. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/tests/data/palaiseau_cl31_msg.dat +0 -0
  34. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/tests/data/uto_cl31_msg.dat +0 -0
  35. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/tests/test_cl.py +0 -0
  36. {ceilopyter-0.2.2 → ceilopyter-0.2.3}/tests/test_utils.py +0 -0
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 0.2.3 – 2026-10-13
9
+
10
+ - Add noise screening for LD40
11
+ - Add mask to `beta_smooth`
12
+
8
13
  ## 0.2.2 – 2026-10-01
9
14
 
10
15
  - Improve CHM 15k processing
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ceilopyter
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Read ceilometer data
5
5
  Project-URL: Homepage, https://github.com/actris-cloudnet/ceilopyter
6
6
  Project-URL: Issues, https://github.com/actris-cloudnet/ceilopyter/issues
@@ -7,7 +7,7 @@ import numpy.typing as npt
7
7
  from cftime import num2pydate
8
8
  from numpy import ma
9
9
 
10
- from ceilopyter.noise import remove_noise
10
+ from ceilopyter.noise import calc_cloud_mask, remove_noise
11
11
  from ceilopyter.utils import awful_overlap
12
12
 
13
13
  from ..ceilo import Ceilo
@@ -30,14 +30,17 @@ def read_chm15k(
30
30
  beta_raw = concat.beta * calibration_factor
31
31
 
32
32
  beta_uncorr = beta_raw / (concat.range * 1e-3) ** 2
33
+ cloud_mask = calc_cloud_mask(concat.time, concat.range, beta_uncorr)
33
34
  is_noise, beta_smooth = remove_noise(
34
35
  concat.time,
35
36
  concat.range,
36
37
  beta_uncorr,
37
38
  noise_floor=4e-9,
39
+ cloud_mask=cloud_mask,
38
40
  filter_above_negative=True,
39
41
  )
40
42
  beta = ma.masked_where(is_noise, beta_raw)
43
+ beta_smooth = ma.masked_where(is_noise, beta_smooth)
41
44
 
42
45
  return Ceilo(
43
46
  concat,
@@ -8,7 +8,7 @@ from numpy import ma
8
8
  from ..ceilo import Ceilo
9
9
  from ..ceilo_raw import concatenate_raw
10
10
  from ..common import read_msgs
11
- from ..noise import remove_noise
11
+ from ..noise import calc_cloud_mask, remove_noise
12
12
  from ..readers.read_ct import read_ct_file
13
13
 
14
14
 
@@ -28,11 +28,13 @@ def read_ct25k(
28
28
  beta_calib = concat.beta * calibration_factor
29
29
  beta_uncorr = beta_calib / r2 if noise_h2 else _fix_beta(r2, beta_calib)
30
30
 
31
+ cloud_mask = calc_cloud_mask(concat.time, concat.range, beta_uncorr)
31
32
  is_noise, beta_smooth = remove_noise(
32
- concat.time, concat.range, beta_uncorr, noise_floor=6e-8
33
+ concat.time, concat.range, beta_uncorr, noise_floor=6e-8, cloud_mask=cloud_mask
33
34
  )
34
35
  beta_raw = beta_uncorr * r2
35
36
  beta = ma.masked_where(is_noise, beta_raw)
37
+ beta_smooth = ma.masked_where(is_noise, beta_smooth)
36
38
 
37
39
  return Ceilo(
38
40
  concat,
@@ -5,6 +5,7 @@ from os import PathLike
5
5
  import numpy as np
6
6
  from numpy import ma
7
7
 
8
+ from ceilopyter.noise import remove_noise
8
9
  from ceilopyter.utils import awful_overlap
9
10
 
10
11
  from ..ceilo import Ceilo
@@ -25,8 +26,30 @@ def read_ld40(
25
26
  for file in files:
26
27
  raw.append(_read_file(file))
27
28
  concat = concatenate_raw(raw)
29
+ r2 = (concat.range * 1e-3) ** 2
28
30
  beta_raw = concat.beta * calibration_factor
29
- return Ceilo(concat, beta_raw=beta_raw, calibration_factor=calibration_factor)
31
+ beta_uncorr = beta_raw / r2
32
+ cloud_mask = beta_uncorr > 1e-5
33
+ is_noise, beta_smooth = remove_noise(
34
+ concat.time,
35
+ concat.range,
36
+ beta_uncorr,
37
+ noise_floor=0,
38
+ cloud_mask=cloud_mask,
39
+ snr_limit=12,
40
+ )
41
+ # Filter constant artefact at 8 km and assume noise above.
42
+ is_noise[:, concat.range > 7500] = True
43
+ beta = ma.masked_where(is_noise, beta_raw)
44
+ beta_smooth = ma.masked_where(is_noise, beta_smooth)
45
+
46
+ return Ceilo(
47
+ concat,
48
+ beta_raw=beta_raw,
49
+ beta=beta,
50
+ beta_smooth=beta_smooth,
51
+ calibration_factor=calibration_factor,
52
+ )
30
53
 
31
54
 
32
55
  def _read_file(filename: str | PathLike) -> CeiloRaw:
@@ -15,6 +15,7 @@ def remove_noise(
15
15
  rng: npt.NDArray[np.floating],
16
16
  beta_uncorr: npt.NDArray[np.floating],
17
17
  noise_floor: float,
18
+ cloud_mask: npt.NDArray[np.bool],
18
19
  snr_limit: float = 5,
19
20
  filter_above_negative: bool = False,
20
21
  ) -> tuple[npt.NDArray[np.bool_], npt.NDArray[np.floating]]:
@@ -29,7 +30,6 @@ def remove_noise(
29
30
  beta_uncorr = np.where(is_above_negative, noise_floor, beta_uncorr)
30
31
 
31
32
  smooth, smooth_uncorr = _calc_beta_smooth(time, rng, beta_uncorr)
32
- cloud_mask = _calc_cloud_mask(time, rng, beta_uncorr)
33
33
 
34
34
  fraction = 0.1
35
35
  n_top_gates = round(n_range * fraction)
@@ -88,7 +88,7 @@ def _calc_sigma_units(
88
88
  return x_std, y_std
89
89
 
90
90
 
91
- def _calc_cloud_mask(
91
+ def calc_cloud_mask(
92
92
  time: npt.NDArray,
93
93
  rng: npt.NDArray[np.floating],
94
94
  beta_uncorr: npt.NDArray[np.floating],
@@ -0,0 +1 @@
1
+ __version__ = "0.2.3"
@@ -1 +0,0 @@
1
- __version__ = "0.2.2"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes