Skip to content

Add coordinate transform index #24

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

Merged
merged 11 commits into from
Jul 9, 2025

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Jul 9, 2025

Adding an example for xarray.indexes.CoordinateTransformIndex.

@Cadair -- to give you some context, we are building in this repository a gallery of Xarray index examples. I included here your Astropy WCS experiment from https://gist.github.com/Cadair/4a03750868e044ac4bdd6f3a04ed7abc, it is a great illustration for CoordinateTransformIndex! I hope you don't mind?

```

```{code-cell} python
da_2d.plot.pcolormesh(x="pos_eq_ra", y="pos_eq_dec");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
da_2d.plot.pcolormesh(x="pos_eq_ra", y="pos_eq_dec");
da_2d.plot.pcolormesh(x="pos_eq_ra", y="pos_eq_dec", norm=colors.LogNorm());

The figure looked like no data to me (granted I'm in a bright sunny place right now :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's a dark sky! :)

I've improved the contrast a bit and changed the colormap.

Copy link
Contributor

@scottyhq scottyhq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Not sure if it's possible to 'double' list this in the TOC, because it would also be nice to have an Astronomy section to go along with Earth Sciences to encourage more non geoscience examples and participation

@benbovy
Copy link
Member Author

benbovy commented Jul 9, 2025

Not sure if it's possible to 'double' list this in the TOC, because it would also be nice to have an Astronomy section to go along with Earth Sciences to encourage more non geoscience examples and participation

Yes I agree that would be nice. It'll probably be easier if this is eventually implemented in a Python library (or in Astropy itself!). In the meantime, I mentioned "Astronomy" in the title of the example subsection.

@Cadair
Copy link

Cadair commented Jul 9, 2025

Awesome! Thanks for making the example work nicely. Hopefully soon I can come back to this and make the slicing and other nice things work.

@benbovy benbovy merged commit ac94b97 into xarray-contrib:main Jul 9, 2025
2 checks passed
@benbovy benbovy deleted the add-coordinate-transform-index branch July 9, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants