added convertXsec.py for DWBA.Xsec.txt

This commit is contained in:
Ryan Tang 2025-03-10 16:17:49 -04:00
parent d7564c5bfb
commit 0af018f0d0
3 changed files with 26 additions and 2 deletions

View File

@ -196,7 +196,7 @@ class IsotopeClass:
[A, Z] = self.GetAZ(ASym)
print("<br>========================= ", ASym)
print("<br>A : %d, Z : %d, N : %d" % (A, Z, A-Z))
print("<br> Jpi : ", self.GetJpi(ASym))
print("<br> Jpi : ", self.GetJpi_ASym(ASym))
print("<br>half-live : %.2f sec" % (self.GetHalfLife(ASym)))
print("<br> Mass : %9.2f MeV" % (self.GetMassFromSym(ASym) ))
print("<br> Binding : %9.2f MeV/A" % (self.GetBindingPerA(ASym)))

25
PyGUIQt6/convertXsec.py Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python3
import sys
filename = sys.argv[1]
if len(sys.argv) < 2:
print("Error: Not enough arguments provided.")
print("Usage: ./{sys.argv[0]} filename")
sys.exit(1)
import numpy as np
# Load data while skipping the first two lines
data = np.loadtxt(filename, skiprows=2)
# Extract columns
angles, values = data[:, 0], data[:, 1]
for a, b in zip(angles, values):
print(f"{{{a:5.1f}, {b:7.3f}}},", end="")
print("\n")

View File

@ -11,7 +11,6 @@ if len(sys.argv) < 2:
#####################################################
import numpy as np
import re
import numpy as np
import matplotlib.pyplot as plt
Lmax = None