Explicit check for matching coords
See original GitHub issueThis has been an issue on my mind for awhile. But we need to have something in checks.py
that acts as a decorator to check that the input Datasets/DataArrays being compared have the same coordinate labeling (outside of time).
For instance,
import climpred
hind = climpred.tutorial.load_dataset('CESM-DP-SST-3D')
verif = climpred.tutorial.load_dataset('FOSI-SST-3D')
# Add nlat/nlon coordinates only on one.
h['nlat'] = np.arange(h.nlat.size)
h['nlon'] = np.arange(h.nlon.size)
climpred.prediction.compute_hindcast(h, v, max_dof=True)
This returns
ValueError: indexes along dimension 'nlat' are not equal
I’ve encountered this a lot when something I’m comparing to drops coords along the way or doesn’t have them to begin with. And it makes you think something in climpred
is broken during alignment, like we’re losing spatial cells. In reality it’s just that one has a coordinate for nlat
and one doesn’t.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
xarray.combine_by_coords
This function attempts to combine a group of datasets along any number of dimensions into a single entity by inspecting coords and metadata...
Read more >CO-ORDS - Jacqueline City Apparel
CO -ORDS. Shop coordinating outfits here at Jacqueline City Apparel.
Read more >Page 35 - Women's Co-ords | Matching Outfits & Two Piece Sets
Page 35 - Shop women's co-ords and matching sets, exclusively at ASOS. ... Motel high neck cross back crop top in retro brown...
Read more >Using astropy.coordinates to Match Catalogs and Plan ...
A SkyCoord can be created most easily directly from angles as shown below. It's also wise to explicitly specify the frame your coordinates...
Read more >SkyCoord — Astropy v5.2
The coordinates to search around to try to find matching points in this SkyCoord . This should be an object with array coordinates,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s a good point regarding people wanting to regrid. Maybe just throw a warning. Whenever you add a dataset, check the union of coords and warn if they don’t match.
Or we don’t do this coords checking (only do it for time to check calendar) because then we could use xesmf regridding to regrid different datasets to 1x1 or 5x5 der grids which then should match