Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow slight deviation in f_min check #18

Merged
merged 6 commits into from
Aug 23, 2024
Merged

allow slight deviation in f_min check #18

merged 6 commits into from
Aug 23, 2024

Conversation

WuShichao
Copy link
Collaborator

@mj-will This PR avoids too many annoying warnings from the f_min check. The original check will always fail for SOBHB, so I added an update to the condition.

@WuShichao WuShichao requested a review from mj-will June 9, 2024 19:07
@mj-will
Copy link
Contributor

mj-will commented Jun 20, 2024

@WuShichao do these warnings appear more than once per process? I thought when using warnings, they were only print once so there shouldn't be too many.

@WuShichao
Copy link
Collaborator Author

@WuShichao do these warnings appear more than once per process? I thought when using warnings, they were only print once so there shouldn't be too many.

During sampling, warnings show up repeatedly, so I can't easily see the dlogz info from nessai.

@mj-will
Copy link
Contributor

mj-will commented Jun 20, 2024

@WuShichao do these warnings appear more than once per process? I thought when using warnings, they were only print once so there shouldn't be too many.

During sampling, warnings show up repeatedly, so I can't easily see the dlogz info from nessai.

Hmm, I'm confused by that. The following snippet on prints one warning for me:

from pycbc.waveform import get_fd_det_waveform
import numpy as np
params = {}
params["ref_frame"] = "LISA"
params["approximant"] = "BBHX_PhenomD"
params["coa_phase"] = 0.0
params["mass1"] = 1e6
params["mass2"] = 8e5
params["spin1z"] = 0.0
params["spin2z"] = 0.0
params["distance"] = 410
params["inclination"] = np.pi / 2
params["t_obs_start"] = 31536000
params["delta_f"] = 1.0 / params["t_obs_start"]
params["f_lower"] = 1e-5
params["f_ref"] = 8e-4
params["f_final"] = 0.1
params["delta_t"] = 1 / 0.2
params["t_offset"] = 9206958.120016199
params["tc"] = 4799624.274911478
params["eclipticlongitude"] = 0.5
params["eclipticlatitude"] = 0.23
params["polarization"] = 0.1
params["tdi"] = 1.5
for _ in range(4):
    get_fd_det_waveform(ifos=["LISA_A"], **params)

Does it print multiple for you?

@WuShichao
Copy link
Collaborator Author

@WuShichao do these warnings appear more than once per process? I thought when using warnings, they were only print once so there shouldn't be too many.

During sampling, warnings show up repeatedly, so I can't easily see the dlogz info from nessai.

Hmm, I'm confused by that. The following snippet on prints one warning for me:

from pycbc.waveform import get_fd_det_waveform
import numpy as np
params = {}
params["ref_frame"] = "LISA"
params["approximant"] = "BBHX_PhenomD"
params["coa_phase"] = 0.0
params["mass1"] = 1e6
params["mass2"] = 8e5
params["spin1z"] = 0.0
params["spin2z"] = 0.0
params["distance"] = 410
params["inclination"] = np.pi / 2
params["t_obs_start"] = 31536000
params["delta_f"] = 1.0 / params["t_obs_start"]
params["f_lower"] = 1e-5
params["f_ref"] = 8e-4
params["f_final"] = 0.1
params["delta_t"] = 1 / 0.2
params["t_offset"] = 9206958.120016199
params["tc"] = 4799624.274911478
params["eclipticlongitude"] = 0.5
params["eclipticlatitude"] = 0.23
params["polarization"] = 0.1
params["tdi"] = 1.5
for _ in range(4):
    get_fd_det_waveform(ifos=["LISA_A"], **params)

Does it print multiple for you?

In this test case, it only prints once. Can you try a SOBHB in PE?

@mj-will
Copy link
Contributor

mj-will commented Aug 22, 2024

@WuShichao do these warnings appear more than once per process? I thought when using warnings, they were only print once so there shouldn't be too many.

During sampling, warnings show up repeatedly, so I can't easily see the dlogz info from nessai.

Hmm, I'm confused by that. The following snippet on prints one warning for me:

from pycbc.waveform import get_fd_det_waveform
import numpy as np
params = {}
params["ref_frame"] = "LISA"
params["approximant"] = "BBHX_PhenomD"
params["coa_phase"] = 0.0
params["mass1"] = 1e6
params["mass2"] = 8e5
params["spin1z"] = 0.0
params["spin2z"] = 0.0
params["distance"] = 410
params["inclination"] = np.pi / 2
params["t_obs_start"] = 31536000
params["delta_f"] = 1.0 / params["t_obs_start"]
params["f_lower"] = 1e-5
params["f_ref"] = 8e-4
params["f_final"] = 0.1
params["delta_t"] = 1 / 0.2
params["t_offset"] = 9206958.120016199
params["tc"] = 4799624.274911478
params["eclipticlongitude"] = 0.5
params["eclipticlatitude"] = 0.23
params["polarization"] = 0.1
params["tdi"] = 1.5
for _ in range(4):
    get_fd_det_waveform(ifos=["LISA_A"], **params)

Does it print multiple for you?

In this test case, it only prints once. Can you try a SOBHB in PE?

@WuShichao do you have an example you can point me to?

BBHX_Phenom.py Outdated Show resolved Hide resolved
BBHX_Phenom.py Outdated Show resolved Hide resolved
BBHX_Phenom.py Outdated Show resolved Hide resolved
BBHX_Phenom.py Outdated
Comment on lines 286 to 287
if np.abs(f_min - f_min_tobs) / f_min > 1e-2 and enable_flower_warn:
err_msg = f"Input 'f_lower' is significantly deviated from the value calculated from 't_obs_start'."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the old check and just use the boolean, what do you think?

BBHX_Phenom.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mj-will mj-will left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@WuShichao WuShichao merged commit fa2cd4d into main Aug 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants