Join GitHub today
Simplify region base classes #107
In December 2016 @joleroi @astrofrog and I had a Google hangout where we discussed
I dropped the ball on implementing the changes discussed there, but I'd like to come back to that now. Actually, if this is non-controversial, I'd like to make the changes this week, before the regions 0.2 release, because it's not a lot of work, just removing a bunch of stuff instead of leaving dummy methods that return
Basically we said that
The reason is that
So we'd like to propose basically that we adopt the DS9 model of having regions mainly defined as pixel regions, and having sky regions mostly as convenience, but not with separate definitions of
In the future, we would add the special cases (circle & polygon) back where contains is well-defined in sky coordinates, either as separate classes or on the existing classes.
This brings us to the other major change we'd like to propose, which is to get rid of the different modes in the pixel to sky transformation:
This was never implemented, it was just an idea, there will be no functionality lost.
So for now, we'd remove the modes from the base class, only leaving the "mode" how DS9 transforms back and forth, and we'd remove all the checks and NotImplementedError from the derived classes.
I have no objections to your proposed changes. I haven't considered the implications too deeply, but the arguments you laid out seem reasonable. Most use cases I can think of involving 'contains' are indeed in pixel space or expressible in a cartesian coordinate representation (e.g., I want to know all objects in a box in Galactic coordinates) and can be special cased.
referenced this issue
Feb 15, 2017
Sorry I didn't find time to do this yet.