mirror of
https://github.com/MeteoSwiss/snr_alc.git
synced 2026-08-26 12:14:21 +00:00
Read-only mirror of https://github.com/MeteoSwiss/snr_alc — MeteoSwiss. Issues & pull requests at the source.
- Jupyter Notebook 99.3%
- Python 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| figures | ||
| notebooks | ||
| .gitignore | ||
| alc_liquid_cloud.py | ||
| alc_snr_daily_l2_rolling.py | ||
| alc_snr_l1.py | ||
| alc_snr_l2.py | ||
| bsc_profile_snr_mask.png | ||
| bsc_snr_mask.png | ||
| old_alc_snr_l1.py | ||
| README.md | ||
snr_alc
SNR computation and quality masking for E-Profile Automated Lidar Ceilometers (ALCs).
Files
| File | Description |
|---|---|
alc_snr_l2.py |
Main script SNR calculation, SNR flag, + plotting. Directly on L2-like data, on a per-profile basis compatible with operational |
alc_snr_l1.py |
SNR computation at L1 level - includes temporal averaging of data on a given time window |
alc_snr_daily_l2_rolling.py |
Daily L2 SNR with rolling window, allows for morphological operations (but not real time processing) |
Usage
Compute SNR flag and save to NetCDF
import xarray as xr
from alc_snr_l2 import compute_snr_flag
ds = xr.open_dataset('L2_file.nc', decode_times=False)
r = ds['altitude'] - ds.station_altitude
t = ds['time']
bsc = ds.attenuated_backscatter_0
snr_flag = compute_snr_flag(bsc, r, t, snr_threshold=3, range_dim='altitude')
ds_out = ds.assign(snr_flag=snr_flag)
ds_out.to_netcdf('L2_file_snr_flag.nc')
Compute SNR and plot
import xarray as xr
from alc_snr_l2 import calc_snr, plot_backscatter_timeseries_snr_mask, plot_backscatter_profile_snr_mask
ds = xr.open_dataset('L2_file.nc', decode_times=False)
r = ds['altitude'] - ds.station_altitude
t = ds['time']
bsc = ds.attenuated_backscatter_0
snr = calc_snr(bsc, r, t, range_dim='altitude', use_for_noise_bg='stdmin_rmlinfit')
fig, ax = plot_backscatter_timeseries_snr_mask(bsc, snr, r, t, snr_threshold=3)
fig, ax = plot_backscatter_profile_snr_mask(bsc, snr, r, t, snr_threshold=3)
SNR methods
use_for_noise_bg |
Description |
|---|---|
top |
Background noise estimated from the top 10% of range gates |
stdmin |
Background noise from the block of gates with lowest std deviation |
stdmin_rmlinfit |
Same as stdmin but linear trend removed before std estimation (default) |