mpdaf icon indicating copy to clipboard operation
mpdaf copied to clipboard

coord method in mpdaf.obj.coords is confusing

Open andresgur opened this issue 1 year ago • 0 comments

I believe the coord function inside mpdaf.obj.coords is a bit of confusing at the moment.

First, there's the spaxel keyword, whose purpose is not documented, but my impression that if given everything will be assumed to be in pixel units, hence the "unit" keyword will be ignored. This should be stated in the docs.

Second, inside the code, I think what is called "x" is actually "y" and viceversa. e.g.

pixcrd = np.indices((self.naxis2, self.naxis1))
        if spaxel:
            x, y = pixcrd

Isn't naxis2 associated with y axis and naxis1 with x axis?

It also says it returns dec ra (i.e. y, x) but then the return line reads return x,y.

So I believe it should be stated in the docs clearly what the spaxel keyword does, and double check whether x,y are being named correctly in the code.

andresgur avatar May 16 '24 15:05 andresgur