Fix saving lists of arrays with recent versions of numpy
[qpms.git] / misc / omega_eV2scuff.py
blobd5c9d021151fec6cc3bf12a459189c78965d0c50
1 #!/usr/bin/env python3
2 import sys
3 import argparse
5 ap = argparse.ArgumentParser()
6 ap.add_argument("-o", type=str, help='Output file (if not specified, standard output).')
7 ap.add_argument("input_file", type=str, help="Input file (if not specified, standard input).")
9 a = ap.parse_args()
11 if a.o:
12 output = open(a.o, 'w')
13 else:
14 output = sys.stdout
15 if a.input_file:
16 input = open(a.input_file, 'r')
17 else:
18 input = sys.stdin
20 from qpms.constants import eV2SU
22 for l in input:
23 print(eV2SU(float(l)), file=output)
25 output.close()
26 input.close()