Skip to content

Commit 3635e09

Browse files
committed
fix(tslpf): adjusted noise addition logic and corrected baseline handling
- Updated baseline handling to ensure values align with defined thresholds. - Refined noise addition logic.
1 parent 2e7c3c9 commit 3635e09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

exoiris/tslpf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,10 @@ def create_initial_population(self, n: int, source: str, add_noise: bool = True)
734734
else:
735735
pvp = rng.choice(pvs.reshape([-1, self.ndim]), size=n)
736736

737+
if pvp[0, self._sl_baseline][0] < 0.5:
738+
pvp[:, self._sl_baseline] = rng.normal(1.0, 1e-6, size=(n, sum(self.n_baselines)))
739+
737740
if add_noise:
738-
pvp[:, 0] += rng.normal(0, 0.005, size=n)
739-
pvp[:, 1] += rng.normal(0, 0.001, size=n)
740-
pvp[:, 3] += rng.normal(0, 0.005, size=n)
741741
pvp[:, self._sl_rratios] += rng.normal(0, 1, pvp[:, self._sl_rratios].shape) * 0.002 * pvp[:, self._sl_rratios]
742742
pvp[:, self._sl_ld] += rng.normal(0, 1, pvp[:, self._sl_ld].shape) * 0.002 * pvp[:, self._sl_ld]
743743
return pvp

0 commit comments

Comments
 (0)