Ejemplo n.º 1
0
 def scaleAndShift(self, scale, shift):
     """Scale and shift spectrum points"""
     
     # scale and shift spectrum data
     if self.properties['showSpectrum']:
         
         # if no data
         if len(self.spectrumCropped)==0:
             self.spectrumScaled = self.spectrumCropped
         else:
             self.spectrumScaled = calculations.scaleAndShift(self.spectrumCropped, scale[0], scale[1], shift[0], shift[1])
             
     # scale and shift peaklist data
     if self.properties['showSpectrum'] or self.properties['showLabels'] or self.properties['showTicks']:
         
         # if no data
         if len(self.peaklistCropped)==0:
             self.peaklistScaled = self.peaklistCropped
         else:
             scale = numpy.array((scale[0], scale[1], scale[1]))
             shift = numpy.array((shift[0], shift[1], shift[1]))
             self.peaklistScaled = scale * self.peaklistCropped + shift
     
     self.currentScale = scale
     self.currentShift = shift
Ejemplo n.º 2
0
    def scaleAndShift(self, scale, shift):
        """Scale and shift spectrum points"""

        # scale and shift spectrum data
        if self.properties['showSpectrum']:

            # if no data
            if len(self.spectrumCropped) == 0:
                self.spectrumScaled = self.spectrumCropped
            else:
                self.spectrumScaled = calculations.scaleAndShift(
                    self.spectrumCropped, scale[0], scale[1], shift[0],
                    shift[1])

        # scale and shift peaklist data
        if self.properties['showSpectrum'] or self.properties[
                'showLabels'] or self.properties['showTicks']:

            # if no data
            if len(self.peaklistCropped) == 0:
                self.peaklistScaled = self.peaklistCropped
            else:
                scale = numpy.array((scale[0], scale[1], scale[1]))
                shift = numpy.array((shift[0], shift[1], shift[1]))
                self.peaklistScaled = scale * self.peaklistCropped + shift

        self.currentScale = scale
        self.currentShift = shift
Ejemplo n.º 3
0
 def scaleAndShift(self, scale, shift):
     """Scale and shift points"""
     
     # recalculate data
     if len(self.points) != 0:
         self.scaled = calculations.scaleAndShift(self.cropped, scale[0], scale[1], shift[0], shift[1])
     
     self.currentScale = scale
     self.currentShift = shift
Ejemplo n.º 4
0
    def scaleAndShift(self, scale, shift):
        """Scale and shift points"""

        # recalculate data
        if len(self.points) != 0:
            self.scaled = calculations.scaleAndShift(self.cropped, scale[0],
                                                     scale[1], shift[0],
                                                     shift[1])

        self.currentScale = scale
        self.currentShift = shift