xraypy/xraylarch

Improved support for 20-ID/20-BM/9-BM data files

Closed this issue · 0 comments

Sometimes larch is not able to parse the metadata headers in a file coming from these beamlines.

For example, this is from a file from a recent experiment:

#  1) Mono Energy (alt) *  11) XSP3:PbLa_Sum        21) XSP3:2:PbLa          

It looks like larch.io.xafs_beamlines.APSXSD_BeamlineData.get_array_labels() splits lines up by the '*' character if it finds it, however in this case that splits the line into ["1) Mono Energy (alt)", "11) XSP3:PbLa_Sum 21) XSP3:2:PbLa"] instead of the correct ["1) Mono Energy (alt)", "11) XSP3:PbLa_Sum", "21) XSP3:2:PbLa"].

I think it should be fairly straightforward to fix by rewriting this function to use regular expressions that reliably describe the data. I'm working on it now and will submit a PR when it's ready. I'll include the broken data file as a test.