Skip to content

Commit

Permalink
Alternative approach
Browse files Browse the repository at this point in the history
since otherwise it complains about the vars not being defined
later
  • Loading branch information
zmoon committed Sep 9, 2024
1 parent c9f2bc6 commit b82d8ee
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/fire_inputgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ def main_driver(initial_hour, forecast_hour, f_input, f_output, lat_lim, lon_lim
lw[lw == 0] = np.nan

# fire frame
INPUTFRAME = LATFRAME = LONFRAME = None
for j in np.arange(1, num + 1, 1):
total = total + 1
index = np.argwhere(lw == j)
Expand Down Expand Up @@ -680,22 +681,10 @@ def main_driver(initial_hour, forecast_hour, f_input, f_output, lat_lim, lon_lim
loc[0] - fsize : loc[0] + fsize + 1, loc[1] - fsize : loc[1] + fsize + 1
]

if "INPUTFRAME" in locals():
INPUTFRAME = np.append(
INPUTFRAME,
np.expand_dims(X_fire, axis=0),
axis=0,
) # noqa: F821
LATFRAME = np.append(
LATFRAME,
np.expand_dims(X_lat, axis=0),
axis=0,
) # noqa: F821
LONFRAME = np.append(
LONFRAME,
np.expand_dims(X_lon, axis=0),
axis=0,
) # noqa: F821
if INPUTFRAME is not None:
INPUTFRAME = np.append(INPUTFRAME, np.expand_dims(X_fire, axis=0), axis=0)
LATFRAME = np.append(LATFRAME, np.expand_dims(X_lat, axis=0), axis=0)
LONFRAME = np.append(LONFRAME, np.expand_dims(X_lon, axis=0), axis=0)
else:
INPUTFRAME = np.expand_dims(X_fire, axis=0)
LATFRAME = np.expand_dims(X_lat, axis=0)
Expand Down

0 comments on commit b82d8ee

Please sign in to comment.