slippy.surface.PyramidSurface¶
- class slippy.surface.PyramidSurface(lengths: Sequence, rotation: Optional[float] = None, shift: Optional[tuple] = None, generate: bool = False, grid_spacing: Optional[float] = None, extent: Optional[tuple] = None, shape: Optional[tuple] = None)[source]¶
Pyramid surface with any slopes
- Parameters
lengths ({Sequence, float}) – The characteristic lengths of the pyramid in each direction, if a scalar is given the results is a square based pyramid with 45 degree sides
rotation (float, optional (None)) – If set the surface will be rotated by this number of radians
shift (tuple, optional (None)) – If set the surface will be shifted by this distance in the and y directions, tuple should be length 2, if not set the default is to shift by half the extent, meaning that the origin becomes the centre.
generate (bool, optional (False)) – If True the surface profile is discretised on instantiation.
grid_spacing (float, optional (None)) – The distance between grid points on the surface profile
extent (tuple, optional (None)) – The overall size of the surface
shape (tuple, optional (None)) – The number of grid points in each direction on the surface
See also
Notes
This is a subclass of Surface all functionality and attributes are available within this class.
All keyword arguments allowed for Surface are also allowed on instantiation of this class apart from the profile key word.
If the extent is findable on instantiation the surface will be shifted so the natural origin is in the centre of the extent. If the extent is not findable the natural origin will be at (0,0). For a round surface the natural origin is the centre of the ball.
Examples
Making an analytically defined square based pyramid:
>>> import slippy.surface as s >>> my_surface = s.PyramidSurface((1,1,1), extent=(0.5,0.5))
Making a discretely defined square based pyramid:
>>> my_surface = s.PyramidSurface((1, 1, 3), extent=(0.5,0.5), grid_spacing=0.001, generate = True)
- __init__(lengths: Sequence, rotation: Optional[float] = None, shift: Optional[tuple] = None, generate: bool = False, grid_spacing: Optional[float] = None, extent: Optional[tuple] = None, shape: Optional[tuple] = None)[source]¶
Methods
__init__(lengths[, rotation, shift, ...])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