Skip to content

Commit

Permalink
bug revealed by scan with just 1 station
Browse files Browse the repository at this point in the history
  • Loading branch information
wumpus committed Mar 12, 2022
1 parent ed8a841 commit 5dc1f9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/lindy.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ def xyz2loc(xyz):
for b in a['SCHED'].values(): # does not necessarily loop in order!
time = pd.Timestamp(datetime.datetime.strptime(b['start'], fmt_in))
dtimes = days + np.mod(time.value + Dns//4, Dns) - Dns//4
stations = set(c[0].replace('Ax', 'Aa').replace('Mm', 'Sw') for c in b['station'])
try:
stations = set(c[0].replace('Ax', 'Aa').replace('Mm', 'Sw') for c in b['station'])
except IndexError:
# when there is only 1 station in a scan, the data structure is just a list instead of a list of lists
stations = {b['station'][0].replace('Ax', 'Aa').replace('Mm', 'Sw')}
try:
taus = np.array([allint[s][gfs_cycle](dtimes) for s in stations])
except KeyError:
Expand Down

0 comments on commit 5dc1f9f

Please sign in to comment.