Skip to content
Open
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
6 changes: 4 additions & 2 deletions Models/ProbabilisticAdvection.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ def ens_forecast(self,
else:
raise Exception('angle_pert_dist must be either normal or vonmises')

pert_motion_field[0, :, :] = pert_abs * np.cos(np.arctan(y / x) + beta_noise)
pert_motion_field[1, :, :] = pert_abs * np.sin(np.arctan(y / x) + beta_noise)
# Use arctan2 for angle calculation to handle all quadrants correctly
base_angle = np.arctan2(y, x)
pert_motion_field[0, :, :] = pert_abs * np.cos(base_angle + beta_noise)
pert_motion_field[1, :, :] = pert_abs * np.sin(base_angle + beta_noise)

yhat_maps = self.extrapolate(self.last_map,
pert_motion_field,
Expand Down