Skip to content

Creating diagnostic for reading observation from Cardington single point location#1890

Open
mo-jbrooke wants to merge 8 commits intomainfrom
1750_2m_Cardington_air_temperature
Open

Creating diagnostic for reading observation from Cardington single point location#1890
mo-jbrooke wants to merge 8 commits intomainfrom
1750_2m_Cardington_air_temperature

Conversation

@mo-jbrooke
Copy link
Contributor

@mo-jbrooke mo-jbrooke commented Jan 27, 2026

Adding CSET recipe and timeseries plot in loaders.

Contribution checklist

Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

…int location. Adding CSET recipe and timeseries plot in loaders.
@jfrost-mo jfrost-mo changed the title Creating diagnostic for reading observation from Cardington single po… Creating diagnostic for reading observation from Cardington single point location Feb 18, 2026
Copy link
Member

@jfrost-mo jfrost-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given a quick look over, and while there are a few things that need tidying up or testing it is overall looking very good.

lon_max = cube.attributes.get("geospatial_lon_max")

if None in (lat_min, lat_max, lon_min, lon_max):
raise ValueError("No geospatial metadata available")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't want to make this a hard error, in case we want to load data that isn't spatial. (Though I can't think of any examples off the top of my head.) This is what is causing all of the current test failures.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file. The old version is tracked in the git history.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other reviewers, this file is best viewed with "hide whitespace" enabled, as the actual change is quite small.

category=BoundaryWarning,
stacklevel=2,
)
if np.abs((lat_tr - lat_pt)) > 0.1 or np.abs((lat_tr > lat_pt)) > 0.1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What minimum resolution data does this allow? Would you be able to compare quarter degree ERA5 for example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the changes in this file. They can be removed with:

git restore -s main src/CSET/operators/plot.py
git add src/CSET/operators/plot.py
git commit

for attr in iter_maybe(attribute):
cube.attributes.pop(attr, None)

cubes = cubes.merge()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cubes = cubes.merge()
# Combine things that can be merged due to remove removing the
# attributes.
cubes = cubes.merge()

Add a comment explaining why this is needed.

lon_val = (lon_min + lon_max) / 2.0
lat_val = (lat_min + lat_max) / 2.0

# print (lat_val, lon_val)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# print (lat_val, lon_val)

def _fix_no_spatial_coords_callback(cube: iris.cube.Cube):
import CSET.operators._utils as utils

# # Don't modify spatial cubes that already have spatial dimensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# # Don't modify spatial cubes that already have spatial dimensions
# Don't modify spatial cubes that already have spatial dimensions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will want a test adding.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will want a test adding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments