diff --git a/indica/readers/read_st40.py b/indica/readers/read_st40.py index 8b6539b2..bcd2c577 100644 --- a/indica/readers/read_st40.py +++ b/indica/readers/read_st40.py @@ -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: @@ -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}")