Ejemplo n.º 1
0
def plotDiffs(df, index, kmax, Nrange, real):
    showMarkers = True
    ret = plotData("./Data_suc_"+str(df)+"/", index, getDiff, kmax, Nrange)
    if real:
        desStr = "Real"
    else:
        desStr = "Imag"
    sp.plotSingle(desStr + " root differences for Poles found with comparison threshold df="+str(df*100)+"%, Emax="+stepToRydStr(kmax)+"Ryds", ret[0], ret[1] if real else ret[2], "N", desStr+" Energy Diff (Rydbergs)", path="Results/DiffValues_"+desStr+"_"+str(df)+".png",markerSz=8 if showMarkers else None,markWithLine=True,logy=True) 
Ejemplo n.º 2
0
def plotNumPolesNotLost(df, index, desc, showMarkers=True):
    ret = plotData("./Data_" + str(df) + "/", index, getNumPolesNotLost)
    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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
def plotValues(df, index, desc, imag, showMarkers=True):
    ret = plotData("./Data_" + str(df) + "/", index, getValue)
    sp.plotSingle(
        str("Imag" if imag else "Real") +
        " values of Poles found with comp thres df=" + str(df * 100) + "%",
        ret[0], [ret[1][1]] if imag else [ret[1][0]],
        desc + " Energy Range (Rydbergs)",
        "Energy (Rydbergs)",
        path="Results/Values_" + str("Imag_" if imag else "Real_") + str(df) +
        ".png",
        markerSz=8 if showMarkers else None,
        markWithLine=True)
Ejemplo n.º 5
0
def plotDiffs(df, index, kmax, Nrange, real):
    showMarkers = True
    ret = plotData("./Data_suc_" + str(df) + "/", index, getDiff, kmax, Nrange)
    if real:
        desStr = "Real"
    else:
        desStr = "Imag"
    sp.plotSingle(
        desStr +
        " root differences for Poles found with comparison threshold df=" +
        str(df * 100) + "%, Emax=" + stepToRydStr(kmax) + "Ryds",
        ret[0],
        ret[1] if real else ret[2],
        "N",
        desStr + " Energy Diff (Rydbergs)",
        path="Results/DiffValues_" + desStr + "_" + str(df) + ".png",
        markerSz=8 if showMarkers else None,
        markWithLine=True,
        logy=True)
Ejemplo n.º 6
0
i = 4
while True:
    if i < len(sys.argv)-1:
        res = (float(sys.argv[i]),-2.0*float(sys.argv[i+1]))
        print str(res)
        resonances.append(res)
        i += 2
    else:
        break

def phaseFun(pos, width, ene):
    x = (width/2.0) / (pos-ene)
    return atan(x)

de = (emax-emin) / steps

enes = []
phases = []

ene = emin
for  i in range(steps):
    phase = 0.0
    for res in resonances:
        phase += phaseFun(res[0],res[1],ene)
    enes.append(ene)
    phases.append(phase)
    ene += de

sp.setExtents((0.0,1.6), (-3.5,3.5))
sp.plotSingle("Resonant Phase Shift Plot - " + str(len(resonances))  + " poles",enes,[phases],"Energy (ryds)", "Phase Shift")
import sys
import os
base = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0,base+'/../../../../Utilities')
import general.simpplot as sp

xs = [3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0]
ys = [0.00100916651423,0.00033452148126,0.00064784098685,0.00063865709919,0.00064964557524,0.00065278686934,0.00065273417697,0.00065284102581,0.00065274916144,0.00065278530883,0.00065279744940,0.00065279742736,0.00065279742700]
sp.plotSingle("Imag values of Selected Roots Close to Resonance with df=0.01%, Emax=0.1194Ryds", xs, [ys], "N", "Imag Energy (Rydbergs)", path="Results/Values_ManPlot_Imag.png",markerSz=8,markWithLine=True,logy=False)
Ejemplo n.º 8
0
        xs, ys = p.totalListSearch_E(foundData, LVL_V, plotLvl)
        legends.append("N=" + str(N))
        xs_s.append(xs)
        ys_s.append(ys)
    else:
        title = title_base + "N" + str(N) + title_end
        yLabel = "1st Bound State Energy (hartrees)"
        xs, ys = p.plotListSearch_E(foundData, LVL_V, plotLvl)
        sp.setSubPlotParameters(left=0.18)
        if args.chopEnd_ is not None:
            ys = ys[:-args.chopEnd_]
        sp.turnOffColourCycle()
        sp.plotSingle(title,
                      xs,
                      ys,
                      xLabel,
                      yLabel,
                      logx=args.logx_,
                      markerSz=5,
                      path="Results/Chart Scat " + title + ".png")

