Skip to main content

Ceilometer feature detection (clouds, precip, fog, layers) from NetCDF.

Project description

ceil-feature-detection

PyPI version License

Ceilometer feature detection from NetCDF files: clouds, precipitation, fog, and boundary-layer detection.


Features

  • A-trous (stationary) wavelet transform: multi‑scale analysis of attenuated backscatter.
  • Automated thresholding: blockwise Otsu on combined wavelet/remnant field.
  • Denoising: remove erroneous regions/artifacts prior to layer extraction
  • Cloud/precip/fog flags: per-time-step boolean indicators.
  • Layer extraction: Thresholded PBL/Residual Layer/other stored in a multidimensional ndarray.
  • NetCDF I/O: read/write with atomic file replacement.
  • Command-line & Python API

Installation

pip install ceilfeat

To install the latest version from GitHub:

pip install git+https://github.com/DanielWefer/ceil-feature-detection.git

For development (editable) install with tests:

git clone https://github.com/DanielWefer/ceil-feature-detection.git
cd ceil-feature-detection
env=".venv"
python -m venv "$env"
source "$env/bin/activate"
pip install -e '.[dev]'
pytest -q

Quickstart CLI

Process one or more NetCDF files via the built-in pipeline:

python -m ceilfeat.pipeline --in /path/to/input1.nc /path/to/input2.nc \
    --out /path/to/output_dir -vv
  • --in: input file(s) or glob(s).
  • --out: output file or directory. If a directory, filenames are auto-generated.
  • -v, -vv: increase verbosity.

Python API

import xarray as xr
import ceilfeat as cf

# 1. Open dataset
 ds = xr.open_dataset("input.nc").sortby("time")

# 2. Compute wavelet transforms
 row_wt, col_wt, remnant = cf.get_wavelets(ds.copy(), ds.range.values, ds.time.values)

# 3. Detect clouds & precip
 clouds, precip = cf.get_clouds_and_precip(
     ds.beta_att.T.values, ds.range.values, ds.time.values
 )

# 4. Flags and threshold
 fog, cloud, rain, clear = cf.get_flags(
     ds.beta_att.T.values, ds.range.values, ds.time.values
 )
 thresh = cf.get_thresh(remnant, row_wt, col_wt)

# 5. Denoise & extract layers
 clean = cf.remove_noisy_regions(
     ds.beta_att.T.values, thresh, ds.range.values, ds.time.values
 )
 layers = cf.get_layers(clean.values, clean.range.values)

# 6. Write results
 cf.create_file(
     ds, row_wt, col_wt, remnant,
     clouds, precip, fog, rain, cloud, clear,
     clean, layers, ds.overlap_function,
     output_path="output.nc",
     overwrite=True
 )

Contributing

  1. Fork the repo and create a feature branch.
  2. Write code, tests, and update docs.
  3. Follow style: ruff, mypy, pytest.
  4. Submit a pull request.

License

This project is licensed under the GNU Lesser General Public License v2.1 or later. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ceilfeat-0.1.2.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ceilfeat-0.1.2-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file ceilfeat-0.1.2.tar.gz.

File metadata

  • Download URL: ceilfeat-0.1.2.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ceilfeat-0.1.2.tar.gz
Algorithm Hash digest
SHA256 42aa227292a992a33f6f52b7b05a3840e18f07af1f6b6d5d18d7b0800226edf1
MD5 a2d26be0c1ed4fbc8355f8f6fe1b6cc7
BLAKE2b-256 10f16f87dbcf5d492cb47f09e5ca8fc655612e514cad9b20d20b80a7628a21ee

See more details on using hashes here.

File details

Details for the file ceilfeat-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ceilfeat-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ceilfeat-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf92910539a230c1024f168470c5c92c996a39decadcf03a5c53f483ffbe8bb3
MD5 f3d6494f791e343876e7701a426115d3
BLAKE2b-256 15aa948be12358cacfc1861cfcb06388233d6bec0acd3b9b62abf6e617969ea2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page