The algorithm in LoadAscii2 seems to have some problems (or seems to have at least uncovered some problems) related to reading instrument definition files. In an attempt to not-reinvent-the-wheel, I have created a local directory in the Mantid installation directory, and then I have copied over various existing instrument definition files (and the Schema directory, as well).
Symptom:
(1) If I merely copy the IDF from the ‘instrument’ folder to my local folder, when I use Workspace → Load → File, the IDF loads correctly.
(2) If I make changes to the IDF, as long as I maintain the correct format as defined under the Instrument Definition File wiki, I am able to create any geometry I like, save the file (with the original filename) and the IDF loads correctly.
(3) If I attempt to copy my newly created IDF (the one from (2) above) into a new blank text file, save it as xml, and attempt to load it, I receive the error code below.
(4) If I attempt to rename the original IDF (from (1) above) to anything else, I receive the error code below.
Error Code:
Failed to read as ASCII this file: 'D:\MantidInstall\local_inst\something.xml, error description: No valid data in file, check separator settings or number of columns per bin.
Error in execution of algorithm LoadAscii:
Failed to recognize this file as an ASCII file, cannot continue.
Error in execution of algorithm Load:
Failed to recognize this file as an ASCII file, cannot continue.
What I have Done:
-
I converted the Windows CR/LF to LF. No differences.
-
I converted \tabs to spaces. No difference.
-
I used the Windows command line utility [fc original.xml renamed.xml] and [fc /b original.xml renamed.xml]. Both indicated the files are identical (/b == binary file compare).
I am using Windows 10 (but also on my Mac running Yosemite) and have received the errors on both. These errors occurred on both 3.10 and 3.8 versions of Mantid (Windows) and version 3.8 (OSX).
Looking at the source, it seems that header parsing throws its exception in the vicinity of line 400 of LoadAscii2.cpp; ‘numCols’ isn’t getting the proper value. I cannot understand why renaming a file locally would cause the problems I’m encountering, however…
Is there some sort of registry where IDF’s names and versions get stored? Any advice?
Peter