twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

Issue 169/handle img load error #195

Closed ubdbra001 closed 1 month ago

ubdbra001 commented 1 month ago

Should fix #169 using the approach discussed in the issue.

Set-up to attempt to load the image a limited number of times before throwing an error and skipping to the next image. As with #194 there may be some discussion around the number of attempts and how long to wait between attempts, the numbers I picked were out of thin air.

twVolc commented 1 month ago

I can't seem to push my edits to your fork (maybe it's supposed to be like this or maybe I've done something wrong) but I think we just need to go all out on this error and catch it as it happens. That being said, this isn't catching it exactly as it happens, as this solution should be easier and SURELY it will still work, by replicating the dark image subtraction. Would you be able to add these edits to your branch if you're happy with it? Essentially within process_pair() we just try an artificial image subtraction after get_img(). We catch any error and raise FileNotFoundError to replicate all other errors associated with this. Surely if we're able to subtract a test image from each file then we'll be able to subtract the dark image within prep_img()??? image

twVolc commented 1 month ago

I've made these changes to the local version we're running here. I don't want to speak to soon, but this has been running for 1.5 hours now without hitting the error (before we seemed to hit it within 10-20 minutes). So whilst this solution might be excessive, I think we should just go with it. It would be good to get these changes done and merged with dev today if you're able to @ubdbra001? That would mean we can do a new install of the up-to-date dev tomorrow morning and hopefully have things set up to work before we leave.