OpenZGY/Python API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Public Member Functions | List of all members
openzgy.impl.stats.StatisticData Class Reference

Public Member Functions

def __init__ (self, other=None)
 
def __repr__ (self)
 
def __str__ (self)
 
def add (self, data, factor)
 
def scale (self, slope, intercept)
 
def __eq__ (self, other)
 
def __ne__ (self, other)
 
def __add__ (self, other)
 
def __iadd__ (self, other)
 
def __mul__ (self, factor)
 
def __rmul__ (self, factor)
 
def __imul__ (self, factor)
 

Detailed Description

Accumulate statistics: count, sum, sum of squares, and value range.

Member Function Documentation

◆ scale()

def openzgy.impl.stats.StatisticData.scale (   self,
  slope,
  intercept 
)
Calculate the linear transform needed to convert from one range
(typically the natural data range of the integral storage type)
to the data range that the application wants to see.
Then update the statistics in place so they look like the transform
had been done on every single data point before adding it.

The decoded value Y is given by a linear transform of the coded value X:

  Y = intercept + slope*X

where intercept and slope are given by the coding range and the value range
of type T (see below). The statistics of Y are then:

  SUM_Y = SUM(intercept + slope*x)
= n*intercept + slope*SUM(x) = n*intercept + slope*SUM_X

  SSQ_Y = SUM((intercept + slope*x)^2)
= SUM(intercept^2 + 2*intercept*slope*x + slope^2*x^2)
= n*intercept^2 + 2*intercept*slope*SUM(x) + slope^2*SUM(x^2)
= n*intercept^2 + 2*intercept*slope*SUM_X + slope^2*SSQ_X

  MIN_Y = MIN(intercept + slope*x)
= intercept + slope*MIN(x)
= intercept + slope*MIN_X

  MAX_Y = MAX(intercept + slope*x)
= intercept + slope*MAX(x)
= intercept + slope*MAX_X

The documentation for this class was generated from the following file: