Skip to content

Commit

Permalink
Fixed small bug in _nowcast_main
Browse files Browse the repository at this point in the history
  • Loading branch information
sidekock committed Oct 9, 2024
1 parent eb33c06 commit a1ce4bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pysteps/nowcasts/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ def _nowcast_main(self):
Main nowcast loop that iterates through the ensemble members and time steps
to generate forecasts.
"""
# Prepare state and params dictionaries
state = self._initialize_state()
params = self._initialize_params()

# Isolate the last time slice of precipitation
precip = self.precip[-1, :, :] # Extract the last available precipitation field

# Prepare state and params dictionaries
state = self._initialize_state()
params = self._initialize_params(precip)

print("Starting nowcast computation.")

# Run the nowcast main loop
Expand Down Expand Up @@ -662,7 +662,7 @@ def _initialize_state(self):
"randgen_prec": self.randgen_prec,
}

def _initialize_params(self):
def _initialize_params(self, precip):
"""
Initialize the params dictionary used during the nowcast iteration.
"""
Expand All @@ -684,7 +684,7 @@ def _initialize_params(self):
"phi": self.phi,
"pert_gen": self.pert_gen,
"probmatching_method": self.probmatching_method,
"precip": self.precip,
"precip": precip,
"precip_thr": self.precip_thr,
"recomp_method": self.recomp_method,
"struct": self.struct,
Expand Down

0 comments on commit a1ce4bc

Please sign in to comment.