We assume that Sardana has been setup properly to produce .fio files. To enable NeXus file creation, the ScanFile variable has to set:
p09/door/haso107d1.01 [8]: senv ScanFile '["tst.fio", "tst.nxs"]'
Then we have to check whether all required User Data are available:
p09/door/haso107d1.01 [14]: lsprof Profile (MntGrp): mg_tk1 -------------------------- ------------------------------- Timer(s) d1_t01 Detector Components d1_c01, d1_c02, d1_mca01 Descriptive Components chi, slit1, beamline Mandatory Components default User Data {} AppendEntry False SelectorServer p09/nxsrecselector/haso107d1 ConfigServer p09/nxsconfigserver/haso107d1 WriterServer p09/nxsdatawriter/haso107d1 Profile is not set by nxselector(nxsmacros) or MntGrp has been changed An error occurred while running Macro 'lsprof() -> eef330ba-2c91-11e6-be3c-901b0e39aa90': Exception: User Data not defined ['beamtime_id', 'chemical_formula', 'sample_name', 'title']In this example beamtime_id, chemical_formula, sample_name and title have to be supplied:
p09/door/haso107d1.01 [15]: nxsetudata beamtime_id 12345 An error occurred while running Macro 'nxsetudata(beamtime_id, 12345) -> 4f7941c2-2c92-11e6-be3c-901b0e39aa90': Exception: User Data not defined ['chemical_formula', 'sample_name', 'title'] p09/door/haso107d1.01 [16]: nxsetudata chemical_formula h2o ... p09/door/haso107d1.01 [17]: nxsetudata sample_name ice ... p09/door/haso107d1.01 [18]: nxsetudata title water
The command nxsresetdesc resets the descriptive components to those mentioned in the DefaultPreselectedComponents property of the NXSRecSelector server and it validates the selection: components depending on Tango servers which are not exported are removed.
p09/door/haso107d1.01 [15]: nxsresetdesc
Validation can also be done by:
p09/door/haso107d1.01 [15]: nxsupdatedesc
Now everything is prepared to generate NeXus output:
p09/door/haso107d1.01 [10]: ascan exp_dmy01 0 10 10 0.2 Operation will be saved in /home/kracht/Misc/IVP/temp/tst_[ScanId].fio (fio) Operation will be saved in /home/kracht/Misc/IVP/temp/tst_00587.nxs (nxs) Scan #587 started at Tue Jun 7 11:59:42 2016. It will take at least 0:00:05.173327 Moving to start positions... #Pt No exp_dmy01 d1_c01 d1_c02 d1_mca01 d1_t01 dt 0 0 170.63 54.5371 (2048,) 0.2 1.29186 1 1 54.0477 103.346 (2048,) 0.2 1.90338 2 2 4.2339 89.7109 (2048,) 0.2 2.52599 3 3 0.083349 35.7175 (2048,) 0.2 3.14038 4 4 -0.0499163 6.48311 (2048,) 0.2 3.77414 5 5 0.218407 58.8317 (2048,) 0.2 4.39328 6 6 28.522 13.7547 (2048,) 0.2 5.03598 7 7 128.763 0.659719 (2048,) 0.2 5.63272 8 8 6.12144 0.0505092 (2048,) 0.2 6.25632 9 9 0.940915 -0.0281954 (2048,) 0.2 6.89716 10 10 15.0109 0.0158487 (2048,) 0.2 7.50115 Operation saved in /home/kracht/Misc/IVP/temp/tst_00587.fio (fio) Operation saved in /home/kracht/Misc/IVP/temp/tst_00587.nxs (nxs) Scan #587 ended at Tue Jun 7 11:59:50 2016, taking 0:00:07.927980.Dead time 72.3% (motion dead time 39.3%)
The device selection can be changed by a dedicated GUI, see 1.2, or by command:
p09/door/haso107d1.01 [11]: nxset d1_t01 d1_c01 d1_c02 d1_mca01 pilatus