def subPlot(self): global CurrentWaveFront wa = WaveFrontAnalysis(getCurrentLens(), getDesignWavelength()) CurrentWaveFront = wa.fitZernike(getCurrentAngle(),getDefaultWavelength(),ZernikeOrder,\ getReferencePointOption()) self.interferometer.setWaveFront(CurrentWaveFront) self.displayPlot()
def __init__(self,lens, design = None): """ Constructor """ self.lens = lens self.design = getDesignWavelength(design) self.refpt = Vector3d() self.ip = self.lens.backFocalPlane(self.design) # Make back focal plane to proagate to
def subPlot(self): kt = KnifeTest(getCurrentLens(), getCurrentAngle(), getCurrentWavelength(), getDesignWavelength()) # New knife test kt.setKnife(CurrentKnife, CurrentKnifeAngle, CurrentKnifeShift) # Set knife kt.setWire(CurrentWire) kt.setReference(getReferencePointOption()) kt.getImage().draw() # make and plot image plt.title(getCurrentLens().title)
def subPlot(self): """ Method to set up the spot analysis, and trace the rays. This need to be called if any of the geometry of the sytsem changes. """ # Make a new SpotAnalysis object (which will trace the rays) self.spot = SpotAnalysis(getCurrentLens(),getCurrentAngle(),getReferencePointOption(),\ getCurrentWavelength(),getDesignWavelength()) self.updatePlane()
def __init__(self, delta=0.5, order=0, theta=0.0, design=getDesignWavelength(), transmission=1.0): """ """ self.delta = float(delta) self.order = int(order) self.design = float(design) self.transmission = float(transmission) self.angle = parseAngle(theta) self.setWavelength(getDefaultWavelength())
def __init__(self, parent=None, closeAction=None): super(WaveLengthSetter, self).__init__(parent) self.closeAction = closeAction self.setAutoFillBackground(True) p = self.palette() p.setColor(self.backgroundRole(), Qt.white) self.setPalette(p) # The default wavelength spinner currentLabel = QLabel("Current : ") self.currentSpin = QDoubleSpinBox() # Default wave spinner self.currentSpin.setValue(getCurrentWavelength()) self.currentSpin.setSingleStep(0.01) self.currentSpin.setRange(BlueLimit, RedLimit) self.currentSpin.valueChanged.connect(self.currentValueChange) # The design wavelength spinner designLabel = QLabel("Design : ") self.designSpin = QDoubleSpinBox() # Design wave spinner self.designSpin.setValue(getDesignWavelength()) self.designSpin.setSingleStep(0.01) self.designSpin.setRange(BlueLimit, RedLimit) self.designSpin.valueChanged.connect(self.designValueChange) # The close and rest buttons closeButton = QPushButton("Close") # The close button closeButton.clicked.connect(self.closeButtonClicked) resetButton = QPushButton("Reset") resetButton.clicked.connect(self.resetButtonClicked) # Use Grid layout layout = QGridLayout() layout.addWidget(currentLabel, 0, 0) # Add the 6 item in Grid layout.addWidget(self.currentSpin, 0, 1) layout.addWidget(designLabel, 1, 0) layout.addWidget(self.designSpin, 1, 1) layout.addWidget(resetButton, 2, 0) layout.addWidget(closeButton, 2, 1) self.setLayout(layout) self.setWindowTitle("Wavelength Setter")
def __init__(self, lens, source=0.0, refopt=0, wavelength=None, design=None): """ The constrcutor """ # Sort out source if isinstance(source, ray.SourcePoint): # From a sourcepoint self.source = source elif isinstance(source, float): self.source = Unit3d(Angle(source)) # Infinite Object else: self.source = Unit3d(source) wave = getDefaultWavelength(wavelength) design = getDesignWavelength(design) # Make raypencil (this is used in draw()) self.raypencil = ray.RayPencil().addBeam(lens, source, "array", wavelength=wave) self.raypencil *= lens # Propagate through lens self.pt = lens.imagePoint(source, design) if refopt == 1: self.pt = Psf().setWithRays( self.raypencil, self.pt.z) # Centre of PSF in image plane if refopt == 2: self.pt = Psf().optimalArea( self.raypencil, self.pt.z) # Optimal area PSF, not in image plane
def subPlot(self): """ Method to do the actual plot (called automatically """ wa = WaveFrontAnalysis(getCurrentLens(), getDesignWavelength()) wa.drawAberrationPlot(getCurrentAngle(), getCurrentWavelength())
def __init__(self, theta=0.0, order=0, design=getDesignWavelength(), transmission=1.0): WavePlate.__init__(self, 0.25, theta, order, design, transmission)