Skip to content

Commit

Permalink
ENH delete lists
Browse files Browse the repository at this point in the history
  • Loading branch information
sidneymau committed Jan 12, 2024
1 parent 7203111 commit 4d1c43f
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions eastlake/steps/delete_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,67 @@ def execute(self, stash, new_params=None):
)
safe_rm(psf_link)

self.logger.error("deleting %s-band psfmap for %s" % (band, tilename))
pmap_fn = os.path.join(
base_dir, stash["desrun"], tilename,
f"{tilename}_{band}_psfmap-{stash['desrun']}.dat"
)
safe_rm(pmap_fn)

self.logger.error("deleting %s-band lists for %s" % (band, tilename))
fileconf = os.path.join(
base_dir, stash["desrun"], tilename, f"lists-{band}",
f"{tilename}_{band}_fileconf-{stash['desrun']}.yaml"
)
safe_rm(fileconf)
for listdir in ["lists", f"lists-{band}"]:
bkg_flist = os.path.join(
base_dir, stash["desrun"], tilename, listdir,
f"{tilename}_{band}_bkg-flist-{stash['desrun']}.dat"
)
finalcut = os.path.join(
base_dir, stash["desrun"], tilename, listdir,
f"{tilename}_{band}_finalcut-flist-{stash['desrun']}.dat"
)
nullwt = os.path.join(
base_dir, stash["desrun"], tilename, listdir,
f"{tilename}_{band}_nullwt-flist-{stash['desrun']}.dat"
)
nwgint = os.path.join(
base_dir, stash["desrun"], tilename, listdir,
f"{tilename}_{band}_nwgint-flist-{stash['desrun']}.dat"
)
piff = os.path.join(
base_dir, stash["desrun"], tilename, listdir,
f"{tilename}_{band}_piff-flist-{stash['desrun']}.dat"
)
psf = os.path.join(
base_dir, stash["desrun"], tilename, listdir,
f"{tilename}_{band}_psf-flist-{stash['desrun']}.dat"
)
seg = os.path.join(
base_dir, stash["desrun"], tilename, listdir,
f"{tilename}_{band}_seg-flist-{stash['desrun']}.dat"
)
safe_rm(bkg_flist)
safe_rm(finalcut)
safe_rm(nullwt)
safe_rm(nwgint)
safe_rm(piff)
safe_rm(psf)
safe_rm(seg)

psf_path = os.path.join(
base_dir, stash["desrun"], tilename, "psfs",
)
safe_rmdir(psf_path)

pmap_fn = os.path.join(
base_dir, stash["desrun"], tilename,
f"{tilename}_all_psfmap.dat"
)
safe_rm(pmap_fn)

self.logger.error("deleting empty dirs")

tile_path = os.path.join(base_dir, stash["desrun"], tilename)
Expand Down

0 comments on commit 4d1c43f

Please sign in to comment.