[Ifeffit] XAS viewer unit detection during data reading

Mauro ROVEZZI mauro.rovezzi at esrf.fr
Wed Mar 1 09:06:37 CST 2023


Dear Edmund,

That's great that you have find why the ASCII data parser in Larch was 
not detecting automatically the energy column from the labels in the 
header. The current choice is to look for "energy" or "ene" in the 
header to identify a data column as energy array.

Please, if you are willing to publicly share and example data file from 
P65, we could include it in the xafsdata examples here:

https://github.com/xraypy/xraylarch/tree/master/examples/xafsdata/beamlines

Those files are used for running the automatic tests and permit us 
improving the quality of Larch's code.

This is valid for any beamline who wants to contribute, even if I 
strongly encourage distributing data in HDF5/NeXus format instead of 
ASCII files.

Best,
Mauro

On 01/03/2023 14:31, Edmund Welter wrote:
> Dear Maurizio, Matt,
> 
> I just checked why some older files from my beamline work correctly 
> while the newer ones are not identified as xas data. After your 
> explanation the reason is quite simple. In the old format the last line 
> of the header was
> 
> #enc_energy mono_energy mono_bragg Step_Pos mono_X1vert....
> 
> After rewriting major parts of the beamline software among other things 
> the last line of the header changed to:
> 
> # E_enc E_step Bragg_enc Bragg_step...
> 
> Once I replace E_enc with something like energy_enc or enc_energy the 
> data is correctly identified as xas data.
> 
> So, the easiest solution for data taken at P65 is that I will change the 
> header in the data file so that the first column has a name that 
> contains "energy". I think i remember that Athena was looking for the 
> first column were the value of every point n+1 is larger than the value 
> of point n. it then usually correctly identified that column to be the 
> energy axis. However, I think labeling the columns correctly, that means 
> following common accepted conventions, is much easier than programming a 
> bunch of complicated fail safe energy axis recognising procedures.
> 
> Cheers,
> 
> Edmund
> 
> 
> 
> On 28.02.23 18:16, Matt Newville wrote:
>> Hi Siebe,
>>
>> Just to agree with Edmund and Mauro:  selecting "energy" and changing 
>> data type from "raw" to "XAS" should help.  But, you would have to do 
>> this for every file, which is not ideal.
>>
>> The file reader is trying to guess whether data is in energy (and if 
>> so, what units are used) and whether it is really XAS data or some 
>> other kind of data. I suspect that it is defaulting to "raw" because 
>> the energy column is not labeled "energy", but "col1" -- it sort of 
>> looks like the reader is not doing a good job of guessing what the 
>> columns mean.
>>
>> Posting a file would help diagnose why it is guessing wrong.  The file 
>> reading does try to guess what beamline a data file came from, so if 
>> you send a file, maybe we can add enough hints for files from that 
>> beamline to work more reliably.
>>
>>
>>
>> On Tue, Feb 28, 2023 at 6:37 AM Welter, Edmund <edmund.welter at desy.de> 
>> wrote:
>>
>>     Dear Siebe,
>>
>>     did you try to change the data type from "raw" to XAS. If you
>>     click on the small arrow on the right you should have the choice
>>     between xas and raw. On my computer that works and after that I
>>     can choose the unit for the X-axis. For some reason "raw" seems to
>>     be the preset choice. Maybe Matt could change that, I fell into
>>     this trap several times.
>>
>>     Cheers,
>>     Edmund
>>
>>     ------------------------------------------------------------------------
>>     *From: *"van der Veer, Siebe" <s.van.der.veer at rug.nl>
>>     *To: *"XAFS Analysis using Ifeffit"
>>     <ifeffit at millenia.cars.aps.anl.gov>
>>     *Sent: *Tuesday, 28 February, 2023 13:16:18
>>     *Subject: *[Ifeffit] XAS viewer unit detection during data reading
>>
>>     Dear all,
>>     I am not sure if this mailing list is the correct medium for this
>>     question. Apologies, if not.
>>
>>     I am looking to import files in XAS viewer, which worked fine in
>>     ATHENA, but in XAS viewer the correct units of the data are not
>>     detected and I cannot manually change them. I can get a plot of
>>     the data, but the data is not recognized by the software as XAS
>>     data, i.e. a lot of plotting/conversion options do not show.
>>
>>     I hope the following screenshots provide sufficient information to
>>     illustrate my issue.
>>
>>     Reading in a .dat file of fluorescence data. I can't change the
>>     units in the marked area.
>>
>>     image.png
>>
>>     The data can be read into the XAS viewer, but I don't have the
>>     regular plotting options in these dropdown menus.
>>
>>     image.png
>>
>>     Any advice would be much appreciated.
>>
>>     Kind regards,
>>
>>
>>     -- 
>>     *Siebe van der Veer* | *PhD student*
>>     Nanostructures of Functional Oxides | Zernike Institute for
>>     Advanced Materials
>>     University of Groningen | Nijenborgh 4, 9747 AG Groningen | The
>>     Netherlands
>>     Email: s.van.der.veer at rug.nl|
>>
>>     _______________________________________________
>>     Ifeffit mailing list
>>     Ifeffit at millenia.cars.aps.anl.gov
>>     http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>>     Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>>     _______________________________________________
>>     Ifeffit mailing list
>>     Ifeffit at millenia.cars.aps.anl.gov
>>     http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>>     Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>>
>>
>>
>> -- 
>> --Matt Newville <newville at cars.uchicago.edu 
>> <http://cars.uchicago.edu>> 630-327-7411
>>
>> _______________________________________________
>> Ifeffit mailing list
>> Ifeffit at millenia.cars.aps.anl.gov
>> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>> Unsubscribe:http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
> 
> _______________________________________________
> Ifeffit mailing list
> Ifeffit at millenia.cars.aps.anl.gov
> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
> Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit


More information about the Ifeffit mailing list