Test combination/ extension of existing history files with new events


In [1]:
import sys, os
import matplotlib.pyplot as plt
# adjust some settings for matplotlib
from matplotlib import rcParams
# print rcParams
rcParams['font.size'] = 15
# determine path of repository to set paths corretly below
os.chdir(r'/Users/flow/git/pynoddy/docs/notebooks/')
repo_path = os.path.realpath('../..')
import pynoddy

In [2]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [ ]:
# Change to sandbox directory to store results
os.chdir(os.path.join(repo_path, 'sandbox'))
# Path to exmaple directory in this repository
example_directory = os.path.join(repo_path,'examples')

In [8]:
# Compute noddy model for history file
reload(pynoddy.history)
history_file = 'simple_two_faults.his'
history = os.path.join(example_directory, history_file)
output_name = 'noddy_out'
H1 = pynoddy.history.NoddyHistory(history)


 STRATIGRAPHY
 FAULT
 FAULT

In [9]:
pynoddy.compute_model(history, output_name) 
NO1 = pynoddy.output.NoddyOutput(output_name)

In [10]:
NO1.plot_section('y')



In [6]:
H1.all_events_begin


Out[6]:
7

In [7]:
H1.all_events_end


Out[7]:
761

In [11]:
H1.n_events


Out[11]:
3

In [12]:
H1.history_lines[:2]


Out[12]:
['#Filename = simple_two_faults.his\n', '#Date Saved = 24/3/2014 14:21:0\n']

In [57]:
# Compute noddy model for history file
reload(pynoddy.history)
history_file = 'simple_two_faults.his'
history = os.path.join(example_directory, history_file)
output_name = 'noddy_out'
H1 = pynoddy.history.NoddyHistory(history)


 STRATIGRAPHY
 FAULT
 FAULT

In [58]:
H1.info()


************************************************************
			Model Information
************************************************************


This model consists of 3 events:
	(1) - STRATIGRAPHY
	(2) - FAULT
	(3) - FAULT
The model extent is:
	x - 10000.0 m
	y - 7000.0 m
	z - 5000.0 m
The model origin is located at: 
	(0.0, 0.0, 5000.0)
The cubesize for model export is: 
	100 m


************************************************************
			Meta Data
************************************************************


The filename of the model is:
	 simple_two_faults.his
It was last saved (if origin was a history file!) at:
	 24/3/2014 14:21:0


In [40]:
H1.get_cube_size()

In [59]:
reload(pynoddy.history)
new_his = pynoddy.history.NoddyHistory()

In [60]:
new_his.info()


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-60-4b07ce9fc388> in <module>()
----> 1 new_his.info()

/Users/flow/git/pynoddy/pynoddy/history.py in info(self)
     35         """Print out model information"""
     36         # First: check if all information available
---> 37         if not hasattr(self, 'extent_x'): self.get_extent()
     38         if not hasattr(self, 'origin_x'): self.get_origin()
     39         if not hasattr(self, 'cube_size'): self.get_cube_size()

/Users/flow/git/pynoddy/pynoddy/history.py in get_extent(self)
     92                 break
     93 
---> 94         return(self.extent_x, self.extent_y, self.extent_z)
     95 
     96 

AttributeError: NoddyHistory instance has no attribute 'extent_x'

In [61]:
new_his.history_lines


Out[61]:
[]

In [64]:
a = [1,2,3]

In [65]:
a + a


Out[65]:
[1, 2, 3, 1, 2, 3]

In [ ]: