simonsobs / scheduler

Scheduler for SO
0 stars 1 forks source link

Change biasstep timing #103

Closed ykyohei closed 1 month ago

ykyohei commented 1 month ago

PR for changing the timing of biasstep. This will resolve https://github.com/simonsobs/scheduler/issues/94 This is still a draft because we have one remaining issue.

ykyohei commented 1 month ago

I fixed typo and I think it's working for all the SATs now. The example is as follows. This PR seems to have fixed post obs processing bug and increased the observation time by a few minutes.

Before

run.acu.move_to(az=270.892, el=60.0)
run.wait_until('2024-09-17T21:37:24+00:00')
# hwp already spinning
scan_stop = datetime.datetime(2024, 9, 17, 22, 37, 12, tzinfo=datetime.timezone.utc)
if datetime.datetime.now(tz=UTC) < scan_stop - datetime.timedelta(minutes=10):
    run.seq.scan(
        description='NW. First choice',
        stop_time='2024-09-17T22:37:12+00:00',
        width=40.0, az_drift=0,
        subtype='cmb', tag='271-311',
    )
    run.smurf.bias_step(concurrent=True)
run.wait_until('2024-09-17T22:38:12+00:00')
run.acu.move_to(az=111.483, el=60.0)
run.wait_until('2024-09-17T22:41:12+00:00')
# hwp already spinning
scan_stop = datetime.datetime(2024, 9, 17, 23, 41, tzinfo=datetime.timezone.utc)
if datetime.datetime.now(tz=UTC) < scan_stop - datetime.timedelta(minutes=10):
    run.seq.scan(
        description='SOUTHERN FIELD : SE. First choice',
        stop_time='2024-09-17T23:41:00+00:00',
        width=40.0, az_drift=0,
        subtype='cmb', tag='111-151',
    )
    run.smurf.bias_step(concurrent=True)
run.wait_until('2024-09-17T23:42:00+00:00')
run.acu.move_to(az=111.483, el=60.0)
run.wait_until('2024-09-17T23:45:00+00:00')
# hwp already spinning
scan_stop = datetime.datetime(2024, 9, 18, 0, 44, 48, tzinfo=datetime.timezone.utc)
if datetime.datetime.now(tz=UTC) < scan_stop - datetime.timedelta(minutes=10):
    run.seq.scan(
        description='SOUTHERN FIELD : SE. First choice',
        stop_time='2024-09-18T00:44:48+00:00',
        width=40.0, az_drift=0,
        subtype='cmb', tag='111-151',
    )
    run.smurf.bias_step(concurrent=True)

After

run.acu.move_to(az=270.892, el=60.0)
# hwp already spinning
run.smurf.bias_step(concurrent=True)
scan_stop = datetime.datetime(2024, 9, 17, 22, 41, 12, tzinfo=datetime.timezone.utc)
if datetime.datetime.now(tz=UTC) < scan_stop - datetime.timedelta(minutes=10):
    run.seq.scan(
        description='NW. First choice',
        stop_time='2024-09-17T22:41:12+00:00',
        width=40.0, az_drift=0,
        subtype='cmb', tag='271-311',
    )
run.acu.move_to(az=111.483, el=60.0)
# hwp already spinning
run.smurf.bias_step(concurrent=True)
scan_stop = datetime.datetime(2024, 9, 17, 23, 45, tzinfo=datetime.timezone.utc)
if datetime.datetime.now(tz=UTC) < scan_stop - datetime.timedelta(minutes=10):
    run.seq.scan(
        description='SOUTHERN FIELD : SE. First choice',
        stop_time='2024-09-17T23:45:00+00:00',
        width=40.0, az_drift=0,
        subtype='cmb', tag='111-151',
    )
run.acu.move_to(az=111.483, el=60.0)
# hwp already spinning
run.smurf.bias_step(concurrent=True)
scan_stop = datetime.datetime(2024, 9, 18, 0, 48, 48, tzinfo=datetime.timezone.utc)
if datetime.datetime.now(tz=UTC) < scan_stop - datetime.timedelta(minutes=10):
    run.seq.scan(
        description='SOUTHERN FIELD : SE. First choice',
        stop_time='2024-09-18T00:48:48+00:00',
        width=40.0, az_drift=0,
        subtype='cmb', tag='111-151',
    )