PolishookDavid / LAST_OCS

Code controling the LAST project Observatory
0 stars 0 forks source link

`unitCS.takeTwilightFlats` can abort prematurely because of slave timeouts #46

Open EastEriq opened 4 days ago

EastEriq commented 4 days ago

It happened on two different mounts this evening. The routine was taking images which were still too bright, then printed on stdout

{15:18:40.751|obs.unitCS[01]} Estimated exposure time < 3 sec, waiting 
{15:18:43.980|inst.XerxesMountBinary[01_1]} slewing to RA=355.14, Dec=30.05
{15:18:50.443|obs.unitCS[01]} checking if slaves of unit 01 are ready, #1
{15:19:00.737|obs.util.Messenger[01_slave_3.Messenger]} 01_slave_3.Messenger timed out waiting for a reply to "Unit.Camera{3}.Id"
{15:19:04.718|obs.unitCS[01]} Cannot get initial brightness estimate. Aborting

in one instance, and

{15:12:31.499|obs.unitCS[10]} Estimated exposure time < 3 sec, waiting 
{15:12:34.524|inst.XerxesMountBinary[10_1]} slewing to RA=353.60, Dec=30.05
{15:12:43.450|obs.unitCS[10]} checking if slaves of unit 10 are ready, #1
{15:12:53.472|obs.util.Messenger[10_slave_1.Messenger]} 10_slave_1.Messenger timed out waiting for a reply to "Unit.Camera{1}.Id"
{15:12:56.230|obs.util.Messenger[10_slave_1.Messenger]} 10_slave_1.Messenger receiver reports: Error receiving data from the remote server. Additional Information: Operation timed out before requested data was received.
{15:12:56.689|obs.unitCS[10]} Cannot get initial brightness estimate. Aborting

in the other.

As a side note, all those messages printed to stdout should be made more readable, there is no point in preserving fidelity to original misconceptions.

EastEriq commented 1 day ago

Another occurrence yesterday

Taking flats
{14:57:34.644|inst.XerxesMountBinary[08_1]} slewing to RA=351.81, Dec=30.05
{14:57:40.616|obs.unitCS[08]} checking if slaves of unit 08 are ready, #1
{14:57:44.997|obs.unitCS[08]} checking if mount is tracking
{14:57:45.327|obs.unitCS[08]} checking if slaves of unit 08 are ready, #2
{14:57:49.853|obs.unitCS[08]} checking if mount is tracking
{14:57:50.173|obs.unitCS[08]} checking if slaves of unit 08 are ready, #3
{14:57:50.759|obs.unitCS[08]} checking if mount is tracking
{14:57:51.094|obs.unitCS[08]} checking if slaves of unit 08 are ready, #4
{14:57:51.768|obs.unitCS[08]} checking if mount is tracking
{14:57:52.115|obs.unitCS[08]} checking if slaves of unit 08 are ready, #5
{14:57:52.645|obs.unitCS[08]} checking if mount is tracking
{14:57:53.749|obs.unitCS[08]} Cannot get initial brightness estimate. Aborting
Sun at -2.1°, too high to focus - wait, or use ctrl+c to stop the method

Clearly it is about early returns of UnitObj.readyToExpose in getMeanCountPerSec (line 296 of takeTwilightFlats.m). In such cases MeanValPerSec is returned as NaN and line 116 of takeTwilightFlats.m rightly terminates the script. (Reminder, a shortcoming of it is that brightness estimates are global for all telescopes, instead of individual). I'll start with adding some report messages in readyToExpose, in order to make more apparent what causes the problem, before deciding what to improve.