Giter Site home page Giter Site logo

geo_frac_analysis's Introduction

Geological Fracture Analysis

A Python module for the spatial analysis of geological fractures from shapefile data. Includes plotting functions.

This module takes shapefiles containing either polylines or points and spatially analyses them by user defined inputs (cell size in km and angle bins).

Analysis outputs include:

  1. Number density.

  2. Length density.

  3. Number anisotropy.

  4. Group Dominance Frequency (GDF).

Single or multiple analysed shapefiles can then be put into a fancy plot with rose diagrams like so: First

Quick Code Example

Import the module:

>>> import geo_frac_analysis as GFA

Set address for shapefile which contains polyline fractures.

>>> address1 = "/Data/wexfaults.dbf"

Set the cell size to be 10km, and angle bins per 180 degrees to be 3 (i.e., 30 degree bins):

>>> cell_size, angle_bins = 10, 3

Create the FracAnalysisPoly object:

>>> a = GFA.FracAnalysisPoly(address1, cell_size, angle_bins)

Plot the analysed data with number density patches:

>>> GFA.FancyPlot(a, patches = "Number")

Installation

To install using pip:

pip install geo_frac_analysis

Dependencies

pyshp

matplotlib

numpy

Author

Written by Sean Blake in Trinity College Dublin, 2014-2016

Email: blakese__at__tcd.ie

GITHUB: https://github.com/TerminusEst

Uses the MIT license.

Detailed Use

Using a as our analysed polyline object (see quick example above), the basic plot

>>> GFA.FancyPlot(a) gives the following plot: 2nd To include squares (size = cell_size) showing number density, we can call:

>>> GFA.FancyPlot(a, Patches = "Number") Patches can also equal "Length" or "NumberAnisotropy" 3rd

An example of the plot working with all of the bells and whistles:

>>> GFA.FancyPlot(a, Rose = True, Fractures = True, Patches = "NumberAnisotropy", Circles = True, SquareNumbers = True, FigureNumber = 1) 4th

Suppose we had another shapefile of a different region, and we wanted to plot them together. We can simply do the following:

>>> address2 = "/dungarv.dbf`
>>> b = GFA.FracAnalysisPoly(address2, cell_size, angle_bins)
>>> analysed_list = [a, b]
>>> GFA.FancyPlot(analysed_list, Rose = True, Fractures = True, Patches = "NumberAnisotropy", Circles = True, SquareNumbers = True, FigureNumber = 1)

5th

Shapefiles which contain points can also be added:

>>> address3 = "/mypointdata.dbf"
>>> p = GFA.FracAnalysisPoint(address3, cell_size ,angle_bins)
>>> analysed_list.append(p)
>>> GFA.FancyPlot(analysed_list, Rose = True, Fractures = True, Patches = "Number", Circles = False, SquareNumbers = False, FigureNumber = 1)

6th NOTE No length analysis can be undertaken on a group of analysed shapefiles if one or more of them contain points.

If you want to plot one rose diagram per region, we use the second plotting function:

GFA.FancyPlotTotals(analysed_list, Fractures = True, Circles = True, FigureNumber = 1) 7th

Now that you are happy with the analysis, you can save the analysed data from a into a shapefile. This can be done as follows:

>>> output_address = "/my_output"
>>> a.save_output(output_address)

Once this is done, you will have a shapefile with fields:

[('DeletionFlag', 'C', 1, 0),
 ['X', 'F', 10, 8],
 ['Y', 'F', 10, 8],
 ['N0', 'F', 10, 8],    
 ['N1', 'F', 10, 8],
 ['N2', 'F', 10, 8],
 ['L0', 'F', 10, 8],
 ['L1', 'F', 10, 8],
 ['L2', 'F', 10, 8],
 ['N_tot', 'F', 10, 8],
 ['N_Anisotro', 'F', 10, 8]]

where:

X, Y = X and Y coordinates of squares

N0-Nn = number density per bin (bins 0-n)

L0-Ln = length density per bin (bins 0-n)

N_tot = true number density per square (so as to avoid double counting fractures which are in >1 angle bins)

N_Anisotro = number anisotropy per square

geo_frac_analysis's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.