GXST class

class geosoft.gx.GXST
Mono-variate statistics. The ST class is used to accumulate statistical
information about a set of data. This class is usually used in conjunction
with others. For instance, geosoft.gx.GXDU.stat() (see DU) will add a channel's
data to the ST object, and sComputeST_IMG (see IMG) will compute
statistics for a grid.

Note:

*** Histogram ranges and colour zone ranges ***

Histogram bins are defined with inclusive minima and exclusive maxima;
for instance if Min = 0 and Inc = 1, then the second bin would include
all values z such that  0 >= z > 1 (the first bin has all values < 0).

Colour zones used in displaying grids (ITR, ZON etc...) are the
opposite, with exclusive minima and inclusive maxima.
For instance, if a zone is defined from 0 to 1, then it would
contain all values of z such that 0 > z >= 1.

These definitions mean that it is impossible to perfectly assign
ITR colours to individual bars of a histogram. The best work-around
when the data values are integers is to define the colour zones using
0.5 values between the integers. A general work-around is to make the
number of histogram bins much larger than the number of colour zones.

See also  ST2 (bi-variate statistics)
static create((GXContext)ctx) → GXST:
This method creates a statistics object which is used to
accumulate statistics.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:ST Object
Return type:geosoft.gx.GXST

New in version 5.0.0.

static create_exact((GXContext)ctx) → GXST:
This method creates a statistics object which stores
all values.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:ST Object
Return type:geosoft.gx.GXST

New in version 5.1.8.

data((float)arg1) → None:
Add this value to the statistics object.
Parameters:arg1 (float) – Value to Add
Returns:Nothing
Return type:None

New in version 5.0.0.

data_vv((GXVV)arg1) → None:
Add all the values in this VV to the statistics object.
Parameters:arg1 (geosoft.gx.GXVV) – VV object
Returns:Nothing
Return type:None

New in version 5.0.0.

equivalent_percentile((float)arg1) → float:
Return corresponding Percentile for a Value.
Parameters:arg1 (float) – input value
Returns:The percentile at the given value (0 - 100)
Return type:float

New in version 5.0.8.

Note:

Statistics and histogram must have been calculated prior to
calling this method
equivalent_value((float)arg1) → float:
Return corresponding Value for a Percentile
Parameters:arg1 (float) – input percentile (0 - 100)
Returns:The value at the given percentile.
Return type:float

New in version 5.0.8.

Note:

Statistics and histogram must have been calculated prior to
calling this method
get_histogram_bins((GXVV)arg1) → None:
Retrieve number of items in each hostogram bin
Parameters:arg1 (geosoft.gx.GXVV) – VV for numbers of items
Returns:Nothing
Return type:None

New in version 6.1.0.

Note:

The length of the returned VV is set to the total
number of bins. If a histogram is not defined in
the ST, then the returned length is zero.
get_histogram_info((int_ref)arg1, (float_ref)arg2, (float_ref)arg3) → None:
Retrieve number of bins, min and max value in histogram
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.1.0.

Note:

The items correspond to those in geosoft.gx.GXST.histogram2().
If a histogram is not defined in
the ST, then the returned number of bins is zero, and
the min and max values will be dummies.
get_info((int)arg1) → float:
This method allows you to retrieve (and compute) the
information from the ST object.
Parameters:arg1 (int) – ST_INFO constants
Returns:Data you asked for GS_R8DM for none
Return type:float

New in version 5.0.0.

Note:

The following can only be determined if the ST has recorded
a histogram: ST_MEDIAN, ST_MODE

ST_MINPOS can be used to retrieve the smallest value greater
than zero, but not from ST objects recovered from serialized object.
static get_norm_prob((GXContext)ctx, (float)arg1) → float:
return percent value
Parameters:
Returns:

real

Notes this function is based on Normal Cumulative distribution function mit to about 5 standard deviations

Return type:

float

New in version 7.1.0.

static get_norm_prob_x((GXContext)ctx, (float)arg1) → float:
Return number of sigmas from 50% a given percent is
Parameters:
Returns:

real

Notes this function is based on Normal Cumulative distribution function mit to about 5 standard deviations

Return type:

float

New in version 7.1.0.

histogram((int)arg1) → None:
This method prepares ST for recording histogram.
Parameters:arg1 (int) – # of bins
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

The Number of bins includes the one before the minimum
and the one after the maximum, so it must be a value >2.

IMPORTANT: This function gets the histogram minimum and
maximum from the current min and max values stored in the ST,
so this is equivalent to calling

geosoft.gx.GXST.histogram2()( #bins, Min, (Max-Min)/(# bins -2));

You should already have the data loaded in order to call this
function.

See the note above "Histogram ranges and colour zone ranges"
histogram2((int)arg1, (float)arg2, (float)arg3) → None:
This method prepares ST for recording histogram.
Parameters:
  • arg1 (int) – # of bins
  • arg2 (float) – Min
  • arg3 (float) – Max
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The Number of bins includes the one before the minimum
and the one after the maximum, so it must be a value >2.
The width of the individual bins will be (Min-Max)/(# - 2)

See the note above "Histogram ranges and colour zone ranges"
is_null() → bool

Check if the instance of geosoft.gx.GXST is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXST, False otherwise.
Return type:bool`
normal_test() → float:
Test the "normality" of the histogram distribution
Returns:The normality statistic. Terminates if no histogram in the ST object.
Return type:float

New in version 5.0.0.

Note:

This function compares the histogram to a normal curve with the
same mean and standard deviation. The individual counts are normalized
by the total counts, the bin width and the standard deviation.
For each bin, the rms difference between the expected probability and
the normalized count is summed, and the final result is normalized by
the total number of bins. In this way histograms with different means,
standard deviations, number of bins and counts can be compared.
If the histogram were perfectly normal, then a value of 0 would be returned.
The more "non-normal", the higher the statistic.
static null() → GXST

A null (undefined) instance of geosoft.gx.GXST

Returns:A null geosoft.gx.GXST
Return type:geosoft.gx.GXST
reset() → None:
Resets the Statistics.
Returns:Nothing
Return type:None

New in version 5.0.0.

ST_INFO constants

Information to retrieve
gx.ST_ITEMS = 0
Number of non-dummy items
gx.ST_NPOS = 1
Number of items greater than zero
gx.ST_NZERO = 22
Number of items equal to zero
gx.ST_DUMMIES = 2
gx.ST_MIN = 3
gx.ST_MAX = 4
gx.ST_RANGE = 5
gx.ST_MEAN = 6
gx.ST_MEDIAN = 7
gx.ST_MODE = 8
gx.ST_GEOMEAN = 9
gx.ST_VARIANCE = 10
gx.ST_STDDEV = 11
gx.ST_STDERR = 12
gx.ST_SKEW = 13
gx.ST_KURTOSIS = 14
gx.ST_BASE = 15
gx.ST_SUM = 16
Sums and sums of powers
gx.ST_SUM2 = 17
gx.ST_SUM3 = 18
gx.ST_SUM4 = 19
gx.ST_MINPOS = 21
Smallest value greater than zero.
gx.ST_HIST_MAXCOUNT = 100