Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge_psf option to not include input psf #2320

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions bin/desi_merge_psf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ parser.add_argument('-o','--outfile', type = str, default = None, required=True,

args = parser.parse_args()

merge_psf(args.infiles,args.outfile)


merge_psf(args.infiles[0],args.infiles[1:],args.outfile)
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
Loading