Esempio n. 1
0
 def test_glbl_reload(self):
     reload_glbl = copy.copy(self._glbl)  # glbl going to be reload
     # fresh start, test default values
     assert self._glbl.dk_window == 3000
     assert self._glbl.auto_dark == True
     assert self._glbl._dark_dict_list == []
     assert self._glbl.mask == None
     # update value
     self._glbl.dk_window = 20
     self._glbl.auto_dark = False
     self._glbl._dark_dict_list = [{'acq_time': 0.1, 'exposure': 0.5,
                               'timestamp': time.time(),
                               'uid':str(uuid.uuid4())}]
     # after update, local yaml should exist
     assert os.path.isfile(self._glbl.filepath)
     assert self._glbl.filepath == glbl_filepath
     _load_glbl(reload_glbl)
     # test equality of two glbl classes
     for k, v in self._glbl.__dict__.items():
         assert reload_glbl.__dict__[k] == v
Esempio n. 2
0
xrun = CustomizedRunEngine(None)
xrun.md['owner'] = glbl.owner
xrun.md['beamline_id'] = glbl.beamline_id
xrun.md['group'] = glbl.group

# load beamtime
bt = start_xpdacq()
if bt is not None:
    print("INFO: Reload beamtime objects:\n{}\n".format(bt))
    xrun.beamtime = bt

HOME_DIR = glbl.home
BASE_DIR = glbl.base

print('INFO: Initializing the XPD data acquisition environment\n')
if os.path.isdir(HOME_DIR):
    os.chdir(HOME_DIR)
else:
    os.chdir(BASE_DIR)

from xpdacq.calib import *

# reload glbl options
_load_glbl(glbl)

# analysis functions, only at beamline
#from xpdan.data_reduction import *

print('OK, ready to go.  To continue, follow the steps in the xpdAcq')
print('documentation at http://xpdacq.github.io/xpdacq\n')