Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read_st40 revisions bug fix #290

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading