Skip to content

Commit

Permalink
Merge pull request #68 from des-science/delete_sources-patch
Browse files Browse the repository at this point in the history
BUG check if key exists before constructing path to delete
  • Loading branch information
beckermr authored Jan 16, 2024
2 parents 0e47ada + 978b190 commit ea4edcc
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions eastlake/steps/delete_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,12 @@ def execute(self, stash, new_params=None):
self.logger.error("deleting %s-band nullwt links for %s" % (band, tilename))

for sri in pyml["src_info"]:
nullwt_link = os.path.join(
base_dir, stash["desrun"], tilename, f"nullwt-{band}",
os.path.basename(sri["coadd_nwgint_path"])
)
safe_rm(nullwt_link)
if "coadd_nwgint_path" in sri:
nullwt_link = os.path.join(
base_dir, stash["desrun"], tilename, f"nullwt-{band}",
os.path.basename(sri["coadd_nwgint_path"])
)
safe_rm(nullwt_link)

nullwt_path = os.path.join(
base_dir, stash["desrun"], tilename, f"nullwt-{band}",
Expand All @@ -221,11 +222,12 @@ def execute(self, stash, new_params=None):
safe_rm(psf_link)

for sri in pyml["src_info"]:
psf_link = os.path.join(
base_dir, stash["desrun"], tilename, "psfs",
os.path.basename(sri["psf_path"])
)
safe_rm(psf_link)
if "psf_path" in sri:
psf_link = os.path.join(
base_dir, stash["desrun"], tilename, "psfs",
os.path.basename(sri["psf_path"])
)
safe_rm(psf_link)

self.logger.error("deleting %s-band psfmap for %s" % (band, tilename))
pmap_fn = os.path.join(
Expand Down

0 comments on commit ea4edcc

Please sign in to comment.