resistics.transfunc.data module¶

class resistics.transfunc.data.TransferFunctionData(freq: numpy.ndarray, data: Dict, variances: Dict)[source]

Class for holding information time data

Notes

Information about data units Magnetic permeability in nT . m / A Electric (E) data is in mV/m Magnetic (H) data is in nT Z = E/H is in mV / m . nT Units of resistance = Ohm = V / A T = H/H is dimensionless

Attributes
freqnp.ndarray

The evaluation frequencies for which transfer functions were estimated

periodnp.ndarray

The evaluation periods for which the transfer functions were estimated (1/freq)

The transfer function data keyed by polarisations. Data is in the units E = mV, H = nT

polarisationsList[str]

List of polarisations in the data

variancesDict

The variances of the estimates to give an idea of uncertainty

Methods

 __init__(freq, data, variances) Initialise the transfer function data getComponent(component) Set data with parameters getVariance(component) Add a comment to the dataset getResAndPhase(component) A datetime array of the sample times getResAndPhaseErrors(component) View the spectra data view() View the impedance tensor components viewTipper() View the tipper printList() Class status returned as list of strings
getComponent(self, component: str) → numpy.ndarray[source]

Get data for a polarisation

Parameters
componentstr

The polarisation to return the data for

Returns
np.ndarray

The data for the polarisation component

getResAndPhase(self, component: str) → Tuple[numpy.ndarray, numpy.ndarray][source]

Return the resistivity and phase for a component

The raw data is expected to be units E = mV, H = nT Resisitivity is calculated as 0.2 * period * (abs(data))^2 Phase is calculated as the complex angle, unwrapped and then shifted for components ExHx and ExHy to put them in 0-90 degree quadrant

Parameters
componentstr

The polarisation to return the data for

Returns
resnp.ndarray

The resistivity for the evaluation frequencies

phasenp.ndarray

The phase for the evaluation frequencies

getResAndPhaseErrors(self, component: str) → Tuple[numpy.ndarray, numpy.ndarray][source]

Return the resistivity and phase errors for a component

The raw data is expected to be units E = mV, H = nT Errors are calculated parameterically (for confidence intervals) Error in resistivity is given by 1.96 * sqrt(2 * period * res * var / 5.0) Error in phase is given by 1.96 * (180 / pi) * (sqrt(var / 2.0) / abs(data))

Todo

Is there are better way to calculate errors

Parameters
componentstr

The polarisation to return the data for

Returns
resErrornp.ndarray

The errors in resistivity data for the evaluation frequencies

phaseErrornp.ndarray

The errors in phase data for the evaluation frequencies

getTipper(self)[source]

Return tipper length and angle

The tipper are the Tx = HzHx and Ty = HzHy components The tipper length is sqrt(Re(Tx)^2 + Re(Ty)^2) The tipper angle is arctan (Re(Ty)/Re(Tx))

This needs HzHx and HzHy to be components of the transfer function

Returns
tipperLengthnp.ndarray

The tipper length

tipperAnglenp.ndarray

The tipper angle

getVariance(self, component: str) → numpy.ndarray[source]

Get the variance for a component

Parameters
componentstr

The polarisation to return the data for

Returns
np.ndarray

The data for the polarisation component

printList(self) → List[str][source]

Class information as a list of strings

Returns
outList[str]

List of strings with information

viewImpedance(self, **kwargs) → matplotlib.figure.Figure[source]

Plots the transfer function data

For resistivity data, both axes are log scale (period and resistivity). For phase data, period is in log scale and phase is linear scale. Units, x axis is seconds, resistivity is Ohm m and phase is degrees.

Parameters
polarisationsList[str], optional

Polarisations to plot

figmatplotlib.pyplot.figure, optional

A figure object

oneplotbool, optional

Boolean flag for plotting all polarisations on one plot rather than separate plots

coloursDict[str, str], optional

Colours dictionary for plotting impedance components

mkstr, optional

Plot marker type

lsstr, optional

Line style

plotfontsDict, optional

A dictionary of plot fonts

labelstr, optional

Label for the plots

xlimList, optional

Limits for the x axis

res_ylimList, optional

Limits for the resistivity y axis

phase_ylimList, optional

Limits for the phase y axis

Returns
plt.figure

Matplotlib figure object

viewTipper(self, **kwargs) → matplotlib.figure.Figure[source]

Plots tipper data where available

For length data, both axes are log scale (period and length). For angle data, period is in log scale and phase is linear scale. Units, x axis is seconds, length is dimensionless and angle is degrees.

Parameters
figmatplotlib.pyplot.figure, optional

A figure object

colsbool, optional

There are three tipper plots: tipper length, tipper real angle, tipper imaginary angle. These can either be plotted in rows or columns. Set to True to plot in with one row and three columns.

Colour of plot

mkstr, optional

Plot marker type

lsstr, optional

Line style

plotfontsDict, optional

A dictionary of plot fonts

labelstr, optional

Label for the plots

xlimList, optional

Limits for the x axis

length_ylimList, optional

Limits for the length y axis

angle_ylimList, optional

Limits for the angle y axis