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.

map_coordinates does not seem to work with order unspecified

See original GitHub issue

I’m trying to use cupyx.scipy.ndimage.map_coordinates to convert images to polar coordinates. In the documentation it says the default order is 1 when left unspecified. I was trying to use this function for polar transforming images but kept getting 0 arrays returned. Only when I explicitly set order=1 did it work:

Minimal example:

import cupy as cp
import matplotlib.pyplot as plt
import numpy as np

image = np.arange(100).reshape((10,10))
im_gpu = cp.asarray(image)
plt.imshow(image)

image

from cupyx.scipy.ndimage import map_coordinates

cor = cp.array([[0, 5, 9],[0, 5, 9]], dtype=cp.float32)
map_coordinates(im_gpu, cor) # returns [0 0 0] 
map_coordinates(im_gpu, cor, order=1) # returns [0 55 99]

I tried this with various dtypes of both the image and coordinate arrays with the same behavior.

  • Conditions
OS                           : Linux-4.12.14-197.56-default-x86_64-with-glibc2.10
CuPy Version                 : 8.5.0
NumPy Version                : 1.20.1
SciPy Version                : 1.6.0
Cython Build Version         : 0.29.22
CUDA Root                    : /u/ncautaerts/conda-envs/nielsenv
CUDA Build Version           : 11000
CUDA Driver Version          : 11000
CUDA Runtime Version         : 11000
cuBLAS Version               : 11200
cuFFT Version                : 10201
cuRAND Version               : 10201
cuSOLVER Version             : (10, 6, 0)
cuSPARSE Version             : 11101
NVRTC Version                : (11, 0)
Thrust Version               : 100909
CUB Build Version            : 100909
cuDNN Build Version          : 8100
cuDNN Version                : 8100
NCCL Build Version           : 2804
NCCL Runtime Version         : 2804
cuTENSOR Version             : 10202
Device 0 Name                : Tesla V100-PCIE-32GB
Device 0 Compute Capability  : 70
Device 1 Name                : Tesla V100-PCIE-32GB
Device 1 Compute Capability  : 70
  • Error messages, stack traces, or logs

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
din14970commented, May 13, 2021

seems like it’s fixed and works exactly like the scipy function!

3reactions
leofangcommented, Apr 30, 2021

Yes, all planned releases are for v9.x and v10.x (https://github.com/cupy/cupy/issues/5049).

Read more comments on GitHub >

github_iconTop Results From Across the Web

MapKit | Apple Developer Forums
My mapkit app has to work in areas where there is no cell or internet service. Can mapkit download a local map or...
Read more >
Preferred order of writing latitude & longitude tuples in GIS ...
EPSG:4326 specifically states that the coordinate order should be latitude, longitude. Many software packages still use longitude, latitude ordering.
Read more >
ACF PRO Google Maps and Yootheme Dynamic Content not ...
In ACF PRO, we created a field for Google Map coordinates to be entered when a new listing is created. However when we...
Read more >
Google Maps - Find GPS coordinates, longitude, latitude ...
Use this tool to find and display the Google Maps coordinates (longitude and latitude) of any place in the world. Type an address...
Read more >
Coordinate points not lining up with a preexisting map on QGIS
If the county map is in EPSG:2237, better leave it that way. DO NOT use Set Layer CRS to change it, that will...
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