Note
Functions for calculating surfaces and analyzing them.
Module author: Adam Gagorik <adam.gagorik@gmail.com>
Force the numpy array passed to be 3D via np.expand_dims().
Parameters: | array (numpy.ndarray) – numpy array |
---|
Wrapper around np.loadtxt. Forces data to be at least 3 dimensions.
Parameters: |
|
---|---|
Parm shape: | reshape data |
Load surface from file. Takes into account the file extension.
ext | func |
---|---|
pkl | common.load_pkl() |
npy | numpy.load() |
chk | surface.load_chk() |
inp | surface.load_chk() |
csv | surface.load_ascii() |
txt | surface.load_ascii() |
dat | surface.load_ascii() |
png | scipy.ndimage.imread() |
jpg | scipy.ndimage.imread() |
jpeg | scipy.ndimage.imread() |
Parameters: | |
---|---|
Returns: | image |
Return type: |
Warning
image file (png, jpg, etc) data is forced into range [0,255].
Warning
data is always made 3D via numpy.expand_dims()
Warning
image data is rotated by -90 degrees.
Save numpy array to vtkImageData XML file. You can open it in paraview.
Parameters: |
|
---|
Save numpy array to Langmuir checkpoint file.
Parameters: |
|
---|
Save object to a file. Takes into account the file extension.
ext | func |
---|---|
pkl | common.load_pkl() |
npy | numpy.load() |
vti | surface.save_cti() |
csv | np.savetxt() |
txt | np.savetxt() |
dat | np.savetxt() |
png | scipy.misc.imsave() |
jpg | scipy.misc.imsave() |
jpeg | scipy.misc.imsave() |
Parameters: |
---|
Warning
image file (png, jpg, etc) data is forced into range [0,255].
Warning
if ndims is 3 and an image file is being saved, only a slice is saved.
Set values in array above {v} to {v1}, and below {v} to {v0}.
Parameters: |
---|
Map values in array to fall in the range [n,m].
Parameters: |
---|
Produces numbers in the range [-0.5, 0.5].
Parameters: | size – shape of output |
---|---|
Type: | int |
Compute wavelength, wavenumber, etc from an interval length (L) and number of waves (n).
Parameters: |
---|
>>> wx = WaveDimensions(10, 2)
>>> print wx
[Wave Dimensions]
L = 10
n = 2
lambda = 5.00000e+00
nubar = 2.00000e-01
k = 1.25664e+00
Surface function f(x,y,z) for gyroid.
Parameters: |
---|
>>> w = WaveDimensions(10, 2)
>>> x, y, z = np.mgrid[0:10:100j,0:10:100j,0:10:100j]
>>> gyroid(x, y, z, w.k, w.k, w.k)
Surface function f(x,y,z) for scherk.
Parameters: |
---|
>>> w = WaveDimensions(10, 2)
>>> x, y, z = np.mgrid[0:10:100j,0:10:100j,0:10:100j]
>>> scherk_first_surface(x, y, z, w.k, w.k, w.k)
Wrapper around f_* that uses WaveDimensions.
Surface function f(x,y,z) for psurface.
Parameters: |
---|
>>> w = WaveDimensions(10, 2)
>>> x, y, z = np.mgrid[0:10:100j,0:10:100j,0:10:100j]
>>> schwarz_p_surface(x, y, z, w.k, w.k, w.k)
Wrapper around f_* that uses WaveDimensions.
Surface function f(x,y,z) for dsurface.
Parameters: |
---|
>>> w = WaveDimensions(10, 2)
>>> x, y, z = np.mgrid[0:10:100j,0:10:100j,0:10:100j]
>>> schwarz_d_surface(x, y, z, w.k, w.k, w.k)
Wrapper around f_* that uses WaveDimensions.
Surface function f(x,y,z) for bands that run along z-direction.
Parameters: |
---|
>>> w = WaveDimensions(10, 2)
>>> x, y, z = np.mgrid[0:10:100j,0:10:100j,0:10:100j]
>>> bandXY(x, y, z, w.k, w.k, w.k)
Surface function f(x,y,z) for bands that run along y-direction.
Parameters: |
---|
>>> w = WaveDimensions(10, 2)
>>> x, y, z = np.mgrid[0:10:100j,0:10:100j,0:10:100j]
>>> bandXZ(x, y, z, w.k, w.k, w.k)
Surface function f(x,y,z) for bands that run along x-direction.
Parameters: |
---|
>>> w = WaveDimensions(10, 2)
>>> x, y, z = np.mgrid[0:10:100j,0:10:100j,0:10:100j]
>>> bandYZ(x, y, z, w.k, w.k, w.k)
An x, y, z, v mgrid.
Parameters: |
---|
An x, y, z, v mgrid. Computes v using the function = f(x, y, z) passed. See Kernel for more parameters.
An x, y, z, v mgrid. Computes v using the function = f(x, y, z) passed. Creates x, y, z domain using spacing and number of points.
Parameters: |
---|
An x, y, z, v mgrid. Computes v using random noise. Creates x, y, z domain using spacing and number of points. See SimpleKernel for more parameters.
An x, y, z, v mgrid. The size of the grid is determined using the stdev of the Gaussian PDF.
Parameters: |
---|
Performs convolution of random noise with a kernel to make morphology.
Parameters: |
|
---|