musevlt / mpdaf

MUSE Python Data Analysis Framework
BSD 3-Clause "New" or "Revised" License
15 stars 4 forks source link

coord method in mpdaf.obj.coords is confusing #38

Open andresgur opened 1 month ago

andresgur commented 1 month ago

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.