Skip to content

Commit

Permalink
fix insert_row table mismatch in photometry
Browse files Browse the repository at this point in the history
  • Loading branch information
emirkmo committed May 25, 2022
1 parent a2b9c44 commit a2320c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flows/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ def do_phot(fileid: int, cm_timeout: Optional[float] = None, make_plots: bool =
diffimage_df = datafile.get('diffimg', None)
if diffimage_df:
diffimage_path = diffimage_df.get('path', None)
logger.info("Found diffimg: %s, running difference photometry.", diffimage_path)
if diffimage_path is None:
logger.warning("No diffimage present but without path, skipping diffimage photometry")
diffimage = load_image(directories.image_path(diffimage_path), target_coord=target.coords)
Expand All @@ -340,8 +341,8 @@ def do_phot(fileid: int, cm_timeout: Optional[float] = None, make_plots: bool =
# Store the difference image photometry on row 0 of the table.
# This pushes the un-subtracted target photometry to row 1.
clean_references.add_target(target, starid=-1)
psfphot_tbl.insert_row(0, diff_psfphot_tbl[0])
apphot_tbl.insert_row(0, diff_apphot_tbl[0])
psfphot_tbl.insert_row(0, dict(diff_psfphot_tbl[0]))
apphot_tbl.insert_row(0, dict(diff_apphot_tbl[0]))


# TODO: This should be moved to the photometry manager.
Expand Down

0 comments on commit a2320c9

Please sign in to comment.