question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explicit check for matching coords

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
bradyrxcommented, Sep 9, 2020

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.

0reactions
aaronspringcommented, Jul 27, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found