Skip to main content
`Ctrl`+`K`

# Hamamatsu

Reader for spectroscopy data saved in `.img` (ITEX) files from the HPD-TA (High Performance Digital Temporal Analyzer) or HiPic (High Performance image control) software from Hamamatsu, e.g. for images from streak cameras or high performance CCD cameras.

If LumiSpy is installed, `TransientSpectrum` will be used as the `signal_type`, which is intended for streak camera images with both wavelength and time axes. Note that alternatively, Hamamatsu streak images saved in the Tagged image file format (TIFF) format can be read in.

Note

Currently, reading files containing multiple channels or multiple images per channel is not implemented.

## API functions

rsciio.hamamatsu.file_reader(filename, lazy=False, use_uniform_signal_axes=False, **kwds)

  Read Hamamatsu’s `.img` file, e.g. for streak camera images. In case LumiSpy is installed, the signal type is automatically set to `TransientSpectrum`.

  Parameters:
    filename `python:str`, `pathlib.Path`

      Filename of the file to read or corresponding pathlib.Path.

    lazy bool, default=False

      Whether to open the file lazily or not. The file will stay open until closed in `compute()` or closed manually. `get_file_handle()` can be used to access the file handler and close it manually.

    use_uniform_signal_axes bool, default=False

      Can be specified to choose between non-uniform or uniform signal axis. If `True`, the `scale` attribute is calculated from the average delta along the signal axis and a warning is raised in case the delta varies by more than 1 percent. Alternatively, the non-uniform `DataAxis` can be subsequently converted to a `UniformDataAxis` by interpolation using the function `interpolate_on_axis('uniform', axis=1)`.

    **kwds `python:dict`, optional

      Extra keyword argument will be ignored.

  Returns:
    `python:list` of `python:dict`

      List of dictionaries containing the following fields:

      - ‘data’ – multidimensional `numpy.ndarray` or `dask.array.Array`

      - ‘axes’ – list of dictionaries describing the axes containing the fields ‘name’, ‘units’, ‘index_in_array’, and either ‘size’, ‘offset’, and ‘scale’ or a numpy array ‘axis’ containing the full axes vector

      - ‘metadata’ – dictionary containing the parsed metadata

      - ‘original_metadata’ – dictionary containing the full metadata tree from the input file

      When the file contains several datasets, each dataset will be loaded as separate dictionary.