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
6 changes: 4 additions & 2 deletions src/glide/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ def merge(
dataset_dims = set(ds.dimensions)
ds.close()

if dataset_dims == {"time"}:
if (dataset_dims == {"time"}) | (dataset_dims == {"time", "time_uv"}):
input_file_level = 2
elif dataset_dims == {"profile_id", "z"}:
elif (dataset_dims == {"profile_id", "z"}) | (
dataset_dims == {"profile_id", "z", "time_uv"}
):
input_file_level = 3
else:
raise ValueError(
Expand Down
7 changes: 5 additions & 2 deletions src/glide/process_l3.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def bin_q(
ds[v] = (
dims,
np.full_like(ds.conductivity.values, np.nan),
config["variables"][v]["CF"],
config["merged_variables"][v]["CF"],
)
# Dissipation rate is stored in the q file as the log10 of the value.
# Convert it to the actual value.
Expand All @@ -61,7 +61,10 @@ def bin_q(
ds_.profile_time_end.astype("M8[s]"),
)
)
if eds_.e_1.size < 1:
# Filter to valid depths within the bin range (also drops NaN).
in_range = (eds_.depth >= depth_bins[0]) & (eds_.depth <= depth_bins[-1])
eds_ = eds_.sel(time=in_range)
if eds_.time.size < 1:
_log.debug("No epsilon data")
continue
binned = eds_.groupby_bins("depth", depth_bins).mean()
Expand Down
Loading