From a9ad1cdac1ed80193e2fabe4468ccf56e8f6a9f9 Mon Sep 17 00:00:00 2001 From: Michael Coughlin Date: Sun, 14 Apr 2024 16:12:24 -0500 Subject: [PATCH] Return empty segment list if no segments --- gwemopt/segments.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gwemopt/segments.py b/gwemopt/segments.py index 64d8cc6..635e0b7 100644 --- a/gwemopt/segments.py +++ b/gwemopt/segments.py @@ -194,6 +194,11 @@ def get_segments(params, config_struct): def get_segments_tile(config_struct, observatory, radec, segmentlist, airmass): + + # check for empty segmentlist and immediately return + if len(segmentlist) == 0: + return segments.segmentlistdict() + observer = ephem.Observer() observer.lat = str(config_struct["latitude"]) observer.lon = str(config_struct["longitude"])