Commit 1e3bcfab authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

worked on python stuff

parent ad1e7375
This diff is collapsed.
This diff is collapsed.
......@@ -6,7 +6,6 @@ import pandas as pd
import sys
import os
sys.path.append('..')
from mpp.python.mppy import Mpp
......@@ -246,31 +245,34 @@ class MLMCMpp(Mpp):
if not save_only:
plt.show()
def perm_potential_plot_1d(self, sample_id, perm="kappa.vtk", u="u.vtk",
dpi=200.0, save_only=False): # Todo Parameter für hold on ja oder nein
if isinstance(sample_id, str):
sample_id = [sample_id]
def perm_potential_plot_1d(self, sample_ids, perm="kappa.vtk", u="u.vtk",
dpi=200.0, save_only=False, same_plot=True):
if isinstance(sample_ids, str):
sample_ids = [sample_ids]
p = VtkPlot(figsize=(12, 4), dpi=dpi)
plt.axis('off')
gs = gridspec.GridSpec(1, 2)
for s_id in sample_id:
path = os.path.abspath(os.path.join(self.PROJECT_VTK_DATA_DIR, s_id))
p.ax1 = p.fig.add_subplot(gs[0])
p.ax2 = p.fig.add_subplot(gs[1])
for sample_id in sample_ids:
path = os.path.abspath(os.path.join(self.PROJECT_VTK_DATA_DIR, sample_id))
if not os.path.exists(path):
raise FileNotFoundError('Sample folder {} not found'.format(path))
p.set_wd(path)
p.ax1 = p.fig.add_subplot(gs[0])
p.add_1D_vtk(perm, ax=p.ax1)
p.add_1d_vtk(perm, ax=p.ax1)
p.ax1.set_title('Permeability')
p.ax2 = p.fig.add_subplot(gs[1])
p.add_1D_vtk(u, ax=p.ax2)
p.add_1d_vtk(u, ax=p.ax2)
p.ax2.set_title('Potential')
# png_file = os.path.abspath(os.path.join(path, 'perm_potential.png'))
# plt.savefig(png_file)
png_file = os.path.abspath(os.path.join(mpp.PROJECT_PY_DATA_DIR,
'perm_potential.png'))
plt.savefig(png_file)
if not save_only:
plt.show()
def perm_potential_plot(self):
pass
# def summarize_plot(perm="kappa.vtk", load="load.vtk", flux="flux.vtk", u="u.vtk", quiver_filter=1,
# quiver_scale=0.25, no_mesh=False,
# dpi=400.0):
......@@ -306,8 +308,4 @@ class MLMCMpp(Mpp):
plt.rcParams.update({'font.size': 14})
mpp = MLMCMpp()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment