Example #1
0
vals = [0,60,250,330,600]
strat_column = {'strati':{}}
for i in range(len(vals)-1):
    strat_column['strati']['unit_{}'.format(i)] = {'min':vals[i],'max':vals[i+1],'id':i}
model.set_stratigraphic_column(strat_column)
strati = model.create_and_add_foliation("strati",
                                           interpolatortype="FDI", # try changing this to 'PLI'
                                           nelements=1e4, # try changing between 1e3 and 5e4
                                           buffer=0.3,
                                           solver='pyamg',
                                           damp=True
                                          )
viewer = LavaVuModelViewer(model,background="white")
viewer.add_model_surfaces()
viewer.rotate([-85.18760681152344, 42.93233871459961, 0.8641873002052307])
viewer.display()
#################################################################################################
# Looking at the log file
# ~~~~~~~~~~~~~~~~~~~~~~~
# Here are the first 10 lines of the log file. 
# Most operations in loopstructural are recorded and this will allow you to identify whether 
# an operation is not occuring as you would expect.

from itertools import islice
# with open('logging_demo_log.log') as inf:
#     for line in islice(inf, 0, 11):
#         print(line)


#################################################################################################
Example #2
0
    data["feature_name"] = "test"
    data["nx"] = np.nan
    data["ny"] = np.nan
    data["nz"] = np.nan
    data.loc[3, :] = [0, 0, 0, np.nan, "test", v, 0, 0]
    # data.loc[3,['nx','ny','nz']]/=np.linalg.norm(data.loc[3,['nx','ny','nz']])
    # data.loc[4,:] = [0,0,1,np.nan,'test',1,0,0]
    model = GeologicalModel(np.zeros(3), np.ones(3) * 10)
    model.data = data
    model.create_and_add_foliation("test",
                                   nelements=1e4,
                                   interpolatortype="FDI")
    view = LavaVuModelViewer(model)
    view.add_isosurface(model["test"], slices=[0, 1], name="test")
    view.add_data(model["test"])
    view.rotate([-92.68915557861328, 2.879497528076172, 1.5840799808502197])
    view.xmin = 0
    view.ymin = 0
    view.zmin = 0
    view.xmax = 10
    view.ymax = 10
    view.zmax = 10
    images[v] = view.image_array()
fig, ax = plt.subplots(1, 3, figsize=(30, 10))
ax[0].imshow(images[1])
ax[1].imshow(images[5])
ax[2].imshow(images[1 / 5])
ax[0].axis("off")
ax[1].axis("off")
ax[2].axis("off")
ax[0].set_title(f"A. Magnitude of gradient norm {1.0} ")
# 

model = GeologicalModel(bb[0,:],bb[1,:])
model.set_model_data(data)
s2 = model.create_and_add_fold_frame('s2',
                                     nelements=10000, 
                                     buffer=0.5,
                                    solver='lu',
                                    damp=True)
viewer = LavaVuModelViewer(model)
viewer.add_scalar_field(s2[0],
                       cmap='prism')
viewer.add_isosurface(s2[0],
                     slices=[0,1])
viewer.add_data(s2[0])
viewer.rotate(rotation)
viewer.display()



######################################################################
# Modelling S1
# ~~~~~~~~~~~~
# 

s1 = model.create_and_add_folded_fold_frame('s1',
                                            limb_wl=4, 
                                            av_fold_axis=True,
                                            nelements=50000,
                                            buffer=0.3,
                                            solver='lu'