MetOffice / MetOffice/ai_data_readiness
Suggestion for the spatial consistency check
- Dominant language
- Jupyter Notebook
- Stars
- 5
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
When using the spatial consistency check for OSTIA data, I noticed that even though the spatial resolution is not "consistent", the differences are small enough that they could be potentially ignored. It would be useful to additionally print just how inconsistent the resolution is, e.g.
```diff
--- a/src/aidatareadiness/checklist_auto/gridded.py
+++ b/src/aidatareadiness/checklist_auto/gridded.py
@@ -141,6 +141,8 @@ def check_spatial_consistency(dataset):
if not np.allclose(lat_diff, lat_diff[0]) or not np.allclose(lon_diff, lon_diff[0]):
logger.warning("Spatial resolution is not consistent.")
+ print("sample lat resolution: ", lat_diff[0], ", largest diff: ", np.max(lat_diff)-np.min(lat_diff))
+ print("sample lon resolution: ", lon_diff[0], ", largest diff: ", np.max(lon_diff)-np.min(lon_diff))
return False
logger.info("Spatial resolution is consistent.")
```
(In case of OSTIA, the resolution was 0.5 deg, with diff of 1e-6)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/aidatareadiness/checklist_auto/gridded.py at check_spatial_consistency(dataset), where the existing warning is emitted. Review how lat_diff and lon_diff are calculated, then make the consistency warning report the sample resolution and largest difference for each axis. Done means the OSTIA-like inconsistency is quantified while the check still returns False.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100