slippy.surface.DiscFreqSurface¶
- class slippy.surface.DiscFreqSurface(frequencies: Sequence[float], amplitudes: Sequence[float] = (1,), phases: Sequence[float] = (0,), rotation: numbers.Number = 0, shift: Optional[tuple] = None, generate: bool = False, grid_spacing: Optional[float] = None, extent: Optional[tuple] = None, shape: Optional[tuple] = None)[source]¶
Surfaces with discrete frequency components
This surface produces a profile with frequency components which are constant in th y direction, these can be rotated and combined by addition or subtraction to give any combination of frequencies.
- Parameters
frequencies (Sequence[float]) – The frequencies present in the surface
amplitudes (Sequence[float], optional ((1, ))) – The amplitude of each frequency, must be same length as frequencies
phases (Sequence[float] = (0,)) – The phases of each of the frequencies, must be the same length as frequencies
rotation (Number = 0) – If set the surface is rotated by the set amount, in radians
shift (tuple, optional (None)) – If set the origin of the surface is shifted by the set amount in the x and y directions, should be a two element tuple of float. By default, the surface is shifted so that the origin becomes the centre of the surface. To stop this behaviour specify a shift of (0, 0)
generate (bool, optional (False)) – If True the surface profile is generated on instantiation, else it can be generated by the discretise method. If True two of the: grid_spacing, extent or shape must also be set
grid_spacing (float, optional (None)) – The grid spacing of the surface profile
extent (tuple, optional (None)) – The overall dimensions of the surface in the same units as the grid spacing, should be a two element tuple of float
shape (tuple = None) – The number of points in each direction of the surface array, should be a two element tuple of integers
See also
Notes
Roughness functions are aliased from the functions provided in the surface module
Examples
>>> mySurf=DiscFreqSurface(10, 0.1) >>> mySurf.extent=[0.5,0.5] >>> mySurf.discretise(0.001)
- __init__(frequencies: Sequence[float], amplitudes: Sequence[float] = (1,), phases: Sequence[float] = (0,), rotation: numbers.Number = 0, shift: Optional[tuple] = None, generate: bool = False, grid_spacing: Optional[float] = None, extent: Optional[tuple] = None, shape: Optional[tuple] = None)[source]¶
Methods
__init__(frequencies[, amplitudes, phases, ...])convert_coordinates(y_coord, x_coord)discretise()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
height(x_mesh, y_mesh)Find the height of the surface at specified points
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
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])Translate the profile of the surface
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
acfThe auto correlation function of the surface profile
dimensionsThe number of spatial dimensions that
extentThe overall dimensions of the surface in the same units as grid spacing
fftThe fast fourier transform of the surface
grid_spacingThe distance between grid points in the x and y directions
is_analyticis_discreteA bool flag, True if there is a profile present
maskA 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
materialA material object describing the properties of the surface
moving_surfaceprofileThe height data for the surface profile
psdThe power spectral density of the surface
shapeThe shape of the surface profile array, the number of points in each direction
sizeThe total number of points in the surface
surface_typeA description of the surface type
unworn_profilewear_volumes