Skip to content

Commit

Permalink
add option --dont-merge-with-psf-input to desi_proc and --dont-merge-…
Browse files Browse the repository at this point in the history
…with-input to desi_compute_psf
  • Loading branch information
julienguy committed Aug 15, 2024
1 parent d026aa6 commit 050caf4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions py/desispec/scripts/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ def main(args=None, comm=None):
cmd += ' --input-psf {}'.format(inpsf)
cmd += ' --output-psf {}'.format(outpsf)

if args.dont_merge_with_psf_input :
cmd += ' --dont-merge-with-input'

# fibers to ignore for the PSF fit
# specex uses the fiber index in a camera
fibers_to_ignore = badfibers([hdr, camhdr[camera]],["BROKENFIBERS","BADCOLUMNFIBERS"])%500
Expand Down
9 changes: 8 additions & 1 deletion py/desispec/scripts/specex.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def parse(options=None):
help="comma separated list of broken fibers")
parser.add_argument("--disable-merge", action = 'store_true',
help="disable merging fiber bundles")
parser.add_argument("--dont-merge-with-input", action = 'store_true',
help="dont use the input PSF as default when merging bundles")


args = parser.parse_args(options)

Expand Down Expand Up @@ -271,7 +274,11 @@ def main(args=None, comm=None):
time.sleep(5.)

try:
merge_psf(inpsffile, bundlefiles, outfits)
if args.dont_merge_with_input :
log.info("Do not include input PSF when merging bundles")
merge_psf(bundlefiles[0], bundlefiles[1:], outfits)
else :
merge_psf(inpsffile, bundlefiles, outfits)
except Exception as e:
log.error(e)
log.error("merging failed for {}".format(outfits))
Expand Down
1 change: 1 addition & 0 deletions py/desispec/workflow/desi_proc_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def get_shared_desi_proc_parser():
parser.add_argument("--extract-subcomm-size", type=int, default=None, help="Size to use for GPU extract subcomm")
parser.add_argument("--no-gpu", action="store_true", help="Do not use GPU for extractions even if available")
parser.add_argument("--use-specter", action="store_true", help="Use classic specter instead of gpu_specter")
parser.add_argument("--dont-merge-with-psf-input", action="store_true", help="Do not merge with PSF input")
parser.add_argument("--mpistdstars", action="store_true", help="Use MPI parallelism in stdstar fitting instead of multiprocessing")
parser.add_argument("--no-skygradpca", action="store_true", help="Do not fit sky gradient")
parser.add_argument("--no-tpcorrparam", action="store_true", help="Do not apply tpcorrparam spatial model or fit tpcorrparam pca terms")
Expand Down

0 comments on commit 050caf4

Please sign in to comment.