Skip to content

Commit

Permalink
Merge pull request #200 from bfhealy/api-fixes
Browse files Browse the repository at this point in the history
This PR removes code that used only the last character of the input filter for photometry (e.g. r instead of ztfr). It also updates the filename of the light curve plot to fix a FileNotFoundError.
  • Loading branch information
mcoughlin authored Aug 9, 2023
2 parents 11225e4 + ea91ddd commit 1395d61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def run_nmma_model(data_dict):
]
for row in data:
tt = Time(row["mjd"], format="mjd").isot
filt = row["filter"][-1]
filt = row["filter"]
mag = row["mag"]
magerr = row["magerr"]
f.write(f"{tt} {filt} {mag} {magerr}\n")
Expand Down Expand Up @@ -241,7 +241,7 @@ def run_nmma_model(data_dict):
suffix=".png", prefix="nmmaplot_", delete=False
)
f.close()
plot_file = os.path.join(plotdir, "lightcurves.png")
plot_file = os.path.join(plotdir, f"{cand_name}_{source}_lightcurves.png")
plot_data = base64.b64encode(open(plot_file, "rb").read()).decode()
local_temp_files.append(f.name)

Expand Down

0 comments on commit 1395d61

Please sign in to comment.