Page 1 of 1

eprsave() with 2D dataset saves to wrong file extension

Posted: Thu Sep 15, 2016 9:41 am
by sam.schott
The eprsave() function saves 2D datasets to three files ".DSC", ".DTA" and ".XFG". The latter should be ".YFG". Manually changing the file type after data export allows the file to be read again by Xepr or eprload() so this bug seems to be no more than a typo.

The bug applies to 2D datasets from CW experiments.

Re: eprsave() with 2D dataset saves to wrong file extension

Posted: Thu Sep 15, 2016 9:47 am
by Stefan Stoll
This is indeed a bug in eprsave. It will be fixed in the next release. Thanks for reporting!

Re: eprsave() with 2D dataset saves to wrong file extension

Posted: Tue Jan 26, 2021 2:34 am
by Emilien

Hello,
in the latest release (5.2.29), no .YGF file is generated when eprsave is used with 2D data set...
Emilien


Re: eprsave() with 2D dataset saves to wrong file extension

Posted: Tue Jan 26, 2021 11:49 am
by Stefan Stoll

Currently, eprsave saves the gauge files (XGY, YGF) only if the data is two-dimensional and the associated axis is non-linear.


Re: eprsave() with 2D dataset saves to wrong file extension

Posted: Wed Jan 27, 2021 8:16 am
by Emilien

What do you mean by "the associated axis is non-linear"?
If I type:

Code: Select all

eprsave('toto',{323:332,[0 300 600 900 1200]},ones(10,5))
eprsave('toto',{323:332,[0 300 600 900 1200]'},ones(10,5))
eprsave('toto',{[323:332]',[0 300 600 900 1200]},ones(10,5))
eprsave('toto',{[323:332]',[0 300 600 900 1200]'},ones(10,5))

No toto.YGF is generated.
By the way, do you know what is the purpose of the gauge files? It's not clear for me...

I have a related second issue...
If you execute this code:

Code: Select all

[x,y]=eprload('Bruker2D.DSC'); % real file from Elexsys
eprsave('tata',x,y)
[x_,y_]=eprload('tata.DSC');

B1=x{1,1};
B2=x_{1,1};
check_B=[B1(1:10);B2(1:10)]'

t1=x{1,2}; %size=40x1
t2=x_{1,2};%size=1x40
check_t=[t1(1:10)';t2(1:10)]'

you can see that the second axis is modified by eprsave. The first one is also modified but errors are less than 1e-4.
Note also that no tata.YGF is generated.
Thanks for your help!

Bruker2D.zip
(140.66 KiB) Downloaded 367 times

Re: eprsave() with 2D dataset saves to wrong file extension

Posted: Wed Jan 27, 2021 8:19 am
by Emilien

I forgot:
Generating an empty .YGF is OK for my applications... The modification of the sesond axis by eprsave is more a problem...


Re: eprsave() with 2D dataset saves to wrong file extension

Posted: Wed Jan 27, 2021 4:35 pm
by Stefan Stoll

This is a bug in eprsave. It failed to detect the non-linear axis. Thanks for reporting!

This is now fixed in 5.2.30 and in 6.0.0-dev.30.

The XGF/YGF/ZGF files are used to store the values along these axes if the values are non-linear (i.e. if they cannot be generated with a start value, an end value, and a number of points). In later versions of the DSC/DTA format, these files have GF1/GF2/GF3 extensions.