Skip to content

Commit

Permalink
Fixed bug to read desired revision in ReadST40 wrapper that was affec…
Browse files Browse the repository at this point in the history
…ting the assigned equilibrium. (#290)

Co-authored-by: Marco Sertoli <[email protected]>
  • Loading branch information
marcosertoli and marcosertoli authored Oct 3, 2023
1 parent 0ef4332 commit fb35294
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions indica/readers/read_st40.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ def __call__(
instruments = INSTRUMENTS
if revisions is None:
revisions = {instrument: 0 for instrument in instruments}
for instr in instruments:
if instr not in revisions.keys():
revisions[instr] = 0
if "efit" not in revisions:
revisions["efit"] = 0

if tstart is None:
tstart = self.tstart
if tend is None:
Expand All @@ -326,14 +332,14 @@ def __call__(
dt = self.dt

self.reset_data()
self.get_equilibrium(R_shift=R_shift)
for i, instrument in enumerate(instruments):
self.get_equilibrium(R_shift=R_shift, revision=revisions["efit"])
for instrument in instruments:
print(f"Reading {instrument}")
if debug:
self.get_raw_data("", instrument, revisions[i])
self.get_raw_data("", instrument, revisions[instrument])
else:
try:
self.get_raw_data("", instrument, revisions[i])
self.get_raw_data("", instrument, revisions[instrument])
except Exception as e:
print(f"Error reading {instrument}: {e}")

Expand Down

0 comments on commit fb35294

Please sign in to comment.