diff --git a/pycbc/waveform/waveform.py b/pycbc/waveform/waveform.py index 7e2ec92a1ea..ca0e822aff4 100644 --- a/pycbc/waveform/waveform.py +++ b/pycbc/waveform/waveform.py @@ -658,12 +658,12 @@ def get_td_waveform(template=None, **kwargs): modes_to_use=input_params.get("modes_to_use", []) ) if len(esigma_params["modes_to_use"]) == 0: - if esigma_params["merger_ringdown_approximant"] == "SEOBNRv4PHM": + if not input_params["approximant"].endswith("HM"): + esigma_params["modes_to_use"] = [(2, 2)] + elif esigma_params["merger_ringdown_approximant"] == "SEOBNRv4PHM": esigma_params["modes_to_use"] = [(2, 2), (2, 1), (3, 3), (4, 4)] elif esigma_params["merger_ringdown_approximant"] == "NRSur7dq4": esigma_params["modes_to_use"] = [(2, 2), (2, 1), (3, 3), (3, 2), (4, 4), (4, 3)] - if not input_params["approximant"].endswith("HM"): - esigma_params["modes_to_use"] = [(2, 2)] try: if "IMRESIGMA" in input_params["approximant"]: @@ -672,12 +672,14 @@ def get_td_waveform(template=None, **kwargs): hp, hc = esigma_utils.get_inspiral_esigma_waveform(**esigma_params) if hp is None or hc is None: raise IOError( - f"Approximant {input_params['approximant']} not supported" + f"""Approximant {input_params['approximant']} not supported. +Parameters: {esigma_params}""" ) return hp, hc except Exception as exc: try: - print(f"Going to generate ESIGMA with SEOBNRv4PHM, Modes used: (2,2), (2,1), (3,3), (4,4)") + print(f"""Going to generate ESIGMA with SEOBNRv4PHM, +Modes used: (2,2), (2,1), (3,3), (4,4)""") esigma_params["merger_ringdown_approximant"] = "SEOBNRv4PHM" if input_params["approximant"] == "IMRESIGMAHM": esigma_params["modes_to_use"] = [(2, 2), (2, 1), (3, 3), (4, 4)]