Transfer the data from databroker into a correct format following the shape of 2D scan. This function is used at SRX beamline for both fly scan and step scan. Save to hdf file if needed. .. note:: Requires the databroker package from NSLS2 Parameters ---------- run
(
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,
num_end_lines_excluded=None,
catalog=None,
)
| 1037 | |
| 1038 | |
| 1039 | def map_data2D_srx( |
| 1040 | run_id_uid, |
| 1041 | fpath, |
| 1042 | create_each_det=False, |
| 1043 | fname_add_version=False, |
| 1044 | completed_scans_only=False, |
| 1045 | successful_scans_only=False, |
| 1046 | file_overwrite_existing=False, |
| 1047 | output_to_file=True, |
| 1048 | save_scaler=True, |
| 1049 | num_end_lines_excluded=None, |
| 1050 | catalog=None, |
| 1051 | ): |
| 1052 | """ |
| 1053 | Transfer the data from databroker into a correct format following the |
| 1054 | shape of 2D scan. |
| 1055 | This function is used at SRX beamline for both fly scan and step scan. |
| 1056 | Save to hdf file if needed. |
| 1057 | |
| 1058 | .. note:: Requires the databroker package from NSLS2 |
| 1059 | |
| 1060 | Parameters |
| 1061 | ---------- |
| 1062 | run_id_uid : int |
| 1063 | ID or UID of a run |
| 1064 | fpath: str |
| 1065 | path to save hdf file |
| 1066 | create_each_det: bool, optional |
| 1067 | Do not create data for each detector is data size is too large, |
| 1068 | if set as false. This will slow down the speed of creating hdf file |
| 1069 | with large data size. |
| 1070 | fname_add_version : bool |
| 1071 | True: if file already exists, then file version is added to the file name |
| 1072 | so that it becomes unique in the current directory. The version is |
| 1073 | added to <fname>.h5 in the form <fname>_(1).h5, <fname>_(2).h5, etc. |
| 1074 | False: then conversion fails. |
| 1075 | completed_scans_only : bool |
| 1076 | True: process only completed scans (for which ``stop`` document exists in |
| 1077 | the database). Failed scan for which ``stop`` document exists are considered |
| 1078 | completed even if not the whole image was scanned. If incomplete scan is |
| 1079 | encountered: an exception is thrown. |
| 1080 | False: the feature is disabled, incomplete scan will be processed. |
| 1081 | file_overwrite_existing : bool, keyword parameter |
| 1082 | This option should be used if the existing file should be deleted and replaced |
| 1083 | with the new file with the same name. This option should be used with caution, |
| 1084 | since the existing file may contain processed data, which will be permanently deleted. |
| 1085 | True: overwrite existing files if needed. Note, that if ``fname_add_version`` is ``True``, |
| 1086 | then new versions of the existing file will always be created. |
| 1087 | False: do not overwrite existing files. If the file already exists, then the exception |
| 1088 | is raised. |
| 1089 | output_to_file : bool, optional |
| 1090 | save data to hdf5 file if True |
| 1091 | save_scaler : bool, optional |
| 1092 | choose to save scaler data or not for srx beamline, test purpose only. |
| 1093 | num_end_lines_excluded : int, optional |
| 1094 | remove the last few bad lines |
| 1095 | catalog |
| 1096 | reference to databroker catalog |
no test coverage detected