Stat file: OPAL version at the end of the header
In ROGER, we search for "OPAL " that is written at the end of the header in order to parse the stat file. So, ROGER expects something like:
&data mode=ascii, no_row_counts=1 &end 8 OPAL 1.5.00.1 git rev. 2a9d889cc345b2130f9d7171dae4ba915805cf07
With the new OPAL module (OPAL/1.5.1-20170217), this is the string stored in the stat file
&data mode=ascii, no_row_counts=1 &end 8 IPPL 1.1.4 git rev.
ROGER returns an error and it does not read properly the stat file.
This is an error, Matthias can you track that down please ...
First of all ROGER should parse the SDDS header properly. The header finishes with the line &data ... &end . The next X lines are the X parameters defined earlier in the header.
The file config.h exists both in IPPL and OPAL. Change the name of the OPAL file to OPALconfig.h in the src/CMakeLists.txt. I have done this already for the master in commit 595b4b83 .
Then this change did not made it into the new module Valeria's using.
No, this was part of my "OPAL3D" commit". I'm applying the changes now to OPAL-1.6 as well.
Ah, ok. ROGER btw already parses the header according to "column" and "parameter" lines. I changed it now such that it is also checks for "data" and "description" lines. However, we do not use boost::spirit or something similar. We parse with std::getline (I know it's not the nicest solution). Thus, we depend somehow on the structure of the file. I.e. after parsing the header we now just skip 2 lines -- instead of checking for the string "OPAL" -- because we can't just go for numbers due to the number after the last "&end" line. And again: I know it's not a really nice solution.
Well, you'll run into problems, when you switch to version >= 1.9. There the header has the form
¶meter name=revision, type=string, description="git revision of opal" &end &column name=t, type=double, units=ns, description="1 Time" &end &data mode=ascii, no_row_counts=1 &end
For every '¶meter', '&column' and '&data' you should read in lines until you find '&end'.
Furthermore you shouldn't hard code 2 lines for the parameters but count how many parameters are in the file. Currently there are 2 parameters with future versions there are at least 3.
Have a look at the function readStatHeader in the file tools.py for how I have adapted it to read in the new version. Just ask if you have any questions concerning the SDDS file format.
closedToggle commit list