bruceravel / demeter

Process and analyze X-ray Absorption Spectroscopy data using Feff and either Larch or Ifeffit.
http://bruceravel.github.io/demeter
Other
67 stars 32 forks source link

bad XDI data file saved from Peak Fit #53

Closed newville closed 6 years ago

newville commented 6 years ago

a user asked about trouble reading an XDI ".peak" file save from Athena's Peak Fitting tool (Athena 09.26, Windows). The problem ends up being with formatting numbers less than 1e-100, which get rendered as

  0.83011530E-91 
  0.21067489E-95 
  0.41070170-100

(I can send a complete file if that would help).

I looked and could find where the headers get formatted, but couldn't quite figure out where the arrays are formatted. I don't know if that is Perl-on-Windows specific, or intrinsic to sprintf() or what.

bruceravel commented 6 years ago

The columns get written with write_ascii when using Larch and write_data when using ifeffit.

The way this works is, I suppose, confusing, but this line calls one of the file output templates. Here's the Larch save template. Demeter gathers up the XDI headers and stuffs them into the "headers" argument. The data columns are the two lines above that. The perl-y bit of line noise at the top of the template file gathers up the arrays containing the individual line shapes.

So, unless convinced otherwise, I think this is a Larch problem, not a Demeter problem.

newville commented 6 years ago

@bruceravel OK... The user reporting this was on Windows and must have been using Ifeffit.

I cannot get Larch's write_ascii() to make that mistake: it will write 0.000

But I did just reproduce it with Ifeffit. Can we bury it yet?

bruceravel commented 6 years ago

:smiley: Does seem like an ifeffit-y problem.

I am pretty sure that Athena will start up with Larch if available. I haven't installed Larch on a Win machine yet, so I don't knwo from personal experience.

I'm going to close this....