Skip to content

Commit

Permalink
Set lower boundary for H (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton authored Jan 21, 2025
1 parent fb710aa commit 10e7445
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions fink_utils/sso/periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,25 @@ def extract_physical_parameters(pdf, flavor):
"""
if flavor == "HG1G2":
bounds = (
[0, 0, 0],
[-3, 0, 0],
[30, 1, 1],
)
p0 = [15.0, 0.15, 0.15]
elif flavor == "HG12":
bounds = (
[0, 0],
[-3, 0],
[30, 1],
)
p0 = [15.0, 0.15]
elif flavor == "HG":
bounds = (
[0, 0],
[-3, 0],
[30, 1],
)
p0 = [15.0, 0.15]
elif flavor == "SHG1G2":
bounds = (
[0, 0, 0, 3e-1, 0, -np.pi / 2],
[-3, 0, 0, 3e-1, 0, -np.pi / 2],
[30, 1, 1, 1, 2 * np.pi, np.pi / 2],
)
p0 = [15.0, 0.15, 0.15, 0.8, np.pi, 0.0]
Expand Down
12 changes: 6 additions & 6 deletions fink_utils/sso/spins.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def estimate_sso_params(
... np.deg2rad(pdf['Phase'].values),
... pdf['i:fid'].values,
... p0=[15.0, 0.15],
... bounds=([0, 0], [30, 1]),
... bounds=([-3, 0], [30, 1]),
... model='HG',
... normalise_to_V=False)
>>> assert len(hg) == 26, "Found {} parameters: {}".format(len(hg), hg)
Expand All @@ -687,7 +687,7 @@ def estimate_sso_params(
... np.deg2rad(pdf['Phase'].values),
... pdf['i:fid'].values,
... p0=[15.0, 0.15],
... bounds=([0, 0], [30, 1]),
... bounds=([-3, 0], [30, 1]),
... model='HG12',
... normalise_to_V=False)
>>> assert len(hg12) == 26, "Found {} parameters: {}".format(len(hg12), hg12)
Expand All @@ -698,7 +698,7 @@ def estimate_sso_params(
... np.deg2rad(pdf['Phase'].values),
... pdf['i:fid'].values,
... p0=[15.0, 0.15, 0.15],
... bounds=([0, 0, 0], [30, 1, 1]),
... bounds=([-3, 0, 0], [30, 1, 1]),
... model='HG1G2',
... normalise_to_V=False)
>>> assert len(hg1g2) == 30, "Found {} parameters: {}".format(len(hg1g2), hg1g2)
Expand Down Expand Up @@ -827,7 +827,7 @@ def fit_legacy_models(
if p0 is None:
p0 = [15, 0.15, 0.15]
if bounds is None:
bounds = ([0, 0, 0], [30, 1, 1])
bounds = ([-3, 0, 0], [30, 1, 1])

if model == "HG1G2":
func = func_hg1g2
Expand Down Expand Up @@ -1020,12 +1020,12 @@ def fit_spin(
if bounds is None:
if model == "SHG1G2":
bounds = (
[0, 0, 0, 3e-1, 0, -np.pi / 2],
[-3, 0, 0, 3e-1, 0, -np.pi / 2],
[30, 1, 1, 1, 2 * np.pi, np.pi / 2],
)
elif model == "SSHG1G2":
bounds = (
[0, 0, 0, 0, -np.pi / 2, 2.2 / 24.0, 1, 1, -np.pi / 2],
[-3, 0, 0, 0, -np.pi / 2, 2.2 / 24.0, 1, 1, -np.pi / 2],
[30, 1, 1, 2 * np.pi, np.pi / 2, 1000, 5, 5, np.pi / 2],
)

Expand Down

0 comments on commit 10e7445

Please sign in to comment.