Skip to content

Commit 10e7445

Browse files
Set lower boundary for H (#145)
1 parent fb710aa commit 10e7445

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

fink_utils/sso/periods.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,25 @@ def extract_physical_parameters(pdf, flavor):
5757
"""
5858
if flavor == "HG1G2":
5959
bounds = (
60-
[0, 0, 0],
60+
[-3, 0, 0],
6161
[30, 1, 1],
6262
)
6363
p0 = [15.0, 0.15, 0.15]
6464
elif flavor == "HG12":
6565
bounds = (
66-
[0, 0],
66+
[-3, 0],
6767
[30, 1],
6868
)
6969
p0 = [15.0, 0.15]
7070
elif flavor == "HG":
7171
bounds = (
72-
[0, 0],
72+
[-3, 0],
7373
[30, 1],
7474
)
7575
p0 = [15.0, 0.15]
7676
elif flavor == "SHG1G2":
7777
bounds = (
78-
[0, 0, 0, 3e-1, 0, -np.pi / 2],
78+
[-3, 0, 0, 3e-1, 0, -np.pi / 2],
7979
[30, 1, 1, 1, 2 * np.pi, np.pi / 2],
8080
)
8181
p0 = [15.0, 0.15, 0.15, 0.8, np.pi, 0.0]

fink_utils/sso/spins.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def estimate_sso_params(
676676
... np.deg2rad(pdf['Phase'].values),
677677
... pdf['i:fid'].values,
678678
... p0=[15.0, 0.15],
679-
... bounds=([0, 0], [30, 1]),
679+
... bounds=([-3, 0], [30, 1]),
680680
... model='HG',
681681
... normalise_to_V=False)
682682
>>> assert len(hg) == 26, "Found {} parameters: {}".format(len(hg), hg)
@@ -687,7 +687,7 @@ def estimate_sso_params(
687687
... np.deg2rad(pdf['Phase'].values),
688688
... pdf['i:fid'].values,
689689
... p0=[15.0, 0.15],
690-
... bounds=([0, 0], [30, 1]),
690+
... bounds=([-3, 0], [30, 1]),
691691
... model='HG12',
692692
... normalise_to_V=False)
693693
>>> assert len(hg12) == 26, "Found {} parameters: {}".format(len(hg12), hg12)
@@ -698,7 +698,7 @@ def estimate_sso_params(
698698
... np.deg2rad(pdf['Phase'].values),
699699
... pdf['i:fid'].values,
700700
... p0=[15.0, 0.15, 0.15],
701-
... bounds=([0, 0, 0], [30, 1, 1]),
701+
... bounds=([-3, 0, 0], [30, 1, 1]),
702702
... model='HG1G2',
703703
... normalise_to_V=False)
704704
>>> assert len(hg1g2) == 30, "Found {} parameters: {}".format(len(hg1g2), hg1g2)
@@ -827,7 +827,7 @@ def fit_legacy_models(
827827
if p0 is None:
828828
p0 = [15, 0.15, 0.15]
829829
if bounds is None:
830-
bounds = ([0, 0, 0], [30, 1, 1])
830+
bounds = ([-3, 0, 0], [30, 1, 1])
831831

832832
if model == "HG1G2":
833833
func = func_hg1g2
@@ -1020,12 +1020,12 @@ def fit_spin(
10201020
if bounds is None:
10211021
if model == "SHG1G2":
10221022
bounds = (
1023-
[0, 0, 0, 3e-1, 0, -np.pi / 2],
1023+
[-3, 0, 0, 3e-1, 0, -np.pi / 2],
10241024
[30, 1, 1, 1, 2 * np.pi, np.pi / 2],
10251025
)
10261026
elif model == "SSHG1G2":
10271027
bounds = (
1028-
[0, 0, 0, 0, -np.pi / 2, 2.2 / 24.0, 1, 1, -np.pi / 2],
1028+
[-3, 0, 0, 0, -np.pi / 2, 2.2 / 24.0, 1, 1, -np.pi / 2],
10291029
[30, 1, 1, 2 * np.pi, np.pi / 2, 1000, 5, 5, np.pi / 2],
10301030
)
10311031

0 commit comments

Comments
 (0)