Commit e00a52a
authored
Add longitude normalization to CUDA inverse projection kernels (#1089)
* Add longitude normalization to CUDA inverse projection kernels (#1088)
Six CUDA inverse projection kernels returned raw `lam + lon0` without
wrapping to [-pi, pi]. The CPU Numba kernels all pass through
`_norm_lon_rad()` before converting to degrees. Without normalization,
coordinates far from the central meridian (e.g., near the antimeridian)
can produce longitude values outside [-180, 180].
Added `_d_norm_lon_rad` device function and applied it to:
- LCC inverse (2 return paths)
- AEA inverse
- CEA inverse
- Sinusoidal inverse
- LAEA inverse
- Polar Stereographic inverse
Also removed dead code in `_tmerc_params()` where a loop computed
a value that was immediately overwritten.
* Address review: normalize CPU LCC early-return path, move constants (#1088)
- Add _norm_lon_rad to CPU _lcc_inv_point early-return (rho < 1e-30)
for consistency with the CUDA fix
- Move _WGS84_E2/_WGS84_A constants to top of test file1 parent a7c2399 commit e00a52a
File tree
3 files changed
+75
-17
lines changed- xrspatial
- reproject
- tests
3 files changed
+75
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| |||
1739 | 1739 | | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | | - | |
| 1742 | + | |
| 1743 | + | |
1743 | 1744 | | |
1744 | 1745 | | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
| 1746 | + | |
| 1747 | + | |
1753 | 1748 | | |
1754 | 1749 | | |
1755 | 1750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
| |||
291 | 300 | | |
292 | 301 | | |
293 | 302 | | |
294 | | - | |
| 303 | + | |
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
298 | | - | |
| 307 | + | |
299 | 308 | | |
300 | 309 | | |
301 | 310 | | |
| |||
355 | 364 | | |
356 | 365 | | |
357 | 366 | | |
358 | | - | |
| 367 | + | |
359 | 368 | | |
360 | 369 | | |
361 | 370 | | |
| |||
404 | 413 | | |
405 | 414 | | |
406 | 415 | | |
407 | | - | |
| 416 | + | |
408 | 417 | | |
409 | 418 | | |
410 | 419 | | |
| |||
476 | 485 | | |
477 | 486 | | |
478 | 487 | | |
479 | | - | |
| 488 | + | |
480 | 489 | | |
481 | 490 | | |
482 | 491 | | |
| |||
594 | 603 | | |
595 | 604 | | |
596 | 605 | | |
597 | | - | |
| 606 | + | |
598 | 607 | | |
599 | 608 | | |
600 | 609 | | |
| |||
670 | 679 | | |
671 | 680 | | |
672 | 681 | | |
673 | | - | |
| 682 | + | |
674 | 683 | | |
675 | 684 | | |
676 | 685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
1387 | 1391 | | |
1388 | 1392 | | |
1389 | 1393 | | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
1390 | 1444 | | |
1391 | 1445 | | |
1392 | 1446 | | |
| |||
0 commit comments