Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Development' into Development
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Jun 20, 2017
2 parents 7d116d6 + bc7356f commit fd62c89
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .idea/GeMpy.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions Prototype Notebook/Example_1_Sandstone.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,25 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"outputs": [
{
"ename": "AttributeError",
"evalue": "module 'gempy' has no attribute 'import_data'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-58c72887b39d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# Importing the data from csv files and settign extent and resolution\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m geo_data = GeMpy.import_data([696000,747000,6863000,6950000,-20000, 200],[ 50, 50, 50],\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mpath_f\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpardir\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;34m\"/input_data/a_Foliations.csv\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m path_i = os.pardir+\"/input_data/a_Points.csv\")\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: module 'gempy' has no attribute 'import_data'"
]
}
],
"source": [
"# Importing the data from csv files and settign extent and resolution\n",
"geo_data = GeMpy.import_data([696000,747000,6863000,6950000,-20000, 200],[ 50, 50, 50],\n",
Expand Down
143 changes: 112 additions & 31 deletions Tutorial/ch1.ipynb

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions gempy/DataManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ def __init__(self,

# if we dont read a csv we create an empty dataframe with the columns that have to be filled
self.foliations = pn.DataFrame(columns=['X', 'Y', 'Z', 'dip', 'azimuth', 'polarity',
'formation', 'series'])
'formation', 'series', 'X_std', 'Y_std', 'Z_std',
'dip_std', 'azimuth_std'])

self.interfaces = pn.DataFrame(columns=['X', 'Y', 'Z', 'formation', 'series'])
self.interfaces = pn.DataFrame(columns=['X', 'Y', 'Z', 'formation', 'series',
'X_std', 'Y_std', 'Z_std'])

if path_f or path_i:
self.import_data(path_i=path_i, path_f=path_f)
Expand Down Expand Up @@ -972,7 +974,7 @@ def compile_th_fn(self, compute_all=True, dtype=None, u_grade=None, **kwargs):
th_fn = theano.function(input_data_T, self.interpolator.tg.whole_block_model(self.data.n_faults,
compute_all=compute_all),
on_unused_input='ignore',
allow_input_downcast=True,
allow_input_downcast=False,
profile=False)
return th_fn

Expand Down Expand Up @@ -1002,6 +1004,13 @@ def rescale_data(self, geo_data, rescaling_factor=None):

new_coord_foliations = (geo_data.foliations[['X', 'Y', 'Z']] -
centers) / rescaling_factor + 0.5001
try:
geo_data.interfaces[['X_std', 'Y_std', 'Z_std']] = (geo_data.interfaces[
['X_std', 'Y_std', 'Z_std']]) / rescaling_factor
geo_data.foliations[['X_std', 'Y_std', 'Z_std']] = (geo_data.foliations[
['X_std', 'Y_std', 'Z_std']]) / rescaling_factor
except KeyError:
pass

new_coord_extent = (geo_data.extent - np.repeat(centers, 2)) / rescaling_factor + 0.5001

Expand Down Expand Up @@ -1334,7 +1343,7 @@ def data_prep(self, **kwargs):
ref_layer_points = np.vstack((ref_layer_points, np.tile(aux_1[e], (i - 1, 1))))

# -DEP- was just a check point
#self.ref_layer_points = ref_layer_points
self.ref_layer_points = ref_layer_points

# Check no reference points in rest points (at least in coor x)
assert not any(aux_1[:, 0]) in rest_layer_points[:, 0], \
Expand Down
17 changes: 17 additions & 0 deletions gempy/UncertaintyAnalysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import theano


def create_model_op(interp_data):
input_data_T = interp_data.interpolator.tg.input_parameters_list()
input_data_P = interp_data.get_input_data()
return theano.OpFromGraph(input_data_T, [interp_data.interpolator.tg.whole_block_model(interp_data.n_faults)],
on_unused_input='ignore')


# Code to select only some of the raws or a column stochastic:
# ref = pm.Deterministic('reference', T.set_subtensor(
# ref[T.nonzero(T.cast(select.as_matrix(), "int8"))[0], 2],
# ref[T.nonzero(T.cast(select.as_matrix(), "int8"))[0], 2] + reservoir))
# rest = pm.Deterministic('rest', T.set_subtensor(
# rest[T.nonzero(T.cast(select.as_matrix(), "int8"))[0], 2],
# rest[T.nonzero(T.cast(select.as_matrix(), "int8"))[0], 2] + reservoir)) #

0 comments on commit fd62c89

Please sign in to comment.