Short-bus / pilomar

RaspberryPi based miniature observatory
https://shortbus.blog/
GNU General Public License v3.0
64 stars 14 forks source link

MarkupPreview is quite slow to process, taking around 25% of telescope observation time. #13

Closed Short-bus closed 10 months ago

Short-bus commented 1 year ago

MarkupPreview function is taking quite a long time to process now. NGC, Messier and Hipparcos objects take quite a while to run through. Rework to speed up, switch from 'dictionary' lists to Pandas dataframes to speed up filtering and selection. Reduce excessive logging of the calculations.

Short-bus commented 1 year ago

Next version to be released uses pandas dataframe, it reduces overhead time from 25% to 10% in testing.

Short-bus commented 1 year ago

Noticed during other testing that processing the Hipparcos catalog dataframe for visible stars hogs the RPi CPU, although the routine is overall faster to process, it's less friendly at sharing the CPU with other threads. This causes the other threads (Main observation loop and microcontroller communication) to pause noticeably. Pausing the microcontroller loop can cause the camera altitude/azimuth positions to become too old (stale). Investigating further.

Short-bus commented 10 months ago

Latest version using a small periodic delay in the Hipparcos handling seems to make the thread share resources better with the rest of the program activities.

Short-bus commented 10 months ago

Improvements in Summer2023 update. MarkupPreview remains slow if it's simulating images from scratch, but that's a different issue.