Module for creating block diagrams and other three-dimensional displays from stratigraphic models
Project description
Description
'blockdiagram' is a Python module for creating block diagrams and other three-dimensional displays from stratigraphic models. It is designed to work with meanderpy, but it should work with any model that consists of a stack of stratigraphic surfaces.
Requirements
numpy
matplotlib
mayavi
scipy
PIL
Usage
The main function in 'blockdiagram' is 'create_exploded_view'. It can either be used to generate a normal block diagram or an exploded-view block diagram, in which the model is split into several smaller blocks so that more stratigraphic detail is visible. Fence diagrams can be created as well. Here is a typical set of input parameters:
mlab.figure(bgcolor=(1,1,1))
# parameters
ve = 15.0 # vertical exaggeration
scale = 0.1 # scaling of diagram (important for 3D printing)
strat_switch = 1 # equals 1 if you want stratigraphy displayed on the sides
layers_switch = 0 # equals 1 if you want stratigraphic boundaries displayed on the sides
contour_switch = 0 # equals 1 if you want contours displayed on the top surface
dx = 10.0 # cell size for display
bottom = np.min(chb_3d.strat) - 1.5 # elevation of bottom side of diagram
color_mode = 'property' # determines how the stratigraphy will be colored; can be 'property', 'facies', or 'time'
colors = [[0.5,0.25,0],[0.9,0.9,0],[0.5,0.25,0]] # colors for 'facies' display
line_thickness = 1.0 # thickness of lines if 'layers_switch' is 1
gap = 20 # distance between exploded blocks (if any; in number of gridcells)
h = 5.0 # channel depth (m)
nx = 1 # number of blocks in x direction
ny = 1 # number of blocks in y direction
bd.create_exploded_view(chb_3d.strat,chb_3d.facies,chb_3d.topo,h,nx,ny,gap,dx,ve,scale,strat_switch,
layers_switch,contour_switch,color_mode,colors,line_thickness,bottom)
If the command above is run with nx=1 and ny=1 (the number of blocks in the x and y directions), a simple block diagram is displayed:
Changing nx and ny to 3 results in something like this:
Both of the models above have been colored using the 'property' setting for the 'color_mode' parameter, so that the change from yellow to brown in the point bars reflects the change in grain size (and porosity/permeability). This setting can also be set to 'facies' (when each facies, e.g., point bar vs. overbank, gets its own color) or to 'time', when layers are colored according to their relative age - see example below.
Another functionality is to create a 'random' section from the model. In order to do that, the location of the section has to be selected on a map of the top surface, using the 'select_random_section' function:
xcoords, ycoords = bd.select_random_section(chb_3d.strat) # define x and y coordinates for random section
mlab.figure(bgcolor=(1,1,1))
color_mode = 'property'
bd.create_random_section_n_points(chb_3d.strat,chb_3d.facies,chb_3d.topo,h,scale,ve,color_mode,colors,
xcoords[:-1],xcoords[1:],ycoords[:-1],ycoords[1:],dx,bottom)
You can also cut a "cookie" from the model, using the 'create_random_cookie' option:
xcoords, ycoords = bd.select_random_section(chb_3d.strat) # define x and y coordinates for random section
mlab.figure(bgcolor=(1,1,1))
bd.create_random_cookie(chb_3d.strat,chb_3d.facies,chb_3d.topo,h,scale,ve,color_mode,colors,xcoords[:-1],xcoords[1:],
ycoords[:-1],ycoords[1:],dx,bottom)
A more traditional way to look at 3D data or models is a fence diagram:
mlab.figure(bgcolor=(1,1,1))
bd.create_fence_diagram(chb_3d.strat,chb_3d.facies,chb_3d.topo,h,6,2,gap,dx,ve,scale,layers_switch,color_mode,colors,line_thickness,bottom,export)
License
'blockdiagram' is licensed under the Apache License 2.0
Copyright 2019 Zoltan Sylvester
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file blockdiagram-0.1.0.tar.gz
.
File metadata
- Download URL: blockdiagram-0.1.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f15f9e48753393a84c83eff47d0bd374d70e048d4c5db7fcfcd232a505892033 |
|
MD5 | 399ff1c89c39736a579fd98d965eec4e |
|
BLAKE2b-256 | 7049093e97eafad41d62694cf89e62b45ab350c342498ecb086089b4d6acfcc9 |
File details
Details for the file blockdiagram-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: blockdiagram-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709417201d6ac8ee083e31ab495fa54b4ca8df12ca109a95209b9d7b893f891b |
|
MD5 | 8ee7a43230d664a29f85fa1e8e96d119 |
|
BLAKE2b-256 | 08689b063fc5a550f0e4b29c40cea9a5e7a8180ab62837e3b3aa2e15c0e298ff |