Skip to content
Snippets Groups Projects
Commit 00c51e85 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Update default gracedb settings

1) Add ROQ for jobs longer than 4s
2) Add no file transfer and check trace plots are made (for testing)
parent 3d2da9b8
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ def read_from_coinc(coinc):
return candidate
def create_config_file(candidate, gracedb, outdir):
def create_config_file(candidate, gracedb, outdir, roq=True):
""" Creates ini file from defaults and candidate contents
Parameters
......@@ -122,6 +122,8 @@ def create_config_file(candidate, gracedb, outdir):
GraceDB id of event
outdir: str
Output directory
roq: bool
If True, use the default ROQ settings if required
Returns
-------
......@@ -163,13 +165,19 @@ def create_config_file(candidate, gracedb, outdir):
prior_file=prior,
duration=duration_lookups[prior],
sampler="dynesty",
sampler_kwargs="{nlive: 1000, walks: 100, n_check_point: 5000}",
sampler_kwargs="{nlive: 1000, walks: 100, check_point_plot=True, n_check_point: 5000}",
create_plots=True,
local_generation=True,
transfer_files=False,
time_marginalization=True,
distance_marginalization=True,
phase_marginalization=True,
)
if roq and config_dict["duration"] > 4:
config_dict["likelihood-type"] = "ROQGravitationalWaveTransient"
config_dict["roq-folder"] = "/home/cbc/ROQ_data/IMRPhenomPv2/{}".format(prior)
filename = "{}.ini".format(config_dict["label"])
write_config_file(config_dict, filename)
......@@ -218,6 +226,9 @@ def main():
group2.add_argument("--local", action="store_true", help="Run the job locally")
group2.add_argument("--submit", action="store_true", help="Submit the job")
parser.add_argument("--outdir", type=str, help="Output directory")
parser.add_argument(
"--roq", action="store_true", help="Use the default ROQ settings if required"
)
parser.add_argument(
"--gracedb-url",
type=str,
......@@ -246,7 +257,7 @@ def main():
check_directory_exists_and_if_not_mkdir(outdir)
candidate = read_from_gracedb(gracedb, gracedb_url, outdir)
filename = create_config_file(candidate, gracedb, outdir)
filename = create_config_file(candidate, gracedb, outdir, roq=args.roq)
arguments = ["bilby_pipe", filename]
if args.local:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment