R-Lum/rxylib

read_xyData possibly not working for xrdml?

ZabvDa opened this issue · 3 comments

ZabvDa commented

Hi Developers

Thanks for an nice package that I enjoy using.

I have previously used the package for xrdml files from (Malvern)Panalytical instruments and the read_xyData function has always worked.
I have now updated R (R version 4.3.1) and the package (0.2.11) and now the function read_xyData does not seem to work for xrdml files.

Example from Reference manual. This works perfectly

file <- system.file("extdata/ExampleSpectrum.CNF", package = "rxylib")
file
results <- read_xyData(file)
results

Test with different file that was included in the package. This also works perfectly

file_2 <- system.file("extdata/TLSpectrum.xsyg", package = "rxylib")
file_2
results_2 <- read_xyData(file_2)
results_2

I added my own .xrdml file to the package directory and called it Xrdml_test.xrdml.

This is so that the test should be a close to the example as possible

file_1 <- system.file("extdata/Xrdml_test.xrdml", package = "rxylib")
file_1

The file seems to be readily detected and stored in the file_1 object

results_1 <- read_xyData(file_1)

When using the read_xyData function on .xrdml files, R throws an error:

#[read_xyData()] File of type PANalytical XRDML detected ...
#Error : [read_xyData()] Data import failed. Return NULL!

So it seems to detect the file correctly but will not import the data.

results_1

Could it be that the resent update resulted in the read_xyData function not working with xrdml files?

Thank you for your work.

Best regards

RLumSK commented

@ZabvDa Would you mind sending me your xrdml file? You can either upload it here or send it to me via e-mail (see https://cran.r-project.org/package=rxylib) for the maintainer address).

RLumSK commented

Linked to wojdyr/xylib#25

RLumSK commented

@ZabvDa The xrdml version you have used has a node called <counts/> instead of <intensities/>. Therefore it did not work anymore because the underlying xylib needed an adjustment first. It should work now, please install the development version for "rxylib" from GitHub (branch: master)