frappy/calibtest.py
Markus Zolliker f9a0fdf7e4 add frappy_psi/calcurve.py and calibtest.py
Change-Id: I5b9aae0ac3bcd76d846c08717201e6c32df4b675
2024-01-31 17:09:17 +01:00

23 lines
572 B
Python

import sys
import os
from glob import glob
from frappy_psi.calcurve import CalCurve
os.chdir('/Users/zolliker/gitpsi/calcurves')
if len(sys.argv) > 1:
calib = sys.argv[1]
c = CalCurve(calib)
else:
for file in sorted(glob('*.*')):
if file.endswith('.md') or file.endswith('.std'):
continue
try:
c = CalCurve(file)
xy = c.export()
print('%9.4g %12.7g %9.4g %9.4g %s' % (tuple(c.extx) + tuple(c.exty) + (file,)))
except Exception as e:
print(file, e)
calib = file