-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
I can think of at least one example where we want to use optional behavior for certain viewers in camstack that could still be modularized and shared code. As an example, consider an "astrometry" plugin. This plugin enables the additional compass rose with the parallactic angle and uses the plate scale for whatever calculations could use it (like the scale bar).
For the implementation, this would require a little architecting. These plugins would be classes, the AstrometryPlugin class would have some code like
def add_compass(self):
if self.backend_obj.flag_compass:
# code to generate pygame lines
# use vars like self.PLATE_SCALE, self.PUPIL_OFFSETand a custom viewer might look like
class MyViewer(GenericViewerFrontent, AstrometryPlugin):
PLATE_SCLAE = 6.24 # mas / px
PUPIL_OFFSET = 140.4 # deg relative to D_IMRPADThen there's some question about how to get that add_compass function actually called inside the viewer loop. Maybe some kind of self._plugin_methods = [] list? That's about as far as I've thought.