AstroHuntsman / huntsman-pocs

POCS on the Huntsman Telescope
MIT License
7 stars 8 forks source link

Switching to sky field in compound observation can cause RuntimeError if sky field is below observable altitude for POCS #504

Closed fergusL closed 1 year ago

fergusL commented 3 years ago

When POCS is observing a compound field it will switch between the sky field and target field. Sometimes when switching, the desired field may have fallen below observable limits, triggering the following error:

I 07-11 12:58:01.809 Slewing to target coordinates for <bound method AbstractObservation.__name__ of <huntsman.pocs.scheduler.observation.base.CompoundObservation object at 0x7f456545e6a0>>: <bound method Abstra
ctField.__name__ of <huntsman.pocs.scheduler.field.CompoundField object at 0x7f45a50dc130>>: Centaurus-A: exptime=300.0 s, filter=r_band.                                                                          I 07-11 12:58:01.809 Slewing to target coordinates for <bound method AbstractObservation.__name__ of <huntsman.pocs.scheduler.observation.base.CompoundObservation object at 0x7f456545e6a0>>: <bound method Abstra
ctField.__name__ of <huntsman.pocs.scheduler.field.CompoundField object at 0x7f45a50dc130>>: Centaurus-A: exptime=300.0 s, filter=r_band.                                                                          
D 07-11 12:58:01.919 Mount status: {'ra_rate': 0, 'dec_rate': 0, 'tracking': True, 'slewing': False, 'connected': True, 'error': 0, 'parked': False, 'ra': 13.42434666770025, 'dec': -43.01911567435398, 'alt': '33.09', 'az': '236.16', 'ha': '4.8096', 'success': True}                                                                                                                                                             
D 07-11 12:58:01.925 Setting target coordinates: <SkyCoord (ICRS): (ra, dec) in deg                                                                                                                                    (198.70833333, -35.75)>                                                                                                                                                                                        
D 07-11 12:58:01.934 RA: 13h14m50s       Dec: -35d45m00s                                                                                                                                                           
W 07-11 12:58:01.941 Problem setting mount coordinates: ('13h14m50s', '-35d45m00s')
W 07-11 12:58:01.941 Problem setting mount coordinates: ('13h14m50s', '-35d45m00s')
C 07-11 12:58:01.950 Problem going from 'observing' to 'scheduling', exiting loop [RuntimeError('Unable to set target coordinates for <bound method AbstractField.__name__ of <Field "Centaurus-A-sky" at SkyCoord 
(ICRS): (ra, dec) in deg (198.70833333, -35.75)>>: Centaurus-A-sky.')]
C 07-11 12:58:01.950 Problem going from 'observing' to 'scheduling', exiting loop [RuntimeError('Unable to set target coordinates for <bound method AbstractField.__name__ of <Field "Centaurus-A-sky" at SkyCoord 
(ICRS): (ra, dec) in deg (198.70833333, -35.75)>>: Centaurus-A-sky.')]
I 07-11 12:58:01.961 Parking the telescope before stopping states.
I 07-11 12:58:01.961 Parking the telescope before stopping states.
D 07-11 12:58:01.967 Checking safety for <Transition('observing', 'parking')@139935922779136>
D 07-11 12:58:01.972 Always safe to move to parking

This triggers a complete shutdown of POCS (ie close shutter and park mount), which probably isn't what we want. Ideally POCS should move onto another target(?).