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

Function make_hdf

pyxrf/model/load_data_from_db.py:315–509  ·  view source on GitHub ↗

Load data from database and save it in HDF5 files. Parameters ---------- start : int Run ID (positive or negative int) or of the first scan to convert or Run UID (str, full or short). If `start` is UID, then `end` must not be provided or set to None. end : int

(
    start,
    end=None,
    *,
    fname=None,
    wd=None,
    fname_add_version=False,
    completed_scans_only=False,
    successful_scans_only=False,
    file_overwrite_existing=False,
    prefix="scan2D_",
    create_each_det=False,
    save_scaler=True,
    num_end_lines_excluded=None,
    skip_scan_types=None,
    catalog_name=None,
)

Source from the content-addressed store, hash-verified

313
314
315def make_hdf(
316 start,
317 end=None,
318 *,
319 fname=None,
320 wd=None,
321 fname_add_version=False,
322 completed_scans_only=False,
323 successful_scans_only=False,
324 file_overwrite_existing=False,
325 prefix="scan2D_",
326 create_each_det=False,
327 save_scaler=True,
328 num_end_lines_excluded=None,
329 skip_scan_types=None,
330 catalog_name=None,
331):
332 """
333 Load data from database and save it in HDF5 files.
334
335 Parameters
336 ----------
337
338 start : int
339 Run ID (positive or negative int) or of the first scan to convert or Run UID
340 (str, full or short). If `start` is UID, then `end` must not be provided or set to None.
341 end : int, optional
342 scan ID of the last scan to convert. If ``end`` is not specified or None, then
343 only the scan with ID ``start`` is converted and an exception is raised if an
344 error occurs during the conversion. If ``end`` is specified, then scans in the
345 range ``scan``..``end`` are converted and a scan in the sequence is skipped
346 if there is an issue during the conversion. For example:
347
348 .. code-block:: python
349
350 make_hdf(2342)
351
352 will process scan #2342 and throw an exception if error occurs. On the other hand
353
354 .. code-block:: python
355
356 make_hdf(2342, 2342)
357
358 will process scan #2342 and write data to file if conversion is successful, otherwise
359 no file will be created. The scans with IDs in the range 2342..2441 can be processed by
360 calling
361
362 .. code-block:: python
363
364 make_hdf(2342, 2441)
365
366 Scans with IDs in specified range, but not existing in the database, or scans causing errors
367 during conversion will be skipped.
368
369 fname : string, optional keyword parameter
370 path to save data file when ``end`` is ``None`` (only one scan is processed).
371 File name is created automatically if ``fname`` is not specified.
372 wd : str

Callers 1

Calls 2

fetch_run_infoFunction · 0.85
fetch_data_from_dbFunction · 0.85

Tested by

no test coverage detected