An example would be a unified Rotate layer that is a subclass of both OpticalLayer and DetectorLayer for type checking. ie
class Rotate(dLux.optics.OpticalLayer, dLux.detector.DetectorLayer):
angle: float
order: int
def rotate_wavefront(self, wavefront):
...
def rotate_image(self, image):
...
def __call__(self, input):
if isinstance(input, dLux.wavefronts.Wavefront):
return self.rotate_wavefront(input)
else:
return self.rotate_image(input)
Other candidate layers are Flip and Resize.
Some details of implementation are probably sub-optimal, such as requiring the complex parameter for the RotateWavefront but not for the RotateDetector. The benefit would be a unified and simplified API, which is reasonably desirable.
An example would be a unified
Rotate
layer that is a subclass of bothOpticalLayer
andDetectorLayer
for type checking. ieOther candidate layers are
Flip
andResize
.Some details of implementation are probably sub-optimal, such as requiring the
complex
parameter for theRotateWavefront
but not for theRotateDetector
. The benefit would be a unified and simplified API, which is reasonably desirable.Related to #239