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

handle multiple ToO files #437

Merged
merged 4 commits into from Nov 1, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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