-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting row, col in input data array coorespointing to selection (nearest point) #42
Comments
Hi @axelschweiger (sorry for the long wait!), I'm thinking about two ways where you can get the array position indices:
It would be useful to have a convenient way to do that, although I'm not sure how look like the API. Perhaps a simple use-case example would help? |
Benoit
Thanks for the answer. I’m in the middle of getting ready for a lengthy trip so won’t have time to get a “use-case” example together until later the summer. Will try then.
Axel
From: Benoit Bovy ***@***.***>
Sent: Friday, May 26, 2023 07:01
To: xarray-contrib/xoak ***@***.***>
Cc: Axel J Schweiger ***@***.***>; Mention ***@***.***>
Subject: Re: [xarray-contrib/xoak] Getting row, col in input data array coorespointing to selection (nearest point) (Issue #42)
Hi @axelschweiger<https://urldefense.com/v3/__https:/github.com/axelschweiger__;!!K-Hz7m0Vt54!gi-_JcyIDlTs66K-guIkoFNajimq9X5zZgTbkzYeOA75a-lNxsCqvMHQIJedwIgEwnnlij2-3y5pcc6mfmQFET4$> (sorry for the long wait!),
I'm thinking about two ways where you can get the array position indices:
* When doing ds_out = ds_in.xoal.sel(...), the coordinates in ds_out are aligned with the corresponding coordinates in ds_in so I guess you could use that to retrieve the indices
* Use directly the API of the underlying index objects (scipy, scikit-learn, s2index)
It would be useful to have a convenient way to do that, although I'm not sure how look like the API. Perhaps a simple use-case example would help?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/xarray-contrib/xoak/issues/42*issuecomment-1564440430__;Iw!!K-Hz7m0Vt54!gi-_JcyIDlTs66K-guIkoFNajimq9X5zZgTbkzYeOA75a-lNxsCqvMHQIJedwIgEwnnlij2-3y5pcc6mOeqWumU$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ALJTXMJIHXJVAASOBTEJYULXICZSNANCNFSM6AAAAAAU3ZTEHU__;!!K-Hz7m0Vt54!gi-_JcyIDlTs66K-guIkoFNajimq9X5zZgTbkzYeOA75a-lNxsCqvMHQIJedwIgEwnnlij2-3y5pcc6m8ju86Ro$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just found xoak which sounds like great tool. This so maybe silly question, but I am wondering if there is a way of not only returning the closest data value in the input array (let's say it is two dimensional), but also the row and column corresponding to the selected point(s). in my application, I'd like to change the value of that point so I need someway to access it.
Thanks
Axel
The text was updated successfully, but these errors were encountered: