gempy.core.data_modules.geometric_data.RescaledData

class gempy.core.data_modules.geometric_data.RescaledData(surface_points: gempy.core.data_modules.geometric_data.SurfacePoints, orientations: gempy.core.data_modules.geometric_data.Orientations, grid: gempy.core.data.Grid, rescaling_factor: float = None, centers: Union[list, pandas.core.frame.DataFrame] = None)[source]

Auxiliary class to rescale the coordinates between 0 and 1 to increase float stability.

df

Data frame containing the rescaling factor and centers

Type

pn.DataFrame

surface_points

[s0] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

Type

SurfacePoints

orientations

[s1] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

Type

Orientations

grid

[s2] Class to generate grids.

Type

Grid

Parameters
  • surface_points (SurfacePoints) –

  • orientations (Orientations) –

  • grid (Grid) –

  • rescaling_factor (float) – value which divide all coordinates

  • centers (list[float]) – New center of the coordinates after shifting

Examples using RescaledData

Methods

__init__(surface_points, orientations, grid)

Initialize self.

compute_data_center([surface_points, …])

Calculate the center of the data once it is shifted between 0 and 1.

compute_rescaling_factor([surface_points, …])

Calculate the rescaling factor of the data to keep all coordinates between 0 and 1

get_rescaled_orientations()

Get the rescaled coordinates. return an image of the interface and orientations categories_df with the X_r..

get_rescaled_surface_points()

Get the rescaled coordinates. return an image of the interface and orientations categories_df with the X_r..

max_min_coord([surface_points, orientations])

Find the maximum and minimum location of any input data in each cartesian coordinate

modify_rescaling_parameters(attribute, value)

Modify the parameters used to rescale data

rescale_data([rescaling_factor, centers])

Rescale inplace: surface_points, orientations—adding columns in the categories_df—and grid—adding values_r attributes.

rescale_data_point(data_points[, …])

This method now is very similar to set_rescaled_surface_points passing an index

rescale_grid(grid, rescaling_factor, centers)

rescale_orientations(orientations, …[, idx])

Rescale inplace: surface_points.

rescale_surface_points(surface_points, …)

Rescale inplace: surface_points.

set_rescaled_grid()

Set the rescaled coordinates and extent into a grid object

set_rescaled_orientations([idx])

Set the rescaled coordinates into the surface_points categories_df

set_rescaled_surface_points([idx])

Set the rescaled coordinates into the surface_points categories_df

__init__(surface_points: gempy.core.data_modules.geometric_data.SurfacePoints, orientations: gempy.core.data_modules.geometric_data.Orientations, grid: gempy.core.data.Grid, rescaling_factor: float = None, centers: Union[list, pandas.core.frame.DataFrame] = None)[source]

Initialize self. See help(type(self)) for accurate signature.

modify_rescaling_parameters(attribute, value)[source]

Modify the parameters used to rescale data

Parameters
  • attribute (str) – Attribute to be modified. It can be: centers, rescaling factor * centers: [s0] (numpy.ndarray[float, 3]): XYZ array with the center of the data. This controls how much we shift the input coordinate * rescaling factor: [s1] Scaling factor by which all the parameters will be rescaled

  • value (float, list[float]) –

Returns

gempy.core.data_modules.geometric_data.Rescaling

rescale_data(rescaling_factor=None, centers=None)[source]

Rescale inplace: surface_points, orientations—adding columns in the categories_df—and grid—adding values_r attributes. The rescaled values will get stored on the linked objects.

Parameters
  • rescaling_factor – [s1] Scaling factor by which all the parameters will be rescaled

  • centers – [s0] (numpy.ndarray[float, 3]): XYZ array with the center of the data. This controls how much we shift the input coordinate

Returns:

get_rescaled_surface_points()[source]
Get the rescaled coordinates. return an image of the interface and orientations categories_df with the X_r..

columns

Returns

SurfacePoints.df[['X_r', 'Y_r', 'Z_r']]

get_rescaled_orientations()[source]
Get the rescaled coordinates. return an image of the interface and orientations categories_df with the X_r..

columns.

Returns

Orientations.df[['X_r', 'Y_r', 'Z_r']]

static max_min_coord(surface_points=None, orientations=None)[source]

Find the maximum and minimum location of any input data in each cartesian coordinate

Parameters
  • surface_points (SurfacePoints) – [s0] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

  • orientations (Orientations) – [s1] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

Returns

max[XYZ], min[XYZ]

Return type

tuple

compute_data_center(surface_points=None, orientations=None, max_coord=None, min_coord=None, inplace=True)[source]

Calculate the center of the data once it is shifted between 0 and 1.

Parameters
  • surface_points (SurfacePoints) – [s0] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

  • orientations (Orientations) – [s1] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

  • max_coord (float) – Max XYZ coordinates of all GeometricData

  • min_coord (float) – Min XYZ coordinates of all GeometricData

  • inplace (bool) – if True modify the self.df rescaling factor attribute

Returns

[s2] (numpy.ndarray[float, 3]): XYZ array with the center of the data. This controls how much we shift the input coordinate

Return type

np.array

compute_rescaling_factor(surface_points=None, orientations=None, max_coord=None, min_coord=None, inplace=True)[source]

Calculate the rescaling factor of the data to keep all coordinates between 0 and 1

Parameters
  • surface_points (SurfacePoints) – [s0] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

  • orientations (Orientations) – [s1] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

  • max_coord (float) – Max XYZ coordinates of all GeometricData

  • min_coord (float) – Min XYZ coordinates of all GeometricData

  • inplace (bool) – if True modify the self.df rescaling factor attribute

Returns

[s2] Scaling factor by which all the parameters will be rescaled

Return type

float

static rescale_surface_points(surface_points, rescaling_factor, centers, idx: list = None)[source]

Rescale inplace: surface_points. The rescaled values will get stored on the linked objects.

Parameters
  • surface_points (SurfacePoints) – [s0] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

  • rescaling_factor – [s2] Calculate the rescaling factor of the data to keep all coordinates between 0 and 1

  • centers – [s1] Calculate the center of the data once it is shifted between 0 and 1.

  • idx (int, list of int) – [s3] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

Returns:

set_rescaled_surface_points(idx: Union[list, numpy.ndarray] = None)[source]

Set the rescaled coordinates into the surface_points categories_df

Parameters

idx (int, list of int) – [s0] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

Returns:

rescale_data_point(data_points: numpy.ndarray, rescaling_factor=None, centers=None)[source]

This method now is very similar to set_rescaled_surface_points passing an index

static rescale_orientations(orientations, rescaling_factor, centers, idx: list = None)[source]

Rescale inplace: surface_points. The rescaled values will get stored on the linked objects.

Parameters
  • orientations (Orientations) – [s0] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

  • rescaling_factor – [s2] Calculate the rescaling factor of the data to keep all coordinates between 0 and 1

  • centers – [s1] Calculate the center of the data once it is shifted between 0 and 1.

  • idx (int, list of int) – [s3] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

Returns:

set_rescaled_orientations(idx: Union[list, numpy.ndarray] = None)[source]

Set the rescaled coordinates into the surface_points categories_df

Parameters

idx (int, list of int) – [s0] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

Returns:

set_rescaled_grid()[source]

Set the rescaled coordinates and extent into a grid object