Xmcd Mcd Converter Page
out = [] for line in lines: if line.startswith('#') or line.strip() == '': continue parts = line.split() if len(parts) >= 3: energy = float(parts[0]) i_plus = float(parts[1]) i_minus = float(parts[2]) mcd = i_minus - i_plus # change sign if needed out.append(f"energy:.3f mcd:.6f\n")
import sys infile = sys.argv[1] outfile = sys.argv[2] xmcd mcd converter
with open(outfile, 'w') as f: f.writelines(out) out = [] for line in lines: if line
print(f"Converted infile → outfile")