Skip to content

Commit

Permalink
simplify conditionals in calh5 metadata reader
Browse files Browse the repository at this point in the history
  • Loading branch information
bhazelton committed Mar 21, 2024
1 parent 6821713 commit f630da3
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions pyuvdata/uvcal/calh5.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,22 @@ def _read_header(
)
if "time_array" in meta.header:
self.time_array = meta.time_array
if "lst_array" in meta.header:
self.lst_array = meta.header["lst_array"][:]
proc = None
else:
proc = self.set_lsts_from_time_array(
background=background_lsts, astrometry_library=astrometry_library
)
if "time_range" in meta.header:
self.time_range = meta.time_range

if "lst_array" in meta.header:
self.lst_array = meta.header["lst_array"][:]
proc = None
elif "time_array" in meta.header:
proc = self.set_lsts_from_time_array(
background=background_lsts, astrometry_library=astrometry_library
)

if "lst_range" in meta.header:
self.lst_range = meta.header["lst_range"][:]
proc = None
elif "time_range" in meta.header:
proc = self.set_lsts_from_time_array(
background=background_lsts, astrometry_library=astrometry_library
)
if "lst_range" in meta.header:
self.lst_range = meta.header["lst_range"][:]
proc = None
else:
proc = self.set_lsts_from_time_array(
background=background_lsts, astrometry_library=astrometry_library
)

# Required parameters
for attr in [
Expand Down

0 comments on commit f630da3

Please sign in to comment.