from Dat import * from general.numerical import * from numpy.core.numeric import NaN import general.simpplot as sp sp.setSubPlotParameters(left=0.12, bottom=0.12, right=0.96, top=0.9, wspace=0.2, hspace=0.2) sp.setImgSize(8,4) #Ns = [9,17,33,65] lastPole = None def getValue(d, kmax, Nrange): global lastPole ys_real = [] ys_imag = [] for N in range(Nrange[0],Nrange[1]+1): printed = False if len((d[kmax][N][INDEX_POLE])) > 0: c = Compare(0.001) for pole in d[kmax][N][INDEX_POLE]: if lastPole is None or c.complexCompare(lastPole.E, pole.E): lastPole = pole val = pole.E ys_real.append(val.real) ys_imag.append(val.imag) printed = True break if not printed: print N return ys_real, ys_imag
import sys import os base = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0,base+'/..') sys.path.insert(0,base+'/../../../Utilities') import sys import csv import cmath import numpy as np import math import general.simpplot as sp sp.setImgSize(15,6) from PyrazineDataVals import * debugFile1 = open('debug1.txt','w') debugFile2 = open('debug2.txt','w') class Calculator: def _Xsec(self, k, smat): bohrSq = cmath.pi / (pow(k,2)) * pow(abs(1-smat),2.0) SI = bohrSq * pow(5.292E-11,2) barns = SI / 1E-28 return bohrSq def _phase(self, smat): return (cmath.log(smat) / 2.0j).real class KCalculator(Calculator): def __init__(self, fileName):
from Dat import * from general.numerical import * from numpy.core.numeric import NaN import general.simpplot as sp sp.setSubPlotParameters(left=0.12, bottom=0.12, right=0.96, top=0.9, wspace=0.2, hspace=0.2) sp.setImgSize(8, 4) #Ns = [9,17,33,65] lastPole = None def getValue(d, kmax, Nrange): global lastPole ys_real = [] ys_imag = [] for N in range(Nrange[0], Nrange[1] + 1): printed = False if len((d[kmax][N][INDEX_POLE])) > 0: c = Compare(0.001) for pole in d[kmax][N][INDEX_POLE]: if lastPole is None or c.complexCompare(lastPole.E, pole.E): lastPole = pole val = pole.E ys_real.append(val.real)
type=bool, default=False) args = parentArgs.parse_args() base_kvar = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, base_kvar + './../..') from Base import * import general.simpplot as sp sp.setSubPlotParameters(left=0.12, bottom=0.12, right=0.96, top=0.9, wspace=0.2, hspace=0.2) sp.setImgSize(5, 4) l = 0 kmin = args.kmin_ df = 0.001 p = Printer(True, False) f = Filter() astr = "%.1f" % args.a_ resultsPath = base_kvar + "/a=" + astr + "/Results/" def _uniformVals(xs_s, ys_s): minx = 999 maxx = 0
from Dat import * from general.numerical import * from numpy.core.numeric import NaN import general.simpplot as sp sp.setSubPlotParameters(left=0.12, bottom=0.12, right=0.96, top=0.9, wspace=0.2, hspace=0.2) sp.setImgSize(5,4) def getFirstN(d, iVal): for N in sorted(d[iVal]): if len((d[iVal][N][INDEX_POLE])) > 0: return [float(N)] return [0.0] def plotFirstN(df, index, desc, showMarkers=True): ret = plotData("./Data_"+str(df)+"/", index, getFirstN) sp.plotSingle("First N with Pole with comparison Threshold df="+str(df*100)+"%", ret[0], ret[1], desc+" Energy Range (Rydbergs)", "N", path="Results/FirstNPole_"+str(df)+".png",markerSz=8 if showMarkers else None,markWithLine=True) def getNumPoles(d, iVal): return [float(len(d[iVal][65][INDEX_POLE]))] def plotNumPoles(df, index, desc, showMarkers=True): ret = plotData("./Data_"+str(df)+"/", index, getNumPoles) sp.plotSingle("Num of Poles found with comparison Threshold df="+str(df*100)+"%", ret[0], ret[1], desc+" Energy Range (Rydbergs)", "Num Poles Found", path="Results/Num_"+str(df)+".png",markerSz=8 if showMarkers else None, markWithLine=True) def getNumPolesNotLost(d, iVal): num = 0.0 for pole in d[iVal][65][INDEX_POLE]:
import sys import os base = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, base + '/..') sys.path.insert(0, base + '/../../../Utilities') import sys import csv import cmath import numpy as np import math import general.simpplot as sp sp.setImgSize(15, 6) from PyrazineDataVals import * debugFile1 = open('debug1.txt', 'w') debugFile2 = open('debug2.txt', 'w') class Calculator: def _Xsec(self, k, smat): bohrSq = cmath.pi / (pow(k, 2)) * pow(abs(1 - smat), 2.0) SI = bohrSq * pow(5.292E-11, 2) barns = SI / 1E-28 return bohrSq def _phase(self, smat): return (cmath.log(smat) / 2.0j).real