regularizepsf
regularizepsf copied to clipboard
Resolve confusion on x/y and array row/column
CoordinateIdentifier is defined as storing x and y coordinates. After star identification, a bunch of CoordinateIdentifers are instantiated, with sep's x going into the y slot and vice-versa, so the x/y slots of CoordinateIdentifer are really being used as row/column slots. And indeed, when making the stellar cutouts, x is used for the vertical axis and y the horizontal axis.
I'm not sure what the ultimate goal is for CoordinateIdentifer, but I think either its fields should be renamed as row/column or similar, or the x and y fields should be used consistently as vertical and horizontal coordinates. (This bit me while visualizing my patches.)
I've waffled back and forth between whether to use a namedTuple with the CoordinateIdentifier versus just a regular tuple without named fields. Did you have a preference or an alternative suggestion?
You're right that we should clarify the convention and be consistent though. I'm fine with making it row and col.
One upside to using the namedTuple is that one doesn't have to memorize/look up the order of the elements in the tuple, and it cuts down on the use of magic numbers (e.g. xs = [k['x'] for k in cpc.keys()] vs. xs = [k[2] for k in cpc.keys()])
Changing the names to "row" and "col" might indeed be the easiest fix here.