if args.results_ == 3 or args.results_ == 4:
    title = title_base + "N_3-65" + title_end
    xs, ys_s = _uniformVals(xs_s, ys_s)
    sp.plotSingle(title,
                  xs,
                  ys_s,
                  xLabel,
                  yLabel,
                  legends=legends,
                  logx=args.logx_,
                  path="Results/Chart Total " + title + ".png")
Ejemplo n.º 9
0
    if i < len(sys.argv) - 1:
        res = (float(sys.argv[i]), -2.0 * float(sys.argv[i + 1]))
        print str(res)
        resonances.append(res)
        i += 2
    else:
        break


def phaseFun(pos, width, ene):
    x = (width / 2.0) / (pos - ene)
    return atan(x)


de = (emax - emin) / steps

enes = []
phases = []

ene = emin
for i in range(steps):
    phase = 0.0
    for res in resonances:
        phase += phaseFun(res[0], res[1], ene)
    enes.append(ene)
    phases.append(phase)
    ene += de

sp.setExtents((0.0, 1.6), (-3.5, 3.5))
sp.plotSingle("Resonant Phase Shift Plot - " + str(len(resonances)) + " poles",
              enes, [phases], "Energy (ryds)", "Phase Shift")
Ejemplo n.º 10
0
foundData = d.dictSearch(searchFun, searchDict[args.a_], LVL_V)
if args.results_ == 1 or args.results_ == 2:
    sys.stdout = open(resultsPath + "Table " + title + ".txt", 'w')
    p.tabulateListSearch_E(foundData, LVL_V)
else:
    if args.logx_ == 1:
        xLabel = "kmin"
    else:
        xLabel = "kmax"
    if args.results_ == 3 or args.results_ == 4:
        yLabel = "Num 1st Bound States found"
        xs, ys = p.totalListSearch_E(foundData, LVL_V, plotLvl)
        sp.plotSingle(title,
                      xs, [ys],
                      xLabel,
                      yLabel,
                      logx=args.logx_,
                      path=resultsPath + "Chart Total " + title + ".png")
    elif args.results_ == 5:
        yLabel = "1st Bound State Energy (hartrees)"
        xs, ys = p.plotListSearch_E(foundData, LVL_V, plotLvl)
        sp.setSubPlotParameters(left=0.15)
        if args.chopEnd_ is not None:
            ys = ys[:-args.chopEnd_]
        sp.plotSingle(title,
                      xs,
                      ys,
                      xLabel,
                      yLabel,
                      logx=args.logx_,
                      markerSz=5,
Ejemplo n.º 11
0
from ratsmatwrap import *
import general.simpplot as sp
from runargsplot import *

kmat = RatSMatWrap(FILENAME, args.subN_, args.subStart_, args.subEnd_)
vals = kmat.getFinDetRange(args.plotStart_, args.plotEnd_, args.plotComplex_,
                           args.steps_)

sp.plotSingle("Numercal Data : det(Fin)", vals[0], [vals[1], vals[2]],
              'Electron Energy (rydbergs)', 'det(Fin)', ['real', 'imag'])
Ejemplo n.º 12
0
def plotValues(df, index, desc, imag, showMarkers=True):
    ret = plotData("./Data_"+str(df)+"/", index, getValue)
    sp.plotSingle(str("Imag" if imag else "Real") + " values of Poles found with comp thres df="+str(df*100)+"%", ret[0], [ret[1][1]] if imag else [ret[1][0]], desc+" Energy Range (Rydbergs)", "Energy (Rydbergs)", path="Results/Values_"+str("Imag_" if imag else "Real_")+str(df)+".png",markerSz=8 if showMarkers else None,markWithLine=True) 
Ejemplo n.º 13
0
def plotNumPolesNotLost(df, index, desc, showMarkers=True):
    ret = plotData("./Data_"+str(df)+"/", index, getNumPolesNotLost)
    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) 
