simonsobs / scheduler

Scheduler for SO
0 stars 1 forks source link

Add a run.wait_until as a check on operation duration timing #125

Open kmharrington opened 4 weeks ago

kmharrington commented 4 weeks ago

As Matthew and I are discussing here: https://github.com/simonsobs/scheduler/pull/121#issuecomment-2426998405

There are times where the code is depending on the duration of the detector setup block (and probably also the HWP spin up/down blocks) in order for different moves or scans to be sun safe.

It might sometime be possible for that duration to be shorter than expected. So, we should add a run.wait_until at a beginning of the scans to check that we don't start scanning too early.

kmharrington commented 4 weeks ago

Another note here, this was found because of the sun safety checking code, which doesn't account for the timing of the detector setup blocks. I don't actually want to change the sun safety code, but if you see this error (the "Error on Line ')'") in particular. That means this edge case has happened.

2024-10-26 16:09:58,277 [INFO] Sun position at failure time {'sun_radec': (215.42969917825798, -14.107536811155219), 'sun_azel': (290.3382957774967, 68.24976007500582)} 
2024-10-26 16:09:58,277 [ERROR] Sun-safe motions not solved! 
2024-10-26 16:09:58,277 [ERROR] Error on Line ')' at time 2024-10-30T17:39:59.970000