Skip to content

Commit

Permalink
use desispec.io.util.replace_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Apr 1, 2024
1 parent 0e7c3bd commit b966fe0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py/desispec/scripts/qsoqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ def save_dataframe_to_fits(dataframe, filename, DESI_TARGET, clobber=True):


def main(args=None, comm=None):
from desispec.io.util import replace_prefix

log = get_logger()

if not isinstance(args, argparse.Namespace):
Expand All @@ -443,18 +445,16 @@ def main(args=None, comm=None):
# param for the new run of RR
param_RR = {'templates_filename': args.templates}

coadddir = os.path.dirname(args.coadd)
coaddfile = os.path.basename(args.coadd)
if args.filename_priors is None:
param_RR['filename_priors'] = os.path.join(coadddir, coaddfile.replace('coadd', 'priors-tmp'))
param_RR['filename_priors'] = replace_prefix(args.coadd, 'coadd', 'priors-tmp')
else:
param_RR['filename_priors'] = args.filename_priors
if args.filename_output_rerun_RR is None:
param_RR['filename_output_rerun_RR'] = os.path.join(coadddir, coaddfile.replace('coadd', 'rrdetails-tmp'))
param_RR['filename_output_rerun_RR'] = replace_prefix(args.coadd, 'coadd', 'rrdetails-tmp')
else:
param_RR['filename_output_rerun_RR'] = args.filename_output_rerun_RR
if (args.filename_redrock_rerun_RR is None):
param_RR['filename_redrock_rerun_RR'] = os.path.join(coadddir, coaddfile.replace('coadd', 'redrock-tmp'))
param_RR['filename_redrock_rerun_RR'] = replace_prefix(args.coadd, 'coadd', 'redrock-tmp')
else:
param_RR['filename_redrock_rerun_RR'] = args.filename_redrock_rerun_RR
param_RR['delete_RR_output'] = args.delete_RR_output
Expand Down

0 comments on commit b966fe0

Please sign in to comment.