Commit 1d715dc6 authored by Lena noack's avatar Lena noack
Browse files

Update plot routines

parent ab5be417
......@@ -160,9 +160,9 @@ end
%end
% if (i>i_max)
% %fprintf('Warning, iteration stopped after %d iterations at p=%f bar!\n',i,p_lid)
% end
if (i>i_max)
fprintf('Warning, iteration stopped after %d iterations at p=%f bar!\n',i,p_lid)
end
deg_CO2 = dX_CO2; % wt-ppm
deg_H2O = dX_H2O*10^4; % wt-% -> wt-ppm
......
%function make_movie(start=0,fpath=' ',vals=' ') for normal plots
function make_movie(start=0,fpath=' ',vals='TWHDvVRMt')
function make_movie(start=0,fpath='D:\Curta_PhaseTrans_Proxima\V5_Case3\',vals='TWHDvVRMt')
if fpath==' '
[fname, fpath, fltidx] = uigetfile("data_char_val_ts.res");
......
%
% Main function to produce field plots and profiles for one time step
%
function plot_snap(max_depl=30,max_T=0,fullV=-1,part=0,reduc=1,fin=' ',print_plot=' ')
function plot_snap(max_depl=30,max_T=0,fullV=-1,part=0,reduc=1,fin=' ',print_plot='TWHDvVRMtOo')%' ')
% if reduc=1, then plot only T2D, V2D, Vi2D, D2D, Mradp2D
%addpath("/home/noacklen/Arbeit/SOURCE/CHIC/Octave")
......@@ -67,6 +67,8 @@ if print_plot~=' '
t_profile = plot_x_profile(data.T,data,input,"PrT","Temperature","southwest"," [K]");
T_var = data.T - reshape(kron(ones(size(data.T,1),1,1),t_profile(:,2)'),size(data.T));
field(:,:)=T_var(:,1,:); ,fprintf(fid,'\n%d %d\n',size(field)),fprintf(fid,'%3.8f ',field),endif
if (strfind(name, "O")==i), fprintf('O'), field(:,:)=log10(data.output_tracer(:,1,:)*1e12); ,fprintf(fid,'\n%d %d\n',size(field)),fprintf(fid,'%3.8f ',field),endif
if (strfind(name, "o")==i), fprintf('o'), field(:,:)=data.output_tracer(:,1,:)*1e12; ,fprintf(fid,'\n%d %d\n',size(field)),fprintf(fid,'%3.8f ',field),endif
endfor
fprintf(' finished\n')
......
......@@ -7,7 +7,11 @@ import matplotlib.colors as colors
import os, sys
#path = 'C:/Arbeit/Video_Venus_MOprofs_PhaseTrans_1000K/'
path = 'C:/Arbeit/Video_Venus_MOprofs_PhaseTrans_NoChemBuoy/'
#path = 'C:/Arbeit/Video_Venus_MOprofs_PhaseTrans_NoChemBuoy/'
#path = 'C:/Arbeit/NextCloud_FUB/Literature_Projects/Eigene_Projekte/Project_Kristina_Kislyakova_ProximaCenB/New3_April2020/New_HighRes_Incl45_FeM10_Fe20_V5_dQ_Case4_LowRes/'
#path = 'C:/Arbeit/NextCloud_FUB/Literature_Projects/Eigene_Projekte/Project_Kristina_Kislyakova_ProximaCenB/New3_April2020/New_HighRes_Incl45_FeM10_Fe20_V5_dQ_Case4/'
#path2 = 'C:/Arbeit/NextCloud_FUB/Literature_Projects/Eigene_Projekte/Project_Kristina_Kislyakova_ProximaCenB/New3_April2020/New_HighRes_Incl45_FeM10_Fe20_V0_Case3/'
path = 'D:/Curta_PhaseTrans_Proxima/V5_Case3/'
plot_path = path+'plot/'
file = None # 'PlotData_TWHDvRMt0011564.txt'
start = 0 # use higher number to exclude first time steps
......@@ -32,12 +36,13 @@ def plot2D(xx,yy,data,title,time,colmap,vmin=None,vmax=None,nr_cont=10,name=None
ax.set_title(title+' at '+time_str+' Myr', fontsize=20)
# plt.show()
if name!=None:
plt.savefig(name, format='png', bbox_inches='tight',dpi=100)
plt.savefig(name, format='png', bbox_inches='tight',dpi=200)
plt.close(fig)
#######################################################################
def make_plot_snap(filename):
def make_plot_snap(path,filename):
plot_path = path+'plot/'
letters_number = filename[9:-4]
#print(letters_number)
letters = letters_number[:-7]
......@@ -54,6 +59,7 @@ def make_plot_snap(filename):
xx_dim = xx_dim.split() # get two strings with integers each
xd = int(xx_dim[0])
yd = int(xx_dim[1])
# print(xd,yd) 675-197
xx_val = np.reshape(np.array(xx_val.split()).astype(float),(yd,xd))
yy_val = np.reshape(np.array(yy_val.split()).astype(float),(yd,xd))
......@@ -63,10 +69,11 @@ def make_plot_snap(filename):
f_val = file1.readline() # values as list
f_val = np.reshape(np.array(f_val.split()).astype(float),(yd,xd))
plot2D(xx_val,yy_val,f_val,title,time,cm,vmin=vmin,vmax=vmax,nr_cont=nr_cont,name=plot_path+nameF+number+'.png')
return f_val
for letter in letters:
if letter == 'T':
set_plot_values('Temperature in K','magma',vmin=0,vmax=3500,nr_cont=20,nameF='T2D')
store_T_val = set_plot_values('Temperature in K','magma',vmin=0,vmax=3500,nr_cont=20,nameF='T2D')
elif letter == 'D':
set_plot_values('Depletion','inferno',vmin=0,vmax=30,nr_cont=50,nameF='D2D')
elif letter == 'H':
......@@ -74,7 +81,8 @@ def make_plot_snap(filename):
elif letter == 'W':
set_plot_values('Water fraction in ppm','RdBu',vmin=0,vmax=140,nr_cont=100,nameF='W2D')
elif letter == 'v':
set_plot_values('Velocity in cm/yr','rainbow',vmin=0,vmax=25,nr_cont=100,nameF='v2D')
set_plot_values('Velocity in cm/yr','rainbow',nr_cont=100,nameF='v2D')
# set_plot_values('Velocity in cm/yr','rainbow',vmin=0,vmax=25,nr_cont=100,nameF='v2D')
elif letter == 'V':
set_plot_values('Viscosity in log10 Pa s','rainbow',vmin=18,vmax=25,nr_cont=100,nameF='Vi2D')
elif letter == 'R':
......@@ -84,11 +92,18 @@ def make_plot_snap(filename):
elif letter == 'M':
set_plot_values(r'Radial material exchange in $kg/(m^2 yr)$','inferno',nr_cont=50,nameF='M2D')
elif letter == 't':
set_plot_values('Temperature variations in K','RdBu',vmin=-100,vmax=100,nr_cont=20,nameF='dT2D')
set_plot_values('Temperature variations in K','RdBu',vmin=-150,vmax=150,nr_cont=20,nameF='dT2D')
elif letter == 'O':
dummy = set_plot_values('Induction heating in $log_{10}$ pW/kg','inferno',vmin=-4,vmax=2,nr_cont=500,nameF='Olog2D')
# print(dummy[:,338])
elif letter == 'o':
set_plot_values('Induction heating in pW/kg','inferno',vmin=0,vmax=50,nr_cont=500,nameF='O2D')
# set_plot_values('Output field','inferno',nr_cont=50,nameF='O2D')
else:
print('Unused letter found (',letter,')')
file1.close()
return xx_val,yy_val,store_T_val,time
#######################################################################
......@@ -106,10 +121,22 @@ def create_plots(path,file=None,start=0,end=10000000000):
number = int(letters_number[-7:])
if (number>=start and number<=end):
print(filename)
make_plot_snap(filename)
xx_val,yy_val,store_T_val,time=make_plot_snap(path,filename)
else:
make_plot_snap(file)
xx_val,yy_val,store_T_val,time=make_plot_snap(path,file)
return xx_val,yy_val,store_T_val,time
#######################################################################
create_plots(path,file,start=start,end=end)
\ No newline at end of file
create_plots(path,file,start=start,end=end)
#nr=4472
#nr=869
#xx_val1,yy_val1,store_T_val1,time = create_plots(path,file,start=nr,end=nr)
#nr2=4193
#nr2=744
#xx_val2,yy_val2,store_T_val2,time = create_plots(path2,file,start=nr2,end=nr2)
#nr=str(nr)
#plot2D(xx_val1,yy_val1,store_T_val1-store_T_val2,'Temperature variations in K',
# time,'coolwarm',vmin=-400,vmax=400,nr_cont=100,name=plot_path+'Tind'+nr+'.png')
......@@ -206,6 +206,6 @@ for X_H2O_i=0:0.001:0.066 % water mass fraction
end
%figure
figure
plot(H2O,CO2,'k-')
hold on
\ No newline at end of file
......@@ -39,6 +39,7 @@ To commit all changes:
make server=planeto compiler=gnu
find MKL: find -name libmkl_sequential.a 2> /dev/null
screen -L -> create new screen
......
Supports Markdown
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