Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "radclss"
version = "2026.5.20"
version = "2026.7.1"
description = "Extracted Radar Columns and In Situ Sensors"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
18 changes: 18 additions & 0 deletions src/radclss/config/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@
"signal_to_noise_ratio_copolar_v",
"normalized_coherent_power",
"normalized_coherent_power_v",
],
"radar_xsapr": [
"classification_mask",
"censor_mask",
"uncorrected_copol_correlation_coeff",
"uncorrected_differential_phase",
"uncorrected_differential_reflectivity",
"uncorrected_differential_reflectivity_lag_1",
"uncorrected_mean_doppler_velocity_h",
"uncorrected_mean_doppler_velocity_v",
"uncorrected_reflectivity_h",
"uncorrected_reflectivity_v",
"uncorrected_spectral_width_h",
"uncorrected_spectral_width_v",
"signal_to_noise_ratio_copolar_v",
"normalized_coherent_power",
"normalized_coherent_power_v",
"radar_echo_classification"
],
"met": [
"base_time",
Expand Down
11 changes: 7 additions & 4 deletions src/radclss/core/radclss_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import act
import numpy as np
import pandas as pd
import traceback


from ..util.column_utils import (
Expand Down Expand Up @@ -203,6 +204,8 @@ def radclss(

except Exception:
result = None
if verbose:
traceback.print_exc()
if verbose:
if result is not None:
print(
Expand Down Expand Up @@ -303,7 +306,7 @@ def _get_nexrad_wrapper(time_str):
output_config["site"],
input_site_dict,
nexrad_radar=nexrad_site,
height_bins=height_bins
height_bins=height_bins,
)

results = current_client.map(_get_nexrad_wrapper, time_list)
Expand Down Expand Up @@ -340,7 +343,7 @@ def _get_nexrad_wrapper(time_str):
output_config["site"],
input_site_dict,
nexrad_radar=nexrad_site,
height_bins=height_bins
height_bins=height_bins,
)

successful_count = 0
Expand Down Expand Up @@ -436,7 +439,7 @@ def _get_nexrad_wrapper(time_str):
print("=" * 80)
print(f" Time coordinate method: {time_coords}")

ds_concat[k] = ds_concat[k].drop_duplicates('time')
ds_concat[k] = ds_concat[k].drop_duplicates("time")
if "radar" in time_coords:
if verbose:
print(f" Reindexing all datasets to {time_coords} time coordinates")
Expand Down Expand Up @@ -710,7 +713,7 @@ def _get_nexrad_wrapper(time_str):
site = base_station
site = site.upper()

if instrument == "kazr2":
if instrument == "kazr2" or instrument == "kazr":
_instrument_tasks.append(
(
k,
Expand Down
42 changes: 21 additions & 21 deletions src/radclss/util/column_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def _vpt_to_column_timeseries(radar, height_bins):
]
data_vars = {}
for key in radar.fields:
print(key, radar.fields[key]["data"].dtype)
arr = np.ma.filled(radar.fields[key]["data"], np.nan).astype(float)
attrs = {
tag: radar.fields[key][tag] for tag in da_meta if tag in radar.fields[key]
Expand Down Expand Up @@ -518,7 +519,6 @@ def subset_points(
for lat, lon, site in zip(lats, lons, sites):
# Make sure we are interpolating from the radar's location above sea level
# NOTE: interpolating throughout Troposphere to match sonde to in the future

if "vpt" in radar.metadata["scan_mode"]:
if radar.metadata.get("facility_id", "") == site:
da = _vpt_to_column_timeseries(radar, height_bins)
Expand Down Expand Up @@ -563,27 +563,27 @@ def subset_points(
da = da.sortby("height")
valid = np.isfinite(da["height"])
n_valid = int(valid.sum())
interpolated = False
dvars = da.data_vars
for v in dvars:
if np.all(np.isnan(da[v].values)):
da = da.drop(v)
if n_valid > 0:
try:
# Drop all NaNs
da = (
da.dropna("height")
.sortby("height")
.interp(height=height_bins)
)
except pd.errors.InvalidIndexError:
da = da.drop_duplicates("height", keep="first")

valid = np.isfinite(da["height"])
da = (
da.dropna("height")
.sortby("height")
.interp(height=height_bins)
)
time_offset = time_offset.drop_duplicates(
"height", keep="first"
)
else:
da_clean = da.dropna("height").sortby("height")
if da_clean.sizes.get("height", 0) > 0:
try:
da = da_clean.interp(height=height_bins)
except pd.errors.InvalidIndexError:
da_clean = da_clean.drop_duplicates(
"height", keep="first"
)
da = da_clean.interp(height=height_bins)
time_offset = time_offset.drop_duplicates(
"height", keep="first"
)
interpolated = True

if not interpolated:
target_height = xr.DataArray(
height_bins, dims="height", name="height"
)
Expand Down
Loading