Пример #1
0
    def toJSON(self):
        """
        _toJSON_

        Calculate average and standard deviation, store it
        and call the parent class toJSON method
        """

        for yLabel in self.yLabels:
            numList = []
            for xValue in self.data:
                numList.append(self.data[xValue][yLabel])
            (self.average[yLabel], self.stdDev[yLabel]) = getAverageStdDev(numList)

        return SummaryHistogram.toJSON(self)
Пример #2
0
    def toJSON(self):
        """
        _toJSON_

        Calculate average and standard deviation, store it
        and call the parent class toJSON method
        """

        for yLabel in self.yLabels:
            numList = []
            for xValue in self.data:
                numList.append(self.data[xValue][yLabel])
            (self.average[yLabel],
             self.stdDev[yLabel]) = getAverageStdDev(numList)

        return SummaryHistogram.toJSON(self)
    def toJSON(self):
        """
        _toJSON_

        Bin the histogram if any, calculate the standard deviation. Store
        the internal data needed for reconstruction of the histogram
        from JSON and call superclass toJSON method.
        """
        if self.nPoints:
            self.stdDev = calculateStdDevFromQ(self.QValue, self.nPoints)
        if not self.binned and self.storeHistogram:
            self.binHistogram()
        self.jsonInternal = {}
        self.jsonInternal['yLabel'] = self.yLabel
        self.jsonInternal['QValue'] = self.QValue
        self.jsonInternal['nPoints'] = self.nPoints
        return SummaryHistogram.toJSON(self)
    def toJSON(self):
        """
        _toJSON_

        Bin the histogram if any, calculate the standard deviation. Store
        the internal data needed for reconstruction of the histogram
        from JSON and call superclass toJSON method.
        """
        if self.nPoints:
            self.stdDev = calculateStdDevFromQ(self.QValue, self.nPoints)
        if not self.binned and self.storeHistogram:
            self.binHistogram()
        self.jsonInternal = {}
        self.jsonInternal['yLabel'] = self.yLabel
        self.jsonInternal['QValue'] = self.QValue
        self.jsonInternal['nPoints'] = self.nPoints
        return SummaryHistogram.toJSON(self)