diff --git a/bilby_pipe/input.py b/bilby_pipe/input.py index 4a1906c291d8fcba42ecd353bbe0d04875905252..1d57f7620940ae23ab69af0ca13f17c22545673a 100644 --- a/bilby_pipe/input.py +++ b/bilby_pipe/input.py @@ -1046,7 +1046,7 @@ class Input(object): self, "likelihood_lookup_table" ) - if self.likelihood_type == "GravitationalWaveTransient": + if self.likelihood_type in ["GravitationalWaveTransient", "zero"]: Likelihood = bilby.gw.likelihood.GravitationalWaveTransient likelihood_kwargs.update(jitter_time=self.jitter_time) @@ -1085,7 +1085,14 @@ class Input(object): f"Initialise likelihood {Likelihood} with kwargs: \n{likelihood_kwargs}" ) - return Likelihood(**likelihood_kwargs) + likelihood = Likelihood(**likelihood_kwargs) + + # If requested, use a zero likelihood: for testing purposes + if self.likelihood_type == "zero": + logger.info("Using a ZeroLikelihood") + likelihood = bilby.core.likelihood.ZeroLikelihood(likelihood) + + return likelihood @property def extra_likelihood_kwargs(self): diff --git a/bilby_pipe/parser.py b/bilby_pipe/parser.py index 1157f55ebf4725acc1493cd90cab243987c0c6b6..875a716dd448fd9895da84a8fb94f9288ee2b094 100644 --- a/bilby_pipe/parser.py +++ b/bilby_pipe/parser.py @@ -618,9 +618,12 @@ def create_parser(top_level=True): default="GravitationalWaveTransient", help=( "The likelihood. Can be one of [GravitationalWaveTransient, " - "ROQGravitationalWaveTransient] or python path to a bilby " + "ROQGravitationalWaveTransient, zero] or python path to a bilby " "likelihood class available in the users installation. " - "Need to specify --roq-folder if ROQ likelihood used" + "The --roq-folder is required if the ROQ likelihood used." + "The --roq-folder is required if the ROQ likelihood used." + "If `zero` is given, a testing ZeroLikelihood is used which always" + "return zero." ), ) likelihood_parser.add(