Skip to content

Commit f574d15

Browse files
authored
Merge pull request #20 from simonsobs/20250724_ref_plan_ver
Update reference plans
2 parents 356757d + 65d9267 commit f574d15

File tree

3 files changed

+49
-53
lines changed

3 files changed

+49
-53
lines changed

src/pages/4_SAT_Schedule_Plan.py

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,12 @@
2424
# dictionary goes dict[elevation][sun_keepout]
2525
schedule_files = {
2626
50 : {
27-
45: os.path.join(
28-
schedule_base_dir,
29-
'20250117_d-40,-10_e50_s0.5,0.8_a45.txt'
30-
),
31-
49: os.path.join(
32-
schedule_base_dir,
33-
'20250117_d-40,-10_e50_s0.5,0.8_a49.txt'
34-
),
27+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e50_t40_s0.5,0.8_a45_j2025-06-15T12:00+00:00_n365.txt'),
28+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e50_t40_s0.5,0.8_a49_j2025-06-15T12:00+00:00_n365.txt'),
3529
},
3630
60 : {
37-
45: os.path.join(
38-
schedule_base_dir,
39-
'20250117_d-40,-10_e60_s0.5,0.8_a45.txt'
40-
),
41-
49: os.path.join(
42-
schedule_base_dir,
43-
'20250117_d-40,-10_e60_s0.5,0.8_a49.txt'
44-
),
31+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a45_j2025-06-15T12:00+00:00_n365.txt'),
32+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a49_j2025-06-15T12:00+00:00_n365.txt'),
4533
}
4634
}
4735

@@ -69,12 +57,12 @@
6957

7058

7159
with right_column:
72-
start_time = st.time_input("Start time (UTC)",
73-
value="now",
60+
start_time = st.time_input("Start time (UTC)",
61+
value="now",
7462
key='start_time'
7563
)
76-
end_time = st.time_input("End time (UTC)",
77-
value="now",
64+
end_time = st.time_input("End time (UTC)",
65+
value="now",
7866
key='end_time'
7967
)
8068

@@ -97,30 +85,31 @@
9785
raise ValueError(f"Schedule file {sfile} does not exist")
9886
print(f"using schedule file {sfile}")
9987
t0_state_file = None
100-
88+
10189
match platform:
10290
case "satp1":
10391
Policy = SATP1Policy
10492
case "satp2":
10593
Policy = SATP2Policy
10694
case "satp3":
10795
Policy = SATP3Policy
108-
96+
10997
cfg = {'apply_boresight_rot': platform != "satp3", }
11098
policy = Policy.from_defaults(
11199
master_file=sfile,
112100
state_file = None,
113101
**cfg
114102
)
115103

116-
seq = policy.init_seqs(t0, t1)
104+
seq = policy.init_cmb_seqs(t0, t1)
105+
seq = policy.init_cal_seqs(None, None, seq, t0, t1)
117106
seq = policy.apply(seq)
118107

119108
data = np.zeros( (0,6))
120109
def block_to_arr(block):
121110
return np.array([
122-
block.t0, block.alt,
123-
block.boresight_angle,
111+
block.t0, block.alt,
112+
block.boresight_angle,
124113
block.hwp_dir, block.az_speed,
125114
block.az_accel
126115
])
@@ -146,22 +135,22 @@ def block_to_arr(block):
146135

147136
for block in seq:
148137
tt = (block.t1-block.t0).total_seconds()
149-
ax1.fill_between(
150-
[block.t0, block.t1],
138+
ax1.fill_between(
139+
[block.t0, block.t1],
151140
[block.az+block.throw, block.az+block.throw+block.az_drift*tt],
152141
[block.az, block.az+block.az_drift*tt],
153142
)
154143
ax2.plot( [block.t0, block.t1], [block.alt, block.alt] )
155-
ax3.plot(
156-
[block.t0, block.t1],
157-
[block.boresight_angle, block.boresight_angle]
144+
ax3.plot(
145+
[block.t0, block.t1],
146+
[block.boresight_angle, block.boresight_angle]
158147
)
159-
ax4.plot(
160-
[block.t0, block.t1],
161-
[block.az_speed, block.az_speed]
148+
ax4.plot(
149+
[block.t0, block.t1],
150+
[block.az_speed, block.az_speed]
162151
)
163-
ax5.plot(
164-
[block.t0, block.t1],
152+
ax5.plot(
153+
[block.t0, block.t1],
165154
[block.hwp_dir, block.hwp_dir] , lw=2
166155
)
167156

@@ -170,7 +159,7 @@ def block_to_arr(block):
170159
while l <= t1:
171160
vlines.append(l)
172161
l += dt.timedelta(hours=24)
173-
162+
174163
locator = mdates.AutoDateLocator()
175164
formatter = mdates.ConciseDateFormatter(locator)
176165
for ax in [ax1, ax2, ax3, ax4, ax5]:
@@ -179,7 +168,7 @@ def block_to_arr(block):
179168
ax.set_ylim(y0,y1)
180169
ax.xaxis.set_major_locator(locator)
181170
ax.xaxis.set_major_formatter(formatter)
182-
171+
183172
ax1.set_ylabel("Azimuth")
184173
ax2.set_ylabel("Elevation")
185174
ax2.set_ylim(30,70)

src/pages/6_SAT_Scheduler.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,34 +158,34 @@ def build_table(t0, t1, cfg, seq, cmds, state, platform):
158158
# dictionary goes dict[elevation][sun_keepout]
159159
schedule_files = {
160160
50 : {
161-
45: os.path.join(schedule_base_dir, '20250411_d-40,-10_e50_s0.5,0.8_a45_j2025-02-15T12:00+00:00_n365.txt'),
162-
49: os.path.join(schedule_base_dir, '20250411_d-40,-10_e50_s0.5,0.8_a49_j2025-02-15T12:00+00:00_n365.txt'),
161+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e50_t40_s0.5,0.8_a45_j2025-06-15T12:00+00:00_n365.txt'),
162+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e50_t40_s0.5,0.8_a49_j2025-06-15T12:00+00:00_n365.txt'),
163163
},
164164
60 : {
165-
45: os.path.join(schedule_base_dir, '20250411_d-40,-10_e60_s0.5,0.8_a45_j2025-02-15T12:00+00:00_n365.txt'),
166-
49: os.path.join(schedule_base_dir, '20250411_d-40,-10_e60_s0.5,0.8_a49_j2025-02-15T12:00+00:00_n365.txt'),
165+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a45_j2025-06-15T12:00+00:00_n365.txt'),
166+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a49_j2025-06-15T12:00+00:00_n365.txt'),
167167
}
168168
}
169169

170170
cal_files = {
171171
50 : {
172-
45: os.path.join(schedule_base_dir, '20250411_d-40,-10_e50_s0.5,0.8_a45_j2025-02-15T12:00+00_:00_n365_planets.txt'),
173-
49: os.path.join(schedule_base_dir, '20250411_d-40,-10_e50_s0.5,0.8_a45_j2025-02-15T12:00+00:00_n365_planets.txt'),
172+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a45_j2025-06-15T12:00+00:00_n365_planets.txt'),
173+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a49_j2025-06-15T12:00+00:00_n365_planets.txt'),
174174
},
175175
60 : {
176-
45: os.path.join(schedule_base_dir, '20250411_d-40,-10_e60_s0.5,0.8_a45_j2025-02-15T12:00+00:00_n365_planets.txt'),
177-
49: os.path.join(schedule_base_dir, '20250411_d-40,-10_e60_s0.5,0.8_a49_j2025-02-15T12:00+00:00_n365_planets.txt'),
176+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/with_wafers/2025-07-30T00:00:00+00:00_2025-10-30T00:00:00+00:00_satp1_e60_a41_merged.txt'),
177+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/with_wafers/20250625_satp3_e60_a49_planets.txt'),
178178
}
179179
}
180180

181181
wiregrid_files = {
182182
50 : {
183-
45: os.path.join(schedule_base_dir, '20250411_d-40,-10_e50_s0.5,0.8_a45_j2025-02-15T12:00+00:00_n365_wiregrid.txt'),
184-
49: os.path.join(schedule_base_dir, '20250411_d-40,-10_e50_s0.5,0.8_a45_j2025-02-15T12:00+00:00_n365_wiregrid.txt'),
183+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e50_t40_s0.5,0.8_a45_j2025-06-15T12:00+00:00_n365_wiregrid.txt'),
184+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e50_t40_s0.5,0.8_a49_j2025-06-15T12:00+00:00_n365_wiregrid.txt'),
185185
},
186186
60 : {
187-
45: os.path.join(schedule_base_dir, '20250411_d-40,-10_e60_s0.5,0.8_a45_j2025-02-15T12:00+00:00_n365_wiregrid.txt'),
188-
49: os.path.join(schedule_base_dir, '20250411_d-40,-10_e60_s0.5,0.8_a49_j2025-02-15T12:00+00:00_n365_wiregrid.txt'),
187+
45: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a45_j2025-06-15T12:00+00:00_n365_wiregrid.txt'),
188+
49: os.path.join(schedule_base_dir, 'SAT-scan-schedules/20250625_d-40,-10_e60_t40_s0.5,0.8_a49_j2025-06-15T12:00+00:00_n365_wiregrid.txt'),
189189
}
190190
}
191191

@@ -227,6 +227,7 @@ def build_table(t0, t1, cfg, seq, cmds, state, platform):
227227
az_speed = st.number_input("Azimuth Speed (deg/s)", value=0.5)
228228
az_accel = st.number_input("Azimuth Acceleration (deg/s²)", value=0.25)
229229
min_hwp_el = st.number_input("Min HWP Elevation (deg)", value=48.0)
230+
max_hwp_el = st.number_input("Max HWP Elevation (deg)", value=60.0)
230231
max_cmb_scan_duration = st.number_input("Max CMB Scan Duration (seconds)", value=3600)
231232
az_branch_override = st.number_input("Az Branch Override (deg) (Cal Sources)", value=180.0)
232233

@@ -238,6 +239,8 @@ def build_table(t0, t1, cfg, seq, cmds, state, platform):
238239
hwp_override = st.radio("HWP Override", options=["None", "Forward (CCW)", "Reverse (CW)"], index=0)
239240
st.checkbox("Boresight Override", value=st.session_state.boresight_override, key="boresight_override")
240241

242+
force_max_hwp_el = st.checkbox("Force Max HWP El", value=True)
243+
241244
if st.session_state.boresight_override:
242245
boresight = st.number_input("Boresight (deg)", value=0.0)
243246
else:
@@ -406,6 +409,8 @@ def toggle_dropdown():
406409
'iv_cadence': iv_cadence,
407410
'bias_step_cadence': bias_step_cadence,
408411
'min_hwp_el': min_hwp_el,
412+
'max_hwp_el': max_hwp_el,
413+
'force_max_hwp_el': force_max_hwp_el,
409414
'max_cmb_scan_duration': max_cmb_scan_duration,
410415
'disable_hwp': disable_hwp,
411416
'brake_hwp': brake_hwp,

src/pages/7_LAT_Scheduler.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ def toggle_dropdown():
272272
schedule_file = None
273273
t0_state_file = None
274274
cal_anchor_time = None
275-
remove_targets = []
275+
remove_cmb_targets = []
276+
remove_cal_targets = []
276277
# cal_targets = []
277278

278279
assert platform in ['lat'], (f"{platform} is not an "
@@ -291,13 +292,13 @@ def toggle_dropdown():
291292
else:
292293
sfile = os.path.join(
293294
schedule_base_dir,
294-
'iso/phase2/2025-05-23T20:46:10+00:00_phase2_cmb_lat_field_schedule.txt'
295+
'LAT-scan-schedules/iso/phase2/2025-07-23T14:39:08+00:00_phase2_cmb_lat_field_schedule.txt'
295296
)
296297

297298
if use_cal_file:
298299
cfile = os.path.join(
299300
schedule_base_dir,
300-
'iso/phase2/2025-05-22T17:29:30+00:00_calibration_lat_field_schedule.txt'
301+
'LAT-scan-schedules/iso/phase2/2025-05-22T17:29:30+00:00_calibration_lat_field_schedule.txt'
301302
)
302303
else:
303304
cfile = None
@@ -333,7 +334,8 @@ def toggle_dropdown():
333334
'cryo_stabilization_time': cryo_stabilization_time,
334335
'corotator_offset': corotator_offset,
335336
'elevations_under_90' : elevations_under_90,
336-
'remove_targets': tuple(remove_targets),
337+
'remove_cmb_targets': remove_cmb_targets,
338+
'remove_cal_targets': remove_cal_targets,
337339
'open_shutter': open_shutter,
338340
'close_shutter': close_shutter,
339341
'relock_cadence': relock_cadence,

0 commit comments

Comments
 (0)