slippy.surface.get_mat_vr¶
- slippy.surface.get_mat_vr(height: float, profile: numpy.ndarray, void: bool = False, mask: {<class 'numpy.ndarray'>, <class 'float'>} = None, ratio=True, grid_spacing=None)[source]¶
Finds the material or void volume ratio
Finds the material or void volume for a given plane height, uses an approximation (that each point is a column of material)
- Parameters
profile (2D array-like or Surface object) – The surface profile to be used in the calculation
height (float) – The height of the cut off plane
void (bool optional (False)) – If set to true the void volume will be calculated otherwise the material volume is calculated
mask (array-like (bool) same shape as profile or float (defaults to None)) – If an array, the array is used as a mask for the profile, must be the same shape as the profile, if a float is given, values which match are excluded from the calculation
ratio (bool optional (True)) – If true the material or void ratio will be returned, if false the absolute value will be returned, this requires the grid_spacing keyword to be set
grid_spacing (float) – The distance between adjacent grid points in the surface
- Returns
out – The requested output parameter
- Return type
float
See also
Notes
This function should not be used without first flattening the surface using subtract_polynomial
This function uses a simplified algorithm assuming that each point in the surface can be modeled as a column of material.
Examples