Skip to content

Commit

Permalink
Merge pull request #437 from desihub/multiple_toofns
Browse files Browse the repository at this point in the history
handle multiple ToO files
  • Loading branch information
araichoor committed Nov 1, 2022
2 parents 61b8ee3 + 11b8453 commit 559ff09
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 73 deletions.
23 changes: 21 additions & 2 deletions bin/fba_launch
Expand Up @@ -71,6 +71,14 @@ def main():
start = time()
log.info("{:.1f}s\tstart\tTIMESTAMP={}".format(time() - start, Time.now().isot))

# AR if for development, print it big at the beginning
if args.custom_too_development:
log.warning("")
log.warning("\t\t================================================================================================")
log.warning("\t\t================================= THIS IS FOR DEVELOPMENT ONLY =================================")
log.warning("\t\t================================================================================================")
log.warning("")

# AR rundate: if None, set to the latest time
# AR in the latest desi-state*ecsv file
if args.rundate is None:
Expand Down Expand Up @@ -196,6 +204,7 @@ def main():
dr=args.dr,
gaiadr=args.gaiadr,
custom_too_file=args.custom_too_file,
custom_too_development=args.custom_too_development,
log=log,
step="settings",
start=start,
Expand Down Expand Up @@ -316,9 +325,13 @@ def main():
# AR 20210902: setting mjd_min = mjd_max = mjd_now
# AR so that we select: (d["MJD_BEGIN"] < mjd_now) & (d["MJD_END"] > mjd_now)
if "too" in steps:
toofns = mydirs["too"]
for key in sorted(list(mydirs.keys())):
if (key[:3] == "too") & (key != "too"):
toofns += "," + mydirs[key]
expected_files["too"] = create_too(
mytmpouts["tiles"],
mydirs["too"],
toofns,
mjd_now,
mjd_now,
args.survey,
Expand Down Expand Up @@ -716,10 +729,16 @@ if __name__ == "__main__":
)
parser.add_argument(
"--custom_too_file",
help="full path to a custom ToO file, for tertiary program or development work, which overrides the official one (default=None)",
help="full path to a custom ToO file, or a comma-separated list of custom ToO files, for tertiary program or development work, which overrides the official one (default=None)",
type=str,
default=None,
)
parser.add_argument(
"--custom_too_development",
help="is this for development? (allows args.custom_too_file to be outside of $DESI_SURVEYOPS)",
action="store_true",
default=False,
)

args = parser.parse_args()
log = Logger.get()
Expand Down
14 changes: 14 additions & 0 deletions bin/fba_rerun
Expand Up @@ -101,6 +101,20 @@ def main():
):
mydict[key.replace("_", "-")] = val

# AR handling an unlikely case, where we ran fba_launch with --custom_too_tile
# AR on one machine, and executing fba_rerun on another one
# AR (note that we do not expect to execute fba_rerun on special tiles)
# AR this command should correctly change $DESI_SURVEYOPS
elif key == "--custom_too_file":
orig_desiroot = hdr["DESIROOT"]
curr_desiroot = os.getenv("DESI_ROOT")
mydict[key] = ",".join(
[
fn.replace(orig_desiroot, curr_desiroot)
for fn in val.split(",")
]
)

else:

# AR dtver
Expand Down

0 comments on commit 559ff09

Please sign in to comment.