Transfer the data from databroker into a correct format following the shape of 2D scan. This function is used at TES beamline for step scan. Save the new data dictionary to hdf5 file if needed. .. note:: It is recommended to read data from databroker into memory dire
(
run_id_uid,
fpath,
create_each_det=False,
fname_add_version=False,
completed_scans_only=False,
successful_scans_only=False,
file_overwrite_existing=False,
output_to_file=True,
save_scaler=True,
catalog=None,
)
| 2613 | |
| 2614 | |
| 2615 | def map_data2D_tes( |
| 2616 | run_id_uid, |
| 2617 | fpath, |
| 2618 | create_each_det=False, |
| 2619 | fname_add_version=False, |
| 2620 | completed_scans_only=False, |
| 2621 | successful_scans_only=False, |
| 2622 | file_overwrite_existing=False, |
| 2623 | output_to_file=True, |
| 2624 | save_scaler=True, |
| 2625 | catalog=None, |
| 2626 | ): |
| 2627 | """ |
| 2628 | Transfer the data from databroker into a correct format following the |
| 2629 | shape of 2D scan. |
| 2630 | This function is used at TES beamline for step scan. |
| 2631 | Save the new data dictionary to hdf5 file if needed. |
| 2632 | |
| 2633 | .. note:: |
| 2634 | |
| 2635 | It is recommended to read data from databroker into memory |
| 2636 | directly, instead of saving to files. This is ongoing work. |
| 2637 | |
| 2638 | Parameters |
| 2639 | ---------- |
| 2640 | run_id_uid : int |
| 2641 | ID or UID of a run |
| 2642 | fpath: str |
| 2643 | path to save hdf file |
| 2644 | create_each_det: bool, optional |
| 2645 | Do not create data for each detector if data size is too large, |
| 2646 | if set as False. This will slow down the speed of creating an hdf5 file |
| 2647 | with large data size. |
| 2648 | fname_add_version : bool |
| 2649 | True: if file already exists, then file version is added to the file name |
| 2650 | so that it becomes unique in the current directory. The version is |
| 2651 | added to <fname>.h5 in the form <fname>_(1).h5, <fname>_(2).h5, etc. |
| 2652 | False: then conversion fails. |
| 2653 | completed_scans_only : bool |
| 2654 | True: process only completed scans (for which ``stop`` document exists in |
| 2655 | the database). Failed scan for which ``stop`` document exists are considered |
| 2656 | completed even if not the whole image was scanned. If incomplete scan is |
| 2657 | encountered: an exception is thrown. |
| 2658 | False: the feature is disabled, incomplete scan will be processed. |
| 2659 | file_overwrite_existing : bool, keyword parameter |
| 2660 | This option should be used if the existing file should be deleted and replaced |
| 2661 | with the new file with the same name. This option should be used with caution, |
| 2662 | since the existing file may contain processed data, which will be permanently deleted. |
| 2663 | True: overwrite existing files if needed. Note, that if ``fname_add_version`` is ``True``, |
| 2664 | then new versions of the existing file will always be created. |
| 2665 | False: do not overwrite existing files. If the file already exists, then the exception |
| 2666 | is raised. |
| 2667 | output_to_file : bool, optional |
| 2668 | save data to hdf5 file if True |
| 2669 | catalog |
| 2670 | reference to databroker catalog |
| 2671 | |
| 2672 | Returns |
no test coverage detected