Parse EPPIC input from the file, returning (dict of global vars, dict of dists).
dict of global vars has {varname: value} for all pairs not inside a distribution.
dict of dists has {N: {varname: value} for all pairs in dist} for each dist;
for each varname in a dist, ensure varname ends with str(N) (append it if necessary).
the N’s will all be stored here as ints.
Notes:
- file formatting:
- semicolons (;) are used for comments. (idl format)
- ignore blank lines & lines that don’t assign a variable (missing ‘=’)
- ignores all leading & trailing whitespace in vars & values.
- special var: “dist{N}”, where N is any integer (or empty string).
- after finding this, start storing lines in result[“dist{dist}”]
- e.g. “dist1=1” –> result[“dist1”][var] = value.
same behavior if “dist=1”.
- additionally, N will be appended to var names if it is not already there,
e.g. “dist1=1”, “var=7” –> result[“dist1”][“var1”] = 7
- if “dist{N}” appears AGAIN, use it as the new dist; store lines in result[“dist{N}”]
- special var: “fndist”
- if found, stop storing lines in result[“dist{dist}”]