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
Metadata
Release files for blockdiagram 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| blockdiagram-0.1.0.tar.gz | 9.9 kB | Without provenance | Details for blockdiagram-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| blockdiagram-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for blockdiagram-0.1.0-py3-none-any.whl |
Total release size: 28.2 kB
Release files / blockdiagram-0.1.0.tar.gz
| Download URL | blockdiagram-0.1.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f15f9e48753393a84c83eff47d0bd374d70e048d4c5db7fcfcd232a505892033
|
|
BLAKE2b-256 checksum How to use checksums |
7049093e97eafad41d62694cf89e62b45ab350c342498ecb086089b4d6acfcc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / blockdiagram-0.1.0-py3-none-any.whl
| Download URL | blockdiagram-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
709417201d6ac8ee083e31ab495fa54b4ca8df12ca109a95209b9d7b893f891b
|
|
BLAKE2b-256 checksum How to use checksums |
08689b063fc5a550f0e4b29c40cea9a5e7a8180ab62837e3b3aa2e15c0e298ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for blockdiagram 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.