From e561c78ad6b4e4da2fafe5a8fb83af05f0b06648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=2E=20M=C3=B8ller?= Date: Mon, 29 Jun 2026 10:09:40 +0200 Subject: [PATCH 1/3] Switch to using np.arctan2 for Probabilistic Advection --- Models/ProbabilisticAdvection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Models/ProbabilisticAdvection.py b/Models/ProbabilisticAdvection.py index ecf667a..f082145 100644 --- a/Models/ProbabilisticAdvection.py +++ b/Models/ProbabilisticAdvection.py @@ -62,8 +62,9 @@ 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) + 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, From 719da6617d4e675cc4d1e7dd864e6d1dc21f5524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=2E=20M=C3=B8ller?= Date: Mon, 29 Jun 2026 11:34:24 +0200 Subject: [PATCH 2/3] Add comment on the use of arctan2 --- Models/ProbabilisticAdvection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Models/ProbabilisticAdvection.py b/Models/ProbabilisticAdvection.py index f082145..87d3875 100644 --- a/Models/ProbabilisticAdvection.py +++ b/Models/ProbabilisticAdvection.py @@ -62,6 +62,7 @@ def ens_forecast(self, else: raise Exception('angle_pert_dist must be either normal or vonmises') + # 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) From 6c5d52bb21f0928b1e2e82074a7b9bfdc7f2c8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=2E=20M=C3=B8ller?= Date: Wed, 8 Jul 2026 13:09:04 +0200 Subject: [PATCH 3/3] Add changelog --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e36aad9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Fixed + +- Switch to using np.arctan2 rather than np.arctan for Probabilistic Advection [#2](https://github.com/dmidk/SolarSTEPS/pull/2), @KristianHMoller +