MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / map_data2D_srx_old

Function map_data2D_srx_old

pyxrf/model/load_data_from_db.py:1154–1697  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

1152
1153
1154def map_data2D_srx_old(
1155 run_id_uid,
1156 fpath,
1157 create_each_det=False,
1158 fname_add_version=False,
1159 completed_scans_only=False,
1160 successful_scans_only=False,
1161 file_overwrite_existing=False,
1162 output_to_file=True,
1163 save_scaler=True,
1164 num_end_lines_excluded=None,
1165):
1166 """
1167 Transfer the data from databroker into a correct format following the
1168 shape of 2D scan.
1169 This function is used at SRX beamline for both fly scan and step scan.
1170 Save to hdf file if needed.
1171
1172 .. note:: Requires the databroker package from NSLS2
1173
1174 Parameters
1175 ----------
1176 run_id_uid : int
1177 ID or UID of a run
1178 fpath: str
1179 path to save hdf file
1180 create_each_det: bool, optional
1181 Do not create data for each detector is data size is too large,
1182 if set as false. This will slow down the speed of creating hdf file
1183 with large data size.
1184 fname_add_version : bool
1185 True: if file already exists, then file version is added to the file name
1186 so that it becomes unique in the current directory. The version is
1187 added to <fname>.h5 in the form <fname>_(1).h5, <fname>_(2).h5, etc.
1188 False: then conversion fails.
1189 completed_scans_only : bool
1190 True: process only completed scans (for which ``stop`` document exists in
1191 the database). Failed scan for which ``stop`` document exists are considered
1192 completed even if not the whole image was scanned. If incomplete scan is
1193 encountered: an exception is thrown.
1194 False: the feature is disabled, incomplete scan will be processed.
1195 file_overwrite_existing : bool, keyword parameter
1196 This option should be used if the existing file should be deleted and replaced
1197 with the new file with the same name. This option should be used with caution,
1198 since the existing file may contain processed data, which will be permanently deleted.
1199 True: overwrite existing files if needed. Note, that if ``fname_add_version`` is ``True``,
1200 then new versions of the existing file will always be created.
1201 False: do not overwrite existing files. If the file already exists, then the exception
1202 is raised.
1203 output_to_file : bool, optional
1204 save data to hdf5 file if True
1205 save_scaler : bool, optional
1206 choose to save scaler data or not for srx beamline, test purpose only.
1207 num_end_lines_excluded : int, optional
1208 remove the last few bad lines
1209
1210 Returns
1211 -------

Callers 1

map_data2D_srxFunction · 0.85

Calls 9

_is_scan_completeFunction · 0.85
_is_scan_successfulFunction · 0.85
get_total_scan_pointFunction · 0.85
save_data_to_hdf5Function · 0.85
itemsMethod · 0.80
clearMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected