FAIRmat-NFDI / pynxtools-xps

A pynxtools reader plugin for X-ray photoelectron spectroscopy (XPS) data
https://fairmat-nfdi.github.io/pynxtools-xps/
Apache License 2.0
2 stars 1 forks source link

Problems parsing vms exported from KRATOS ESCAPE #61

Closed ondracka closed 5 months ago

ondracka commented 5 months ago

Contact Details

ondracka@mail.muni.cz

What happened?

Have a vms file with multiples samples and multiple spectra measurements exported from KRATOS ESCAPE. TaAlO-newTandSseries.zip The file can be opened in CASA XPS just fine.

Tried to parse it with dataconverter TaAlO-newTandSseries.vms eln_data_kratos.yaml --reader xps --nxdl NXmpes --output output.vms.nxs. As a sidenote at this point I actually don't have a good eln_data_kratos.yaml file eln_data_kratos.zip , I just wanted to see how far I could get, so I copy pasted one from the examples and made few tweaks, but most of that is definitely wrong, so could be problem on my side, but from the log it looks more like the vamas parsing failed for some reason.

Relevant log output

Using xps reader to convert the given files:  
• TaAlO-newTandSseries.vms
• eln_data_kratos.yaml
Traceback (most recent call last):
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/file_parser.py", line 97, in get_dict
    parser_obj.parse_file(file, **kwargs)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/reader_utils.py", line 89, in parse_file
    self.raw_data = self.parser.parse_file(file, **kwargs)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/vms/vamas.py", line 419, in parse_file
    self._parse_blocks()
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/vms/vamas.py", line 520, in _parse_blocks
    self.blocks += [self._parse_one_block()]
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/vms/vamas.py", line 707, in _parse_one_block
    self._add_data_values(block)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/vms/vamas.py", line 716, in _add_data_values
    self._add_regular_data(block)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/vms/vamas.py", line 742, in _add_regular_data
    data_array = np.array(self.data[: block.num_ord_values], dtype=float)
ValueError: could not convert string to float: 'O1s'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ondracka/software/nomadpyenv/bin/dataconverter", line 8, in <module>
    sys.exit(main_cli())
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools/dataconverter/convert.py", line 399, in convert_cli
    convert(
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools/dataconverter/convert.py", line 221, in convert
    data = transfer_data_into_template(
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools/dataconverter/convert.py", line 165, in transfer_data_into_template
    data = data_reader().read(  # type: ignore[operator]
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/reader.py", line 465, in read
    data_dict = parser.get_dict(**kwargs)
  File "/home/ondracka/software/nomadpyenv/lib64/python3.9/site-packages/pynxtools_xps/file_parser.py", line 102, in get_dict
    raise ValueError(XpsDataFileParser.__vndr_err_msg__) from val_err
ValueError: Need an XPS data file from the following vendors: ['kratos', 'phi', 'scienta', 'specs', 'unkwown']
lukaspie commented 5 months ago

Hi @ondracka, thanks for testing the reader and for providing the data. I am currently at a conference, but I can probably take this on next week and see what the problem is. I'll contact you once I have tested/fixed it.

ondracka commented 5 months ago

Thanks @lukaspie, much appreciated.

sameyley commented 5 months ago

ESCApe also puts a lot of information in the block comments, so it would be good if they were parsed to reduce the amount of information necessary in the ELN file. [edit] nm, I saw that you're already handling this with #63