Data
digraph inheritance6003e78ca1 { 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"]; "Data" [URL="#geobipy.src.classes.data.dataset.Data.Data",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="Class defining a set of Data."]; "Point" -> "Data" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Point" [URL="../../pointcloud/Point.html#geobipy.src.classes.pointcloud.Point.Point",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="3D Point Cloud with x,y,z co-ordinates"]; "myObject" -> "Point" [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)"]; }@Data_Class Module describing a Data Set where values are associated with an xyz co-ordinate
- class geobipy.src.classes.data.dataset.Data.Data(components=None, channels_per_system=1, x=None, y=None, z=None, elevation=None, data=None, std=None, predictedData=None, fiducial=None, lineNumber=None, units=None, channel_names=None, **kwargs)
Class defining a set of Data.
Data(channels_per_system, x, y, z, data, std, predictedData, dataUnits, channel_names)
- Parameters:
nPoints (int) – Number of points in the data.
channels_per_system (int or array_like) – Number of data channels in the data * If int, a single acquisition system is assumed. * If array_like, each item describes the number of points per acquisition system.
x (geobipy.StatArray or array_like, optional) – The x co-ordinates. Default is zeros of size nPoints.
y (geobipy.StatArray or array_like, optional) – The y co-ordinates. Default is zeros of size nPoints.
z (geobipy.StatArrayor array_like, optional) – The z co-ordinates. Default is zeros of size nPoints.
data (geobipy.StatArrayor array_like, optional) – The values of the data. * If None, zeroes are assigned
std (geobipy.StatArrayor array_like, optional) – The uncertainty estimates of the data. * If None, ones are assigned if data is None, else 0.1*data
predictedData (geobipy.StatArrayor array_like, optional) – The predicted data. * If None, zeros are assigned.
dataUnits (str) – Units of the data.
channel_names (list of str, optional) – Names of each channel of length sum(channels_per_system)
- Returns:
out – Data class
- Return type:
- Bcast(world, root=0)
Broadcast a Data object using MPI
- Parameters:
world (mpi4py.MPI.COMM_WORLD) – MPI communicator
root (int, optional) – The MPI rank to broadcast from. Default is 0.
- Returns:
out – Data broadcast to each core in the communicator
- Return type:
geobipy.Data
- Scatterv(starts, chunks, world, root=0)
Scatterv a Data object using MPI
- Parameters:
starts (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the starting index for a chunk to be sent to that core. e.g. starts[0] is the starting index for rank = 0.
chunks (array of ints) – 1D array of ints with size equal to the number of MPI ranks. Each element gives the size of a chunk to be sent to that core. e.g. chunks[0] is the chunk size for rank = 0.
world (mpi4py.MPI.Comm) – The MPI communicator over which to Scatterv.
root (int, optional) – The MPI rank to broadcast from. Default is 0.
- Returns:
out – The Data distributed amongst ranks.
- Return type:
geobipy.Data
- property active
Logical array whether the channel is active or not.
An inactive channel is one where channel values are NaN for all points.
- Returns:
out – Indices of non-NaN columns.
- Return type:
bools
- addToVTK(vtk, prop=['data', 'predicted', 'std'], system=None)
Adds a member to a VTK handle.
- Parameters:
vtk (pyvtk.VtkData) – vtk handle returned from self.vtkStructure()
prop (str or list of str, optional) – List of the member to add to a VTK handle, either “data”, “predicted”, or “std”.
system (int, optional) – The system for which to add the data
- property additive_error
The data.
- append(other)
Append pointclouds together
- Parameters:
other (geobipy.PointCloud3D) – 3D pointcloud
- channel_index(channel, system)
Gets the data in the specified channel
- Parameters:
channel (int) – Index of the channel to return * If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]
system (int, optional) – The system to obtain the channel from.
- Returns:
out – The index of the channel
- Return type:
int
- createHdf(parent, myName, withPosterior=True, fillvalue=None)
Create the hdf group metadata in file parent: HDF object to create a group inside myName: Name of the group
- property data
The data.
- data_misfit(squared=False)
Compute the \(L_{2}\) norm squared misfit between the observed and predicted data
\[\| \mathbf{W}_{d} (\mathbf{d}^{obs}-\mathbf{d}^{pre})\|_{2}^{2},\]where \(\mathbf{W}_{d}\) are the reciprocal data errors.
- Parameters:
squared (bool) – Return the squared misfit.
- Returns:
out – The misfit value.
- Return type:
float64
- datapoint(i)
Get the ith data point from the data set
- Parameters:
i (int) – The data point to get
- Returns:
out – The data point
- Return type:
geobipy.DataPoint
- property deltaD
Get the difference between the predicted and observed data,
\[\delta \mathbf{d} = \mathbf{d}^{pre} - \mathbf{d}^{obs}.\]- Returns:
out – The residual between the active observed and predicted data.
- Return type:
- classmethod fromHdf(grp, **kwargs)
Reads the object from a HDF group
- line(line)
Get the data from the given line number
- mapData(channel, system=None, *args, **kwargs)
Interpolate the data channel between the x, y co-ordinates.
- Parameters:
channel (int) – Index of the channel to return * If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]
system (int, optional) – The system to obtain the channel from.
- mapPredictedData(channel, system=None, *args, **kwargs)
Interpolate the predicted data channel between the x, y co-ordinates.
- Parameters:
channel (int) – Index of the channel to return * If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]
system (int, optional) – The system to obtain the channel from.
- mapStd(channel, system=None, *args, **kwargs)
Interpolate the standard deviation channel between the x, y co-ordinates.
- Parameters:
channel (int) – Index of the channel to return * If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]
system (int, optional) – The system to obtain the channel from.
- nPointsPerLine()
Gets the number of points in each line.
- Returns:
out – Number of points in each line
- Return type:
ints
- plot_data(x='index', channels=None, system=None, **kwargs)
Plots the specifed channels as a line plot.
Plots the channels along a specified co-ordinate e.g. ‘x’. A legend is auto generated.
- Parameters:
xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) If xAxis is ‘x’, returns self.x If xAxis is ‘y’, returns self.y If xAxis is ‘z’, returns self.z If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.
channels (ints, optional) – Indices of the channels to plot. All are plotted if None * If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]
values (arraylike, optional) – Specifies values to plot against the chosen axis. Takes precedence over channels.
system (int, optional) – The system to obtain the channel from.
legend (bool) – Attach a legend to the plot. Default is True.
- Returns:
ax (matplotlib.axes) – Plot axes handle
legend (matplotlib.legend.Legend) – The attached legend.
See also
geobipy.plotting.plot
For additional keyword arguments
- plot_predicted(xAxis='index', channels=None, system=None, **kwargs)
Plots the specifed predicted data channels as a line plot.
Plots the channels along a specified co-ordinate e.g. ‘x’. A legend is auto generated.
- Parameters:
xAxis (str) – If xAxis is ‘index’, returns numpy.arange(self.nPoints) If xAxis is ‘x’, returns self.x If xAxis is ‘y’, returns self.y If xAxis is ‘z’, returns self.z If xAxis is ‘r2d’, returns cumulative distance along the line in 2D using x and y. If xAxis is ‘r3d’, returns cumulative distance along the line in 3D using x, y, and z.
channels (ints, optional) – Indices of the channels to plot. All are plotted if None * If system is None, 0 <= channel < self.nChannels else 0 <= channel < self.nChannelsPerSystem[system]
system (int, optional) – The system to obtain the channel from.
noLegend (bool) – Do not attach a legend to the plot. Default is False, a legend is attached.
- Returns:
ax (matplotlib.axes) – Plot axes handle
legend (matplotlib.legend.Legend) – The attached legend.
See also
geobipy.plotting.plot
For additional keyword arguments
- property predictedData
The predicted data.
- classmethod read_csv(data_filename, **kwargs)
Reads the data and system parameters from file
- Parameters:
dataFilename (str or list of str) – Time domain data file names
systemFilename (str or list of str) – Time domain system file names
Notes
File Format
The data columns are read in according to the column names in the first line. The header line should contain at least the following column names. Extra columns may exist, but will be ignored. In this description, the column name or its alternatives are given followed by what the name represents. Optional columns are also described.
Required columns
- line
Line number for the data point
- id or fid
Id number of the data point, these be unique
- x or northing or n
Northing co-ordinate of the data point
- y or easting or e
Easting co-ordinate of the data point
- z or dtm or dem_elev or dem_np or topo
Elevation of the ground at the data point
- alt or laser or bheight
Altitude of the transmitter coil
- Off[0] to Off[nWindows-1] (with the number and brackets)
The measurements for each time specified in the accompanying system file under Receiver Window Times
Optional columns
If any loop orientation columns are omitted the loop is assumed to be horizontal.
- TxPitch
Pitch of the transmitter loop
- TxRoll
Roll of the transmitter loop
- TxYaw
Yaw of the transmitter loop
- RxPitch
Pitch of the receiver loop
- RxRoll
Roll of the receiver loop
- RxYaw
Yaw of the receiver loop
- OffErr[0] to ErrOff[nWindows-1]
Error estimates for the data
See also
INFORMATION
- property relative_error
The data.
- property std
The data.
- property summary
Display a summary of the Data
- writeHdf(parent, name, withPosterior=True)
Write the StatArray to an HDF object parent: Upper hdf file or group myName: object hdf name. Assumes createHdf has already been called create: optionally create the data set as well before writing