-
Notifications
You must be signed in to change notification settings - Fork 32
/
CSV2PyNoddyHistoryExample.py
42 lines (34 loc) · 1.59 KB
/
CSV2PyNoddyHistoryExample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 16:59:04 2020
@author: Ahinoam Pollack, email me with questions: ahinoamp@gmail.com
"""
import pynoddy
import pynoddy.output
import pynoddy.history
import pandas as pd
#Read a csv file with the vertices of the faults
#The file is created by creating fault lines in QGIS with a dipdirection and id
#Using "Extract Vertices" tool to extract the vertices,
#and then adding the x and y information using the attribute calculator in the table,
#and then exporting to csv.
csvfile = 'examples/FautDataCSV/Scenario1_Vertices.csv'
CsvFaultData = pd.read_csv(csvfile).sort_values(['id'])
#how much does the fault slip relative to the fault length
SlipParam = 0.04
#the xyz origin of the model you will be generating
xy_origin=[317883,4379646, 1200-4000]
#Get information about each parameter in Noddy format
#The output from the function is a dictionary with lists of the fault parameters
noddyFormattedFaultData = pynoddy.history.setUpFaultRepresentation(CsvFaultData,
xy_origin=xy_origin,
SlipParam=SlipParam)
#Create a dictionary with the stratigraphy information
StratDict = {}
StratDict['Heights'] = [2000, 2500, 3000, 3700]
StratDict['Names'] = ['Intrusive', 'Felsic', 'Mafic','Sed']
StratDict['Density'] = [2.65, 2.5, 2.4, 2.3]
StratDict['MagSus'] = [0.0015, 0.0012, 0.0018, 0.001]
#Now make the history file
filename = 'faultmodel.his'
noddyFormattedFaultData = pynoddy.history.createPyNoddyHistoryFile(noddyFormattedFaultData, StratDict, filename=filename)