ndcube icon indicating copy to clipboard operation
ndcube copied to clipboard

Util for reordering axes in an NDCube

Open DanRyanIrish opened this issue 4 years ago • 2 comments

Description

A request has been made for a tool that reorders the axes of an NDCube. Similar to numpy.roll?

DanRyanIrish avatar Jan 13 '21 18:01 DanRyanIrish

@rosteen, would like to elaborate a little on this request?

DanRyanIrish avatar Jan 13 '21 18:01 DanRyanIrish

Essentially, my use case is that I'm making sure one can initialize a Spectrum1D by inputting an NDCube object, and Spectrum1D demands that the spectral axis be last. So I was looking to be maximally lazy and save a couple lines of code if a function to simultaneously reorder both the data array and wcs existed.

It's not a big deal for me to handle reordering the axes in a slightly more manual fashion if the input isn't already in the right order, so I'd personally rate this as a lower priority "nice-to-have".

rosteen avatar Jan 13 '21 19:01 rosteen