Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0c987de
initial branch commit
jwarner8 May 7, 2026
f40954f
framework
jwarner8 May 8, 2026
430939d
first testing
jwarner8 May 8, 2026
0654085
tmp try except
jwarner8 May 12, 2026
cd90a12
rm tmp write
jwarner8 May 12, 2026
b4242c1
add notes on caching
jwarner8 May 13, 2026
845d662
Merge branch 'main' into support_ugrid
jwarner8 May 26, 2026
c19a652
extra comments
jwarner8 May 26, 2026
1b16cfc
working with lock files and additional comments/tidy!
jwarner8 May 27, 2026
2a451b3
working with lock files and additional comments/tidy!
jwarner8 May 27, 2026
63aa810
further tidy/reorder
jwarner8 May 27, 2026
534a60b
final adding comments
jwarner8 May 27, 2026
3ebf082
Merge branch 'main' into support_ugrid
jwarner8 Jun 3, 2026
248d3a3
add test data
jwarner8 Jun 3, 2026
3e6d32f
initial loaders for test data
jwarner8 Jun 3, 2026
99f2e14
update path
jwarner8 Jun 3, 2026
009e402
support bake ugrid
jwarner8 Jun 4, 2026
07a5aaa
update fixtures
jwarner8 Jun 19, 2026
2aabf67
new import
jwarner8 Jun 19, 2026
0bb6f1c
initial tests
jwarner8 Jun 19, 2026
8cce493
Merge branch 'main' into support_ugrid
jwarner8 Jun 22, 2026
0122e11
always return cubes
jwarner8 Jun 22, 2026
ef58efd
add placeholder test
jwarner8 Jun 22, 2026
8989cd9
Merge branch 'main' into support_ugrid
jwarner8 Jun 22, 2026
80ea3ee
support nan in stats
jwarner8 Jun 22, 2026
8e29514
exclude lock files when loading
jwarner8 Jun 22, 2026
5bc7d05
testing with curvilinear grid support
jwarner8 Jun 23, 2026
7612e0c
further testing
jwarner8 Jun 23, 2026
b8f2db5
revert pcolormesh to support rectilinear only
jwarner8 Jun 25, 2026
22b4dc4
add new func placeholder
jwarner8 Jun 25, 2026
cec8d49
add new pre-filter for variable
jwarner8 Jun 25, 2026
d4d98df
tidy comments/docstring
jwarner8 Jun 26, 2026
63a5c6c
update docstrings/comments
jwarner8 Jun 26, 2026
8f73061
further restructuring
jwarner8 Jun 26, 2026
bb0424b
bug fixes and tidy
jwarner8 Jun 29, 2026
7c2a1b7
fix issues with 2D shape
jwarner8 Jun 29, 2026
9f0c4dd
Merge branch 'main' into support_ugrid
jwarner8 Jun 29, 2026
49c680a
basic return
jwarner8 Jun 30, 2026
ca33d2c
new tests
jwarner8 Jun 30, 2026
c6a0e38
additional multitime test
jwarner8 Jun 30, 2026
99a80f2
more tests
jwarner8 Jun 30, 2026
93b3735
Merge branch 'main' into support_ugrid
jwarner8 Jun 30, 2026
57885bd
tidyup
jwarner8 Jun 30, 2026
e018abf
add unit for lsm
jwarner8 Jul 21, 2026
274222e
Merge branch 'main' into support_ugrid
jwarner8 Aug 5, 2026
366b79b
fix lat/lon name
jwarner8 Aug 5, 2026
6ae0b96
Merge branch 'main' into support_ugrid
jwarner8 Aug 6, 2026
22e136d
relax requirement for masked
jwarner8 Aug 7, 2026
3107e11
fix np.nan
jwarner8 Aug 7, 2026
d06a9f2
fix rain
jwarner8 Aug 12, 2026
2a1ebc5
fix rain
jwarner8 Aug 12, 2026
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
13 changes: 9 additions & 4 deletions src/CSET/operators/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _setup_spatial_map(

# Add coastlines and borderlines if cube contains x and y map coordinates.
# Avoid adding lines for 2D masked data or specific fixed ancillary spatial plots.
if (cube.ndim > 1 and iris.util.is_masked(cube.data)) or any(
if cube.ndim > 1 and any(
name in cube.name() for name in ["land_", "orography", "altitude"]
):
pass
Expand Down Expand Up @@ -747,7 +747,7 @@ def _plot_and_save_spatial_plot(
# Add watermark with min/max/mean. Currently not user togglable.
# In the bbox dictionary, fc and ec are hex colour codes for grey shade.
axes.annotate(
f"Min: {np.min(cube.data):.3g} Max: {np.max(cube.data):.3g} Mean: {np.mean(cube.data):.3g}",
f"Min: {np.nanmin(np.asarray(cube.data)):.3g} Max: {np.nanmax(np.asarray(cube.data)):.3g} Mean: {np.nanmean(np.asarray(cube.data)):.3g}",
xy=(0.025, yinfopad),
xycoords="axes fraction",
xytext=(-5, 5),
Expand Down Expand Up @@ -1093,6 +1093,8 @@ def _plot_and_save_line_power_spectrum_series(
xname = xcoord.points

yfield = cube.data # power spectrum
if np.all(np.isnan(yfield)):
yfield = np.zeros_like(yfield)
label = None
color = "black"
if model_colors_map:
Expand Down Expand Up @@ -1469,7 +1471,7 @@ def _plot_and_save_vector_plot(
# Add watermark with min/max/mean. Currently not user togglable.
# In the bbox dictionary, fc and ec are hex colour codes for grey shade.
axes.annotate(
f"Min: {np.min(cube_vec_mag.data):.3g} Max: {np.max(cube_vec_mag.data):.3g} Mean: {np.mean(cube_vec_mag.data):.3g}",
f"Min: {np.nanmin(np.asarray(cube_vec_mag.data)):.3g} Max: {np.nanmax(np.asarray(cube_vec_mag.data)):.3g} Mean: {np.nanmean(np.asarray(cube_vec_mag.data)):.3g}",
xy=(0.05, -0.05),
xycoords="axes fraction",
xytext=(-5, 5),
Expand Down Expand Up @@ -1605,7 +1607,10 @@ def _plot_and_save_histogram_series(
ax.set_ylabel(
f"Contribution to mean ({iter_maybe(cubes)[0].units})", fontsize=14
)
ax.set_xlim(vmin, vmax)
try:
ax.set_xlim(vmin, vmax)
except ValueError:
pass
ax.tick_params(axis="both", labelsize=12)

# Overlay grid-lines onto histogram plot.
Expand Down
24 changes: 21 additions & 3 deletions src/CSET/operators/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
get_cube_yxcoordname,
is_spatialdim,
)
from CSET.operators.regrid import restructure_ugrid

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -234,9 +235,24 @@ def _load_model(
"""Load a single model's data into a CubeList."""
input_files = _check_input_files(paths)
# If unset, a constraint of None lets everything be loaded.
logger.debug("Constraint: %s", constraint)
cubes = iris.load(input_files, constraint, callback=_loading_callback)
# If required, compute wind_speed from components.

logging.debug("Constraint: %s", constraint)

cubes = iris.load(input_files)

# If a cube called latitude exists, chances are its unstructured/flattened. If
# so, then pass through restructure_ugrid to make rectilinear.
if len(cubes.extract("latitude")) > 0:
cubes = restructure_ugrid(cubes, constraint)

for cube in cubes:
_loading_callback(cube, None, None)

# Extract required cubes based on constraint
cubes = cubes.extract(constraint)

# cubes = iris.load(input_files, constraint, callback=_loading_callback)
# Make the UM's winds consistent with LFRic.
cubes = _compute_winds(cubes)

# Add model_name attribute to each cube to make it available at any further
Expand Down Expand Up @@ -454,6 +470,8 @@ def _um_normalise_callback(cube: iris.cube.Cube):
f"Unknown STASH code: {stash}. Please check file stash_to_lfric.py to update.",
level=logging.WARNING,
)
if cube.standard_name == "lwe_thickness_of_precipitation_amount":
cube.long_name = "surface_microphysical_rainfall_rate"


def _lfric_normalise_callback(cube: iris.cube.Cube):
Expand Down
Loading