From d813b7dcf9972f44715a543626cb6d40a8bdd144 Mon Sep 17 00:00:00 2001 From: Sasha Rahlin Date: Tue, 5 Sep 2023 16:28:00 -0500 Subject: [PATCH] optionally disable weights check --- maps/bin/spt3g-coadd-maps | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/maps/bin/spt3g-coadd-maps b/maps/bin/spt3g-coadd-maps index 146b2e20..b8f05e71 100644 --- a/maps/bin/spt3g-coadd-maps +++ b/maps/bin/spt3g-coadd-maps @@ -16,6 +16,12 @@ P.add_argument( help="Id's of map frames to include in the coadd. If not set, all map frames are included.", ) P.add_argument("-i", "--output-map-id", help="Id for output coadd map frame") +P.add_argument( + "-w", + "--weighted", + action="store_true", + help="Ensure that weights are applied before coadding.", +) args = P.parse_args() @@ -30,11 +36,13 @@ pipe.Add(core.G3Reader, filename=args.inputs) pipe.Add(lambda fr: fr.type == core.G3FrameType.Map) # build coadded map with consistently handled weights -pipe.Add(maps.ApplyWeights) +if args.weighted: + pipe.Add(maps.ApplyWeights) pipe.Add( maps.CoaddMaps, map_ids=args.map_ids, output_map_id=args.output_map_id, + ensure_weighted_maps=False, ) pipe.Add(lambda fr: "Id" not in fr or fr["Id"] == args.output_map_id)