@@ -998,6 +998,7 @@ def find_latest_prenight_sim_for_nights(
998
998
first_day_obs : str | None = None ,
999
999
last_day_obs : str | None = None ,
1000
1000
tags : tuple [str ] = ("ideal" , "nominal" ),
1001
+ telescope : str = "simonyi" ,
1001
1002
max_simulation_age : int = 2 ,
1002
1003
archive_uri : str = "s3://rubin:rubin-scheduler-prenight/opsim/" ,
1003
1004
compilation_uri : str = "s3://rubin:rubin-scheduler-prenight/opsim/compiled_metadata_cache.h5" ,
@@ -1015,6 +1016,9 @@ def find_latest_prenight_sim_for_nights(
1015
1016
tags : `tuple[str]`
1016
1017
A tuple of tags to filter simulations by.
1017
1018
Defaults to ``('ideal', 'nominal')``.
1019
+ telescope : `str`
1020
+ The telescope to search for (simonyi or auxtel).
1021
+ Defaults to simonyi.
1018
1022
max_simulation_age : `int`
1019
1023
The maximum age of simulations to consider, in days.
1020
1024
Simulations older than ``max_simulation_age`` will not be considered.
@@ -1053,6 +1057,8 @@ def find_latest_prenight_sim_for_nights(
1053
1057
continue
1054
1058
if sim ["simulated_dates" ]["last" ] < last_day_obs :
1055
1059
continue
1060
+ if "telescope" in sim and sim ["telescope" ].lower () != telescope .lower ():
1061
+ continue
1056
1062
if not set (tags ).issubset (sim ["tags" ]):
1057
1063
continue
1058
1064
if best_sim is not None :
@@ -1080,6 +1086,7 @@ def fetch_latest_prenight_sim_for_nights(
1080
1086
first_day_obs : str | None = None ,
1081
1087
last_day_obs : str | None = None ,
1082
1088
tags : tuple [str ] = ("ideal" , "nominal" ),
1089
+ telescope : str = "simonyi" ,
1083
1090
max_simulation_age : int = 2 ,
1084
1091
archive_uri : str = "s3://rubin:rubin-scheduler-prenight/opsim/" ,
1085
1092
compilation_uri : str = "s3://rubin:rubin-scheduler-prenight/opsim/compiled_metadata_cache.h5" ,
@@ -1099,6 +1106,9 @@ def fetch_latest_prenight_sim_for_nights(
1099
1106
tags : `tuple[str]`
1100
1107
A tuple of tags to filter simulations by.
1101
1108
Defaults to ``('ideal', 'nominal')``.
1109
+ telescope : `str`
1110
+ The telescope to get sims for, "simonyi" or "auxtel".
1111
+ Defaults to "simonyi".
1102
1112
max_simulation_age : `int`
1103
1113
The maximum age of simulations to consider, in days. Simulations older
1104
1114
than ``max_simulation_age`` will not be considered. Defaults to 2.
@@ -1119,7 +1129,7 @@ def fetch_latest_prenight_sim_for_nights(
1119
1129
"""
1120
1130
1121
1131
sim_metadata = find_latest_prenight_sim_for_nights (
1122
- first_day_obs , last_day_obs , tags , max_simulation_age , archive_uri , compilation_uri
1132
+ first_day_obs , last_day_obs , tags , telescope , max_simulation_age , archive_uri , compilation_uri
1123
1133
)
1124
1134
if sim_metadata is None :
1125
1135
LOGGER .info ("No simulations meet requested criteria." )
@@ -1132,7 +1142,9 @@ def fetch_latest_prenight_sim_for_nights(
1132
1142
return result
1133
1143
1134
1144
1135
- def fetch_obsloctap_visits (day_obs : str | None = None , nights : int = 2 ) -> pd .DataFrame :
1145
+ def fetch_obsloctap_visits (
1146
+ day_obs : str | None = None , nights : int = 2 , telescope : str = "simonyi"
1147
+ ) -> pd .DataFrame :
1136
1148
"""Return visits from latest nominal prenight briefing simulation.
1137
1149
1138
1150
Parameters
@@ -1143,6 +1155,9 @@ def fetch_obsloctap_visits(day_obs: str | None = None, nights: int = 2) -> pd.Da
1143
1155
nights : `int`
1144
1156
The number of nights of observations to return.
1145
1157
Defaults to 2.
1158
+ telescope : `str`
1159
+ The telescope to get visits for: "simonyi" or "auxtel".
1160
+ Defaults to "simonyi".
1146
1161
1147
1162
Returns
1148
1163
-------
@@ -1182,6 +1197,7 @@ def fetch_obsloctap_visits(day_obs: str | None = None, nights: int = 2) -> pd.Da
1182
1197
first_day_obs ,
1183
1198
last_day_obs ,
1184
1199
tags = ("ideal" , "nominal" ),
1200
+ telescope = telescope ,
1185
1201
max_simulation_age = max_simulation_age ,
1186
1202
sqlconstraint = sqlconstraint ,
1187
1203
dbcols = dbcols ,
0 commit comments