Histogram

digraph inheritance05266a41c8 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Histogram" [URL="#geobipy.src.classes.statistics.Histogram.Histogram",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Model" -> "Histogram" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Model" [URL="../model/Model_.html#geobipy.src.classes.model.Model.Model",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generic model class with an attached mesh."]; "myObject" -> "Model" [arrowsize=0.5,style="setlinewidth(0.5)"]; "myObject" [URL="../core/myObject.html#geobipy.src.classes.core.myObject.myObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "myObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class geobipy.src.classes.statistics.Histogram.Histogram(mesh=None, values=None)
credible_intervals(percent=90.0, axis=0)

Gets the median and the credible intervals for the specified axis.

Parameters:
  • percent (float) – Confidence percentage.

  • log ('e' or float, optional) – Take the log of the credible intervals to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • axis (int) – Along which axis to obtain the interval locations.

Returns:

  • med (array_like) – Contains the medians along the specified axis. Has size equal to arr.shape[axis].

  • low (array_like) – Contains the lower interval along the specified axis. Has size equal to arr.shape[axis].

  • high (array_like) – Contains the upper interval along the specified axis. Has size equal to arr.shape[axis].

credible_range(percent=90.0, log=None, axis=0)

Get the range of credibility with depth

Parameters:
  • percent (float) – Percent of the credible intervals

  • log ('e' or float, optional) – If None: The range is the difference in linear space of the credible intervals If ‘e’ or float: The range is the difference in log space, or ratio in linear space.

  • axis (int) – Axis along which to get the marginal histogram.

fit_mixture_to_pdf_1d(mixture, **kwargs)

Find peaks in the histogram along an axis.

Parameters:
  • intervals (array_like, optional) – Accumulate the histogram between these invervals before finding peaks

  • axis (int, optional) – Axis along which to find peaks.

classmethod fromHdf(grp, index=None)

Reads in the object from a HDF file

marginalize(axis=0)

Get the marginal histogram along an axis

Parameters:
  • intervals (array_like) – Array of size 2 containing lower and upper limits between which to count.

  • log ('e' or float, optional) – Entries are given in linear space, but internally bins and values are logged. Plotting is in log space.

  • axis (int) – Axis along which to get the marginal histogram.

Returns:

out

Return type:

geobipy.Histogram1D

mean(axis=0)

Gets the mean along the given axis.

This is not the true mean of the original samples. It is the best estimated mean using the binned counts multiplied by the axis bin centres.

Parameters:
  • log ('e' or float, optional.) – Take the log of the mean to base “log”

  • axis (int) – Axis to take the mean along.

Returns:

out – The means along the axis.

Return type:

geobipy.DataArray

median(log=None, axis=0)

Gets the median for the specified axis.

Parameters:
  • log ('e' or float, optional) – Take the log of the median to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • axis (int) – Along which axis to obtain the median.

Returns:

out – The medians along the specified axis. Has size equal to arr.shape[axis].

Return type:

array_like

mode(log=None, axis=0)

Gets the median for the specified axis.

Parameters:
  • log ('e' or float, optional) – Take the log of the median to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • axis (int) – Along which axis to obtain the median.

Returns:

out – The medians along the specified axis. Has size equal to arr.shape[axis].

Return type:

array_like

opacity(percent=95.0, log=None, axis=0)

Return an opacity between 0 and 1 based on the difference between credible invervals of the hitmap.

Higher ranges in credibility map to less opaqueness.

Parameters:
  • percent (float, optional.) – Confidence percentage.

  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. Else: Take the ratio of the credible intervals.

  • axis (int, optional.) – Along which axis to obtain the interval locations.

Returns:

out – Opacity along the axis.

Return type:

array_like

opacity_level(percent=95.0, log=None, axis=0)

Get the index along axis 1 from the bottom up that corresponds to the percent opacity

pcolor(**kwargs)

Plot like an image

Parameters:
  • alpha (scalar or array_like, optional) – If alpha is scalar, behaves like standard matplotlib alpha and opacity is applied to entire plot If array_like, each pixel is given an individual alpha value.

  • log ('e' or float, optional) – Take the log of the colour to a base. ‘e’ if log = ‘e’, and a number e.g. log = 10. Values in c that are <= 0 are masked.

  • equalize (bool, optional) – Equalize the histogram of the colourmap so that all colours have an equal amount.

  • nbins (int, optional) – Number of bins to use for histogram equalization.

  • xscale (str, optional) – Scale the x axis? e.g. xscale = ‘linear’ or ‘log’

  • yscale (str, optional) – Scale the y axis? e.g. yscale = ‘linear’ or ‘log’.

  • flipX (bool, optional) – Flip the X axis

  • flipY (bool, optional) – Flip the Y axis

  • grid (bool, optional) – Plot the grid

  • noColorbar (bool, optional) – Turn off the colour bar, useful if multiple plotting plotting routines are used on the same figure.

  • trim (bool, optional) – Set the x and y limits to the first and last non zero values along each axis.

percentile(percent, log=None, reciprocate=False, axis=0)

Gets the median and the credible intervals for the specified axis.

Parameters:
  • percent (float) – Confidence percentage.

  • log ('e' or float, optional) – Take the log of the credible intervals to a base. ‘e’ if log = ‘e’, or a number e.g. log = 10.

  • axis (int) – Along which axis to obtain the interval locations.

Returns:

  • med (array_like) – Contains the medians along the specified axis. Has size equal to arr.shape[axis].

  • low (array_like) – Contains the lower interval along the specified axis. Has size equal to arr.shape[axis].

  • high (array_like) – Contains the upper interval along the specified axis. Has size equal to arr.shape[axis].

plot(overlay=None, **kwargs)

Plots the histogram

sample(n_samples, log=None)

Generates samples from the histogram.

A uniform distribution is used for each bin to generate samples. The number of samples generated per bin is scaled by the count for that bin using the requested number of samples.

Parameters:

nSamples (int) – Number of samples to generate.

Returns:

out – The samples.

Return type:

geobipy.DataArray

transparency(percent=95.0, log=None, axis=0, **kwargs)

Return a transparency value between 0 and 1 based on the difference between credible invervals of the hitmap.

Higher ranges in credibility are mapped to more transparency.

Parameters:
  • percent (float) – Confidence percentage.

  • log ('e' or float, optional.) – If None: Take the difference in credible intervals. Else: Take the ratio of the credible intervals.

  • axis (int) – Along which axis to obtain the interval locations.

Returns:

out – Transparency along the axis.

Return type:

array_like