sunpy / ndcube

A base package for multi-dimensional contiguous and non-contiguous coordinate-aware arrays. "Maintainers": @danryanirish & @Cadair
http://docs.sunpy.org/projects/ndcube/
BSD 2-Clause "Simplified" License
44 stars 45 forks source link

Add convenience coordinate methods to NDCube #709

Open DanRyanIrish opened 1 month ago

DanRyanIrish commented 1 month ago

PR Description

This PR adds 4 methods for getting the certain common coordinate types for all array indices of relevant axes:

These are convenience methods for NDCube.axis_world_coords. If the WCS does not contain the relevant axis, None is returned.

Cadair commented 1 month ago

I have many thoughts on this.

DanRyanIrish commented 1 month ago

I have many thoughts on this.

I knew you would :) I look forward to them.

DanRyanIrish commented 1 month ago

I have many thoughts on this.

@Cadair Would your thoughts be something more along the lines of #710 ?

Cadair commented 1 month ago

Yes that's a starter.

DanRyanIrish commented 1 month ago

Yes that's a starter.

Well if we can agree the API, at least for coords.celestial, coords.spectral and coords.time, we can push ahead with that and change the underlying implementation at a later time, as well as expand the API as desired.