Skip to content

Commit

Permalink
move tracking of input files to coadder
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Sep 6, 2023
1 parent 9901a2b commit fdf7227
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions maps/python/map_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,19 @@ def __call__(self, frame):
map_ids += [map_id]
cfr["InputMapIds"] = core.G3VectorString(map_ids)

if "InputFiles" in cfr:
input_files = list(cfr.pop("InputFiles"))
else:
input_files = []
if "InputFiles" in frame:
# allow for recursive coadds
input_files += list(frame["InputFiles"])
elif getattr(frame, "filename", None):
if frame.filename not in input_files:
input_files += [frame.filename]
if len(input_files):
cfr["InputFiles"] = core.G3VectorString(input_files)

for key in ["T", "Q", "U", "Wpol", "Wunpol"]:
if key not in frame:
continue
Expand Down Expand Up @@ -674,13 +687,6 @@ def coadd_map_files(
)
pipe.Add(coadder)

def RecordInputFiles(frame):
if frame.type != core.G3FrameType.Map:
return
frame["InputFiles"] = core.G3VectorString(input_files)

pipe.Add(RecordInputFiles)

if output_file:
pipe.Add(core.G3Writer, filename=output_file)
pipe.Run()
Expand Down

0 comments on commit fdf7227

Please sign in to comment.