From b26c93520b72c63e6a626b52d6611034f95047ca Mon Sep 17 00:00:00 2001 From: Dustin Lang Date: Fri, 27 May 2016 10:02:48 -0400 Subject: [PATCH] add options to forced_photom_decam to save model & data images --- py/legacypipe/forced_photom_decam.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/py/legacypipe/forced_photom_decam.py b/py/legacypipe/forced_photom_decam.py index 142e29d82..6807b0853 100644 --- a/py/legacypipe/forced_photom_decam.py +++ b/py/legacypipe/forced_photom_decam.py @@ -38,6 +38,11 @@ def get_parser(): parser.add_argument('--no-forced', dest='forced', action='store_false', help='Do NOT do regular forced photometry? Implies --apphot') + parser.add_argument('--save-model', + help='Compute and save model image?') + parser.add_argument('--save-data', + help='Compute and save model image?') + parser.add_argument('filename',help='Filename OR exposure number.') parser.add_argument('hdu',help='decam-HDU OR CCD name.') parser.add_argument('catfn',help='catalog filename OR "DR1/DR2/DR3".') @@ -339,6 +344,15 @@ def main(survey=None, opt=None): F.writeto(opt.outfn, header=hdr, append=True) print('Wrote', opt.outfn) + if opt.save_model: + print('Getting model image...') + mod = tr.getModelImage(tim) + fitsio.write(opt.save_model, mod) + print('Wrote', opt.save_model) + if opt.save_data: + fitsio.write(opt.save_data, tim.getImage()) + print('Wrote', opt.save_data) + print('Finished forced phot:', Time()-t0) return 0