Creating diagnostic for reading observation from Cardington single point location#1890
Creating diagnostic for reading observation from Cardington single point location#1890mo-jbrooke wants to merge 8 commits intomainfrom
Conversation
…int location. Adding CSET recipe and timeseries plot in loaders.
Allows constraining on the presence and value of cube attributes.
…ator Add attribute constraint operator
…s are not specified as coordinates
…ffice/CSET into 1750_2m_Cardington_air_temperature
jfrost-mo
left a comment
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Remove this file. The old version is tracked in the git history.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
What minimum resolution data does this allow? Would you be able to compare quarter degree ERA5 for example?
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| # 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 |
There was a problem hiding this comment.
| # # Don't modify spatial cubes that already have spatial dimensions | |
| # Don't modify spatial cubes that already have spatial dimensions. |
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.