Ejemplo n.º 14
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) 
Ejemplo n.º 15
0
  title = title_base + "N" + str(N) + "_kmin" + str(range[0]) + "-" + str(range[1]) + "_kmax" + str(kmax) + ")"
else:
  range = d.getRange(LVL_KMAX)
  title = title_base + "N" + str(N) + "_kmin" + str(kmin) + "_kmax" + str(range[0]) + "-" + str(range[1]) + ")"
  
foundData = d.dictSearch(searchFun, searchDict[args.a_], LVL_V)
if args.results_==1 or args.results_==2:
  sys.stdout = open(resultsPath+"Table "+title+".txt", 'w')
  p.tabulateListSearch_E(foundData,LVL_V)
else:
  if args.logx_==1:
    xLabel = "kmin"
  else:
    xLabel = "kmax"
  if args.results_==3 or args.results_==4:
    yLabel = "Num 1st Bound States found"
    xs, ys = p.totalListSearch_E(foundData,LVL_V,plotLvl)
    sp.plotSingle(title, xs, [ys], xLabel, yLabel, logx=args.logx_, path=resultsPath+"Chart Total "+title+".png")
  elif args.results_==5:
    yLabel = "1st Bound State Energy (hartrees)"
    xs, ys = p.plotListSearch_E(foundData,LVL_V,plotLvl)
    sp.setSubPlotParameters(left=0.15)
    if args.chopEnd_ is not None:
      ys = ys[:-args.chopEnd_]
    sp.plotSingle(title, xs, ys, xLabel, yLabel, logx=args.logx_, markerSz=5,path=resultsPath+"Chart Scat "+title+".png")  

  
  
  
  
Ejemplo n.º 16
0
import sys
import os

base = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, base + '/../../../../Utilities')
import general.simpplot as sp

xs = [3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0]
ys = [
    0.09127081964164, 0.07780137160144, 0.07714598042590, 0.07680143868106,
    0.07693999245180, 0.07693112841080, 0.07693102556199, 0.07693119716895,
    0.07693077955548, 0.07693125892433, 0.07693128907091, 0.07693128907534,
    0.07693128908032
]
sp.plotSingle(
    "Real values of Selected Roots Close to Resonance with df=0.01%, Emax=0.1194Ryds",
    xs, [ys],
    "N",
    "Real Energy (Rydbergs)",
    path="Results/Values_ManPlot_Real.png",
    markerSz=8,
    markWithLine=True,
    logy=False)
Ejemplo n.º 17
0
from scattering.stran import *
import general.simpplot as sp

spArgs = argparse.ArgumentParser(
    description="Two Channel Radial Well Fit - Plot det(Fin)",
    parents=[tcp_range])
spArgs.add_argument("startE_", help="Start Energy", type=float)
spArgs.add_argument("endE_", help="End Energy", type=float)
spArgs.add_argument("plotComplex_",
                    help="Plot Complex Energy Offset",
                    type=float)
spArgs.add_argument("steps_", help="Number of steps", type=int)
args = spArgs.parse_args()

try:
    kCal = sm.kCalculator([args.t1_, args.t2_],
                          ktype=sm.K_COMP,
                          massMult=MASSMULT)
    matSeq = sm.matSequence()
    anaSmat, ratSmat = getSmats(args, kCal, kCal)

    vals = ratSmat.getFinDetRange(args.startE_, args.endE_, args.plotComplex_,
                                  args.steps_)

    sp.plotSingle("Two Channel Radial Well Fit : det(Fin)", vals[0],
                  [vals[1], vals[2]], 'Total Energy (hartrees)', 'det(Fin)',
                  ['real', 'imag'])

except (DCException, sm.MatException) as inst:
    print str(inst)
    sys.exit()
Ejemplo n.º 18
0
from ratsmatwrap import *
import general.simpplot as sp
from runargsplot import *

kmat = RatSMatWrap(FILENAME,args.subN_,args.subStart_,args.subEnd_)
vals = kmat.getFinDetRange(args.plotStart_, args.plotEnd_, args.plotComplex_, args.steps_)

sp.plotSingle("Numercal Data : det(Fin)", vals[0], [vals[1],vals[2]], 'Electron Energy (rydbergs)', 'det(Fin)', ['real','imag'])