def test_CdSe(self):
     fname = os.path.join(self.datapath, 'CdSe')
     sys.argv = [sys.argv[0], fname, ]
     sys.argv.append('--quiet')
     sys.argv.append('-s')
     sys.argv.append('92')
     sys.argv.append('-c')
     sys.argv.append('HerixE')
     sys.argv.append('T_sample_LS340')
     sys.argv.append('HRMpzt1')
     # aborted scan #92
     # TODO: should not raise this ValueError but instead, handle it fail-safe
     self.assertRaises(ValueError, extractSpecScan.main)
     
     sys.argv = [sys.argv[0], fname, ]
     sys.argv.append('--quiet')
     sys.argv.append('-s')
     sys.argv.append('95')
     sys.argv.append('-c')
     sys.argv.append('HerixE')
     sys.argv.append('T_sample_LS340')
     sys.argv.append('HRMpzt1')
     extractSpecScan.main()
     
     full_name = os.path.join(self.datapath, 'CdSe_95')
     self.assertTrue(os.path.exists(full_name), full_name + ' was not found')
     buf = open(full_name, 'r').readlines()
     self.assertEqual(42, len(buf))
     self.assertEqual('# HerixE\tT_sample_LS340\tHRMpzt1\n', buf[0])
     self.assertEqual([-12.063282, 297.529, 66.0], map(float, buf[1].split()))
     self.assertEqual([-2.0358687, 297.553, 66.0], map(float, buf[-1].split()))
示例#2
0
# TODO: fold into the unit test suite

#-----------------------------------------------------------------------------
# :author:    Pete R. Jemian
# :email:     [email protected]
# :copyright: (c) 2014-2016, Pete R. Jemian
#
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------

import sys
import extractSpecScan

#args = 'data/APS_spec_data.dat -s 1 6   -c mr USAXS_PD I0 seconds'
#args = 'data/33id_spec.dat     -s 1 6   -c H K L signal elastic I0 seconds'
#args = 'data/CdOsO     -s 1 1.1 48   -c HerixE H K L T_control_LS340  T_sample_LS340 ICO-C  PIN-D  PIN-C Seconds'
args = 'data/02_03_setup.dat     -s 46  1-3   -c ar  ay  dy  Epoch  seconds  I0  USAXS_PD'
# args = 'data/02_03_setup.dat     -s 47   -c mr seconds  I0  USAXS_PD'
args = 'data/xpcs_plugin_sample.spec  -s 7   -c img_n  Epoch  ccdc'

for _ in args.split():
    sys.argv.append(_)

sys.argv.append('-G')
sys.argv.append('-V')
sys.argv.append('-Q')
sys.argv.append('-P')
extractSpecScan.main()
#-----------------------------------------------------------------------------
# :author:    Pete R. Jemian
# :email:     [email protected]
# :copyright: (c) 2014-2016, Pete R. Jemian
#
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------


import sys
import extractSpecScan

#args = 'data/APS_spec_data.dat -s 1 6   -c mr USAXS_PD I0 seconds'
#args = 'data/33id_spec.dat     -s 1 6   -c H K L signal elastic I0 seconds'
#args = 'data/CdOsO     -s 1 1.1 48   -c HerixE H K L T_control_LS340  T_sample_LS340 ICO-C  PIN-D  PIN-C Seconds'
args = 'data/02_03_setup.dat     -s 46  1-3   -c ar  ay  dy  Epoch  seconds  I0  USAXS_PD'
# args = 'data/02_03_setup.dat     -s 47   -c mr seconds  I0  USAXS_PD'
args = 'data/xpcs_plugin_sample.spec  -s 7   -c img_n  Epoch  ccdc'

for _ in args.split():
    sys.argv.append(_)

sys.argv.append('-G')
sys.argv.append('-V')
sys.argv.append('-Q')
sys.argv.append('-P')
extractSpecScan.main()