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 dark1b/bright1b #468

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
67 changes: 39 additions & 28 deletions bin/fba_launch
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ goaltimes_all = {
"sv1": {"DARK": 1000.0, "BRIGHT": 150.0, "BACKUP": 30.0},
"sv2": {"DARK": 1000.0, "BRIGHT": 150.0, "BACKUP": 30.0},
"sv3": {"DARK": 1200.0, "BRIGHT": 220.0, "BACKUP": 30.0},
"main": {"DARK": 1000.0, "BRIGHT": 180.0, "BACKUP": 60.0},
"main": {"DARK": 1000.0, "DARK1B": 1000.0, "BRIGHT": 180.0, "BRIGHT1B": 180.0, "BACKUP": 60.0},
}

# AR surface brightness profile to be used for computing time -> efftime relation
sbprofs_all = {
"sv1": {"DARK": "ELG", "BRIGHT": "BGS", "BACKUP": "PSF"},
"sv2": {"DARK": "ELG", "BRIGHT": "BGS", "BACKUP": "PSF"},
"sv3": {"DARK": "ELG", "BRIGHT": "BGS", "BACKUP": "PSF"},
"main": {"DARK": "ELG", "BRIGHT": "BGS", "BACKUP": "PSF"},
"main": {"DARK": "ELG", "DARK1B": "ELG", "BRIGHT": "BGS", "BRIGHT1B": "BGS", "BACKUP": "PSF"},
}

# AR minimum exposure time fraction needed for this tile to be considered done
Expand Down Expand Up @@ -190,7 +190,7 @@ def main():
)

# AR obscon : for the tile observing conditions, permissive value
obscon = "DARK|GRAY|BRIGHT|BACKUP"
obscon = "DARK|DARK1B|GRAY|BRIGHT|BRIGHT1B|BACKUP"
log.info("{:.1f}s\tsettings\ttile obscon={}".format(time() - start, obscon))

# AR desitarget folders/files
Expand Down Expand Up @@ -293,27 +293,38 @@ def main():
# AR if not backup
if ("scnd" in steps):
if ("scnd" in list(mydirs.keys())):
targdirs = [mydirs["scnd"]]
for key in sorted(list(mydirs.keys())):
if (key[:4] == "scnd") & (key != "scnd") & (key != "scndmtl"):
targdirs.append(mydirs[key])
create_mtl(
mytmpouts["tiles"],
mydirs["scndmtl"],
args.mtltime,
targdirs,
args.survey,
args.gaiadr.replace("gaia", ""),
args.pmcorr,
mytmpouts["scnd"],
tmpoutdir=tmpoutdir,
pmtime_utc_str=args.pmtime_utc_str,
log=log,
step="scnd",
start=start,
)
# AR handle dark1b/bright1b, where there is no secondary for now
# AR but could be in the future
# AR assume here that if there are some secondary, the ledgers should be there
if not os.path.isdir(mydirs["scndmtl"]):
expected_files["scnd"] = False
log.info("")
log.info("")
log.info("{:.1f}s\tscnd\tno secondary ledgers {}".format(time() - start, mydirs["scndmtl"]))
else:
targdirs = [mydirs["scnd"]]
for key in sorted(list(mydirs.keys())):
if (key[:4] == "scnd") & (key != "scnd") & (key != "scndmtl"):
targdirs.append(mydirs[key])
create_mtl(
mytmpouts["tiles"],
mydirs["scndmtl"],
args.mtltime,
targdirs,
args.survey,
args.gaiadr.replace("gaia", ""),
args.pmcorr,
mytmpouts["scnd"],
tmpoutdir=tmpoutdir,
pmtime_utc_str=args.pmtime_utc_str,
log=log,
step="scnd",
start=start,
)
else:
expected_files["scnd"] = False
log.info("")
log.info("")
log.info("{:.1f}s\tscnd\tno secondary here".format(time() - start))
else:
log.info("")
Expand Down Expand Up @@ -530,11 +541,11 @@ if __name__ == "__main__":
type=str,
default=None,
required=True,
choices=["DARK", "BRIGHT", "BACKUP"],
choices=["DARK", "DARK1B", "BRIGHT", "BRIGHT1B", "BACKUP"],
)
parser.add_argument(
"--goaltype",
help="goaltype (default=args.program)",
help="goaltype (default=args.program, without '1B')",
type=str,
default=None,
required=False,
Expand All @@ -546,7 +557,7 @@ if __name__ == "__main__":
", ".join(
[
"{}={}".format(key, goaltimes_all["main"][key])
for key in ["DARK", "BRIGHT", "BACKUP"]
for key in ["DARK", "DARK1B", "BRIGHT", "BRIGHT1B", "BACKUP"]
]
)
),
Expand All @@ -560,7 +571,7 @@ if __name__ == "__main__":
", ".join(
[
"{}={}".format(key, sbprofs_all["main"][key])
for key in ["DARK", "BRIGHT", "BACKUP"]
for key in ["DARK", "DARK1B", "BRIGHT", "BRIGHT1B", "BACKUP"]
]
)
),
Expand Down Expand Up @@ -766,9 +777,9 @@ if __name__ == "__main__":
# AR mtltime (2021-09-01): if set to None, now setting it inside main()
# AR so that it is recorded in the fiberassign-TILEID.log file

# AR goaltype
# AR goaltype (DARK1B->DARK, BRIGHT1B->BRIGHT)
if args.goaltype is None:
args.goaltype = args.program
args.goaltype = args.program.replace("1B", "")

# AR goaltime
if args.goaltime is None:
Expand Down
11 changes: 10 additions & 1 deletion py/fiberassign/assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,10 @@ def merge_results_tile_initialize(tgbufs, tgdtypes, tgshapes, skybufs,
('SUBPRIORITY', '>f8'),
('OBSCONDITIONS', '>i8'),
('PRIORITY_INIT', '>i8'),
('NUMOBS_INIT', '>i8')
('NUMOBS_INIT', '>i8'),
('MTL_HIGHEST', '>i4'),
('MTL_WANTED', '>i4'),
('MTL_CONTAINS', '>i4'),
])

merged_fiberassign_swap = {
Expand Down Expand Up @@ -1031,6 +1034,9 @@ def merge_results_tile_initialize(tgbufs, tgdtypes, tgshapes, skybufs,
("PRIORITY", "i4"),
("SUBPRIORITY", "f8"),
("OBSCONDITIONS", "i4"),
("MTL_HIGHEST", ">i4"),
("MTL_WANTED", ">i4"),
("MTL_CONTAINS", ">i4"),
])
# Columns that should appear at the end of the table.
merged_fiberassign_req_columns_at_end = OrderedDict([
Expand Down Expand Up @@ -1081,6 +1087,9 @@ def merge_results_tile_initialize(tgbufs, tgdtypes, tgshapes, skybufs,
("OBSCONDITIONS", "i4"),
#("PLATE_RA", "f8"),
#("PLATE_DEC", "f8"),
("MTL_HIGHEST", ">i4"),
("MTL_WANTED", ">i4"),
("MTL_CONTAINS", ">i4"),
])

merged_potential_columns = OrderedDict([
Expand Down
Loading
Loading