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

Is the final move to "go home" checked for Sun Safety #96

Closed
mhasself opened this issue Sep 17, 2024 · 1 comment · Fixed by #140
Closed

Is the final move to "go home" checked for Sun Safety #96

mhasself opened this issue Sep 17, 2024 · 1 comment · Fixed by #140
Assignees
Labels
bug Something isn't working

Comments

@mhasself
Copy link
Member

Last night's SATP1 schedule failed on the move_to at the end:

run.acu.move_to(az=2.866, el=48.1)
run.wait_until('2024-09-17T10:02:45.714900+00:00')

# <detector setup omitted>
# ...

# hwp already spinning
now = datetime.datetime.now(tz=UTC)
scan_start = datetime.datetime(2024, 9, 17, 10, 14, 45, 734900, tzinfo=datetime.timezone.utc)
scan_stop = datetime.datetime(2024, 9, 17, 12, 7, 30, 712574, tzinfo=datetime.timezone.utc)
if now > scan_start:
    # adjust scan parameters
    az = 2.866 + -0.00471*(now-scan_start).total_seconds()
else: 
    az = 2.866
if now > scan_stop:
    # too late, don't scan
    pass
else:
    run.acu.move_to(az, 48.1)

    print('Waiting until 2024-09-17 10:14:45.734900+00:00 to start scan')
    run.wait_until('2024-09-17T10:14:45.734900+00:00')

    run.seq.scan(
        description='jupiter', 
        stop_time='2024-09-17T12:07:30.712574+00:00', 
        width=16.11, 
        az_drift=-0.00471, 
        subtype='cal',
        tag='jupiter,setting,ws3',
    )
    run.smurf.bias_step(concurrent=True)

run.hwp.stop(active=True)
sup.disable_driver_board()
# go home
run.acu.move_to(az=180, el=60)

The Jupiter scan was sun-safe, but could have been done at az in [360, 450] to enable a final retreat to az=180 at the end.

But given that the Jupiter scan was done in az = [0, 90], the move_to home at the end should have registered as sun-unsafe, and yield a scheduler error or a drop of the Jupiter scan.

@guanyilun
Copy link
Collaborator

yeah that's a good catch! The last goto is not sun-safety checked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants