Skip to main content
`Ctrl`+`K`

# Renishaw

Reader for spectroscopy data saved using Renishaw’s WiRE software. Currently, RosettaSciIO can only read the `.wdf` format from Renishaw. When reading spectral images, the white light image will be returned along the spectral images in the list of dictionaries. The position of the mapped area is returned in the metadata dictionary of the white light image and this will be displayed when plotting the image with HyperSpy.

If LumiSpy is installed, `Luminescence` will be used as the `signal_type`.

Note

There are many different options for the axes according to the format specifications. However, only a limited subset is tested: Spectral (Wavelength and Raman Shift) for the signal axes and X, Y, Z, FocusTrackZ and Time for navigation axes. Reading maps obtained in a serpentine path is not implemented.

Note

The laser power can be accessed from the `original_metadata`:

    >>> import hyperspy as HyperSpy
    >>> s = hs.load("raman_map.wdf")
    >>> s.original_metadata.get_item("WXIS_0.ND Transmission %")
    10

This reader is based on the py-wdf-reader, which is inspired by the matlab reader from Alex Henderson. Moreover, inspiration is taken from gwyddion’s reader.

## API functions

rsciio.renishaw.file_reader(filename, lazy=False, use_uniform_signal_axis=False, load_unmatched_metadata=False)

  Read Renishaw’s `.wdf` file. In case of mapping data, the image area will be returned with a marker showing the mapped area.

  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_axis bool, default=False

      Can be specified to choose between non-uniform or uniform signal axes. 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%.

    load_unmatched_metadata bool, default=False

      Some of the original_metadata cannot be matched (no key, just value). Part of this is a VisualBasic-Script used for data acquisition (~230kB), which blows up the size of `original_metadata`. If this option is set to True, this metadata will be included and can be accessed by `s.original_metadata.UNMATCHED`, otherwise the `UNMATCHED` tag will not exist.

  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.