@@ -190,6 +190,48 @@ def plot_wfc_phase(xDim, yDim, data_dir, pltval, start, end, incr):
190190 #fig = plt.figure()
191191 #fig.savefig('wfc.png')
192192
193+ # Function to plot wfc cut
194+ def plot_wfc_cut (xDim , yDim , data_dir , pltval , start , end , incr ):
195+ if data_dir [0 ] != "/" :
196+ data_dir = "../" + data_dir
197+ for i in range (start ,end ,incr ):
198+ print (i )
199+ data_real = data_dir + "/wfc_0_const_%s" % i
200+ data_im = data_dir + "/wfc_0_consti_%s" % i
201+ if pltval == "wfc_cut_ev" :
202+ data_real = data_dir + "/wfc_ev_%s" % i
203+ data_im = data_dir + "/wfc_evi_%s" % i
204+
205+ lines_real = np .loadtxt (data_real )
206+ lines_im = np .loadtxt (data_im )
207+ wfc_real = np .reshape (lines_real , (xDim ,yDim ));
208+ wfc_im = np .reshape (lines_im , (xDim ,yDim ));
209+
210+ wfc = abs (wfc_real + 1j * wfc_im )
211+ wfc = wfc * wfc
212+
213+ max = 0
214+ for j in range (xDim ):
215+ for k in range (yDim ):
216+ if (wfc [j ][k ] > max ):
217+ max = wfc [j ][k ]
218+
219+ print ("Max value is: " ,max )
220+ for j in range (xDim ):
221+ for k in range (yDim ):
222+ if (wfc [j ][k ] > max * 0.4 ):
223+ wfc [j ][k ] = 1.0
224+ else :
225+ wfc [j ][k ] = 0.0
226+
227+ plt .imshow (wfc , extent = (- 6.9804018707623236e-04 ,6.9804018707623236e-04 ,- 6.9804018707623236e-04 ,6.9804018707623236e-04 ), interpolation = 'nearest' ,
228+ cmap = cm .jet )
229+ plt .colorbar ()
230+ plt .show ()
231+ #fig = plt.figure()
232+ #fig.savefig('wfc.png')
233+
234+
193235
194236# Function to parse arguments for plotting
195237# Note: We assume that the parameters come in sets
@@ -233,6 +275,9 @@ def plot(par):
233275 elif (par .item == "GK" or par .item == "GV" ):
234276 plot_complex (par .xDim , par .yDim , par .data_dir , par .item ,
235277 par .start , par .end , par .incr )
278+ elif (par .item == "wfc_cut" or par .item == "wfc_cut_ev" ):
279+ plot_wfc_cut (par .xDim , par .yDim , par .data_dir , par .item ,
280+ par .start , par .end , par .incr )
236281 elif (par .end != 1 ):
237282 plot_var_range (par .xDim , par .yDim , par .data_dir , par .item ,
238283 par .start , par .end , par .incr )
0 commit comments