Skip to content

Commit

Permalink
Fixed small toa issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSwainston committed Feb 26, 2024
1 parent 93451b8 commit 7a4fd03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions psrdb/tables/toa.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,18 +324,16 @@ def process(self, args):

with open(args.toa_path, "r") as f:
toa_lines = f.readlines()
for toa_line in toa_lines[1:]:
input_toa_line = toa_line.rstrip("\n")
self.create(
args.pipeline_run_id,
args.ephemeris_id,
args.template_id,
input_toa_line,
args.dm_corrected,
args.minimumNsubs,
args.maximumNsubs,
args.npol,
)
self.create(
args.pipeline_run_id,
args.ephemeris_id,
args.template_id,
input_toa_line,
args.dm_corrected,
args.minimumNsubs,
args.maximumNsubs,
args.npol,
)
elif args.subcommand == "delete":
return self.delete(args.id)
elif args.subcommand == "list":
Expand Down
2 changes: 1 addition & 1 deletion psrdb/utils/toa.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ def toa_dict_to_line(toa_dict):
toa_line = ""
toa_line += f"{toa_dict['archive']} {toa_dict['freq_MHz']:.6f} {toa_dict['mjd']}{toa_dict['mjd_err']:>8.3f} {toa_dict['telescope']} "
for key, value in toa_dict.items():
if key not in ["archive", "freq_MHz", "mjd", "mjd_err", "telescope"]:
if key not in ["archive", "freq_MHz", "mjd", "mjd_err", "telescope"] and value is not None:
toa_line += f" -{key} {value}"
return toa_line

0 comments on commit 7a4fd03

Please sign in to comment.