Skip to content

Commit

Permalink
Implement observability thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
weizmannk committed Jan 9, 2024
1 parent ea9bc42 commit bf86dea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gwemopt/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ def run(args=None):
if args.doPlots:
print("Plotting observability...")
plot_observability(params, map_struct)

if args.doObservabilityExit:
for telescope in params["telescopes"]:
if np.sum(observability_struct[telescope]["prob"]) < args.observability_thresh:
print('Observability for %s: %.5f < %.5f... exiting.' % (telescope, np.sum(observability_struct[telescope]["prob"]), args.observability_thresh))

if params["doTrueLocation"]:
lightcurve_structs = gwemopt.lightcurve.read_files(params, params["lightcurveFiles"])
for key in lightcurve_structs.keys():
filename = os.path.join(params["outputDir"],'efficiency_true_' + lightcurve_structs[key]['name'] + '.txt')
fid = open(filename, 'w')
fid.write('0')
fid.close()
exit(0)

if params["splitType"] is not None:
print("Splitting skymap...")
Expand Down

0 comments on commit bf86dea

Please sign in to comment.