From 988310414f06bcbb74b2dcc903bc80aece9ac9af Mon Sep 17 00:00:00 2001 From: Marco Sertoli Date: Tue, 3 Oct 2023 12:56:41 +0100 Subject: [PATCH] Fixed bug to read desired revision in ReadST40 wrapper that was affecting the assigned equilibrium. --- indica/readers/read_st40.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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}")