Skip to content

Commit

Permalink
Merge pull request #150 from mrosseel/solver-bug
Browse files Browse the repository at this point in the history
Solver bug
  • Loading branch information
brickbots authored Mar 5, 2024
2 parents 2527226 + d62970e commit 2f5c921
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion python/PiFinder/camera_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def __init__(self, exposure_time) -> None:
self.exposure_time = exposure_time
self.gain = 10
self.image = Image.open(self.path / "debug.png")
self.image2 = Image.open(self.path / "debug2.png")
self.image_bool = True
self.initialize()

def initialize(self) -> None:
Expand All @@ -40,7 +42,8 @@ def capture(self) -> Image.Image:
sleep_time = self.exposure_time / 1000000
time.sleep(sleep_time)
logging.debug("CameraDebug exposed for %s seconds", sleep_time)
return self.image
self.image_bool = not self.image_bool
return self.image if self.image_bool else self.image2

def capture_file(self, filename) -> None:
print("capture_file not implemented")
Expand Down
6 changes: 4 additions & 2 deletions python/PiFinder/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def solver(shared_state, solver_queue, camera_image, console_queue, is_debug=Fal
t0 = precision_timestamp()
if USE_CEDAR_DETECT:
centroids = cedar_detect.extract_centroids(
np_image, sigma=8, max_size=8, use_binned=True
np_image, sigma=8, max_size=10, use_binned=True
)
else:
# logging.info("Falling back to Tetra3 for centroiding")
Expand All @@ -78,7 +78,7 @@ def solver(shared_state, solver_queue, camera_image, console_queue, is_debug=Fal

if len(centroids) == 0:
logging.debug("No stars found, skipping")
return
continue
else:
solution = t3.solve_from_centroids(
centroids,
Expand Down Expand Up @@ -122,3 +122,5 @@ def solver(shared_state, solver_queue, camera_image, console_queue, is_debug=Fal
last_solve_time = last_image_metadata["exposure_end"]
except EOFError:
logging.error("Main no longer running for solver")
except Exception as e:
logging.error("Solver exception %s", e)
2 changes: 1 addition & 1 deletion test_images/debug.png
1 change: 1 addition & 0 deletions test_images/debug2.png
Binary file added test_images/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f5c921

Please sign in to comment.