SNR computation and quality masking for E-Profile Automated Lidar Ceilometers (ALCs).
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)
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' )
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 )
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)