slippy.surface.HurstFractalSurface

class slippy.surface.HurstFractalSurface(sigma: float, hurst_exponent: float, roll_off_frequency: float = 0, generate: bool = False, grid_spacing: Optional[float] = None, extent: Optional[tuple] = None, shape: Optional[tuple] = None)[source]

Hurst fractal surfaces

Parameters
  • sigma (float) – The RSM roughness of the surface

  • hurst_exponent (float) – The hurst exponent, must be between 0 and 1, related to the fractal dimension by D = 3-H

  • roll_off_frequency (float, optional (0.0)) –

  • generate (bool, optional (False)) – If true the surface profile is generated on instantiation, two of: grid_spacing, extent or shape must be set

  • grid_spacing (float, optional (None)) – The grid spacing of the surface profile

  • extent (tuple, optional (None)) – The overall surface dimensions in the x and y directions

  • shape (tuple, optional (None)) – The number of grid points in the x and y directions, computation is faster for powers of 2

See also

ProbFreqSurface, RandomSurface, surface_like

Notes

generates a hurst fractal surface with frequency components from q0 to cut off frequency in even steps of q0.

amplitudes are given by:

q0 amplitude**2 *((h**2+k**2)/2)**(1-Hurst parameter)

where h,k = -N…N where N=cut off frequency/ q0 phases are randomly generated on construction of the surface object, repeated calls to the discretise function will discretise on the same surface but repeated calls to this class will generate different realisations

References

A new efficient numerical method for contact mechanics of rough surfaces C.Putignano L.Afferrante G.Carbone G.Demelio

Examples

>>> #create the surface object with the specified fractal parameters
>>> my_surface=HurstFractalSurface(1,0.2,1000, shape=(128, 128), grid_spacing=0.01)
>>> #descrtise the surface over a grid 1 unit by 1 unit with a grid_spacing of 0.01
>>> my_surface.discretise()
>>> my_surface.show()
__init__(sigma: float, hurst_exponent: float, roll_off_frequency: float = 0, generate: bool = False, grid_spacing: Optional[float] = None, extent: Optional[tuple] = None, shape: Optional[tuple] = None)[source]

Methods

__init__(sigma, hurst_exponent[, ...])

convert_coordinates(y_coord, x_coord)

discretise([return_new])

Generate a new profile realisation, return a new surface if needed

fill_holes([hole_value, mk_copy, ...])

Replaces specified values with filler

find_summits([mask, four_nearest, ...])

Find summits after low pass filtering

get_acf([profile_in])

Find the auto correlation function of the surface

get_fft([profile_in])

Find the fourier transform of the surface

get_height_of_mat_vr(ratio[, void, mask, ...])

Find the height of a given material or void volume ratio

get_mat_vr(height[, void, mask, ratio])

Find the material or void volume ratio for a given height

get_points_from_extent([extent, ...])

Gets the grid points from the extent and the grid spacing

get_psd()

Find the power spectral density of the surface

get_summit_curvature([summits, mask, ...])

Get summit curvatures

interpolate(y_points, x_points[, mode, ...])

Easy memoized interpolation on surface objects

low_pass_filter(cut_off_freq[, return_copy])

Low pass FIR filter the surface profile

max_shape()

mesh(depth[, method, parameters])

Returns a Mesh object for the surface

read_al3d(file_name[, return_data])

Reads an alicona al3d file and sets the profile and grid_spacing property of the surface

read_csv(file_name[, delimiter, ...])

Read a profile from a csv or txt file, header lines are automatically skipped

read_mat(path[, profile_name, grid_spacing_name])

Reads .mat files as surfaces

resample([new_grid_spacing, return_profile, ...])

Resample or crop the profile by interpolation

rotate(radians)

roughness(parameter_name[, mask, ...])

Find areal roughness parameters

shift([shift])

show([property_to_plot, plot_type, ax, ...])

Plot surface properties

subtract_polynomial(order[, mask])

Flatten the surface by subtracting a polynomial

wear(name, x_pts, y_pts, depth)

Add wear / geometry changes to the surface profile

Attributes

acf

The auto correlation function of the surface profile

dimensions

The number of spatial dimensions that

extent

The overall dimensions of the surface in the same units as grid spacing

fft

The fast fourier transform of the surface

grid_spacing

The distance between grid points in the x and y directions

is_analytic

is_discrete

A bool flag, True if there is a profile present

mask

A mask used to exclude some values from analysis, a single float or an array of bool the same size as profile Either a boolean array of size self.size or a float of the value to be excluded

material

A material object describing the properties of the surface

moving_surface

profile

The height data for the surface profile

psd

The power spectral density of the surface

shape

The shape of the surface profile array, the number of points in each direction

size

The total number of points in the surface

surface_type

A description of the surface type

unworn_profile

wear_volumes