Skip to content

Commit

Permalink
Remove debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
brickbots committed Dec 2, 2024
1 parent da63b4f commit f959706
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
23 changes: 10 additions & 13 deletions python/PiFinder/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* If solved, emits solution into queue
"""
from pprint import pprint

from PiFinder.multiproclogging import MultiprocLogging
import queue
import numpy as np
Expand Down Expand Up @@ -95,11 +95,9 @@ def solver(
align_dec = command[2]

if command[0] == "align_cancel":
print("--Cancelled")
align_ra = 0
align_dec = 0


state_utils.sleep_for_framerate(shared_state)

# use the time the exposure started here to
Expand Down Expand Up @@ -134,15 +132,15 @@ def solver(
else:
_solver_args = {}
if align_ra != 0 and align_dec != 0:
_solver_args["target_sky_coord"]=[[align_ra,align_dec]]
_solver_args["target_sky_coord"] = [[align_ra, align_dec]]

solution = t3.solve_from_centroids(
centroids,
(512, 512),
fov_estimate=12.0,
fov_max_error=4.0,
match_max_error=0.005,
#return_matches=True,
# return_matches=True,
target_pixel=shared_state.solve_pixel(),
solve_timeout=1000,
**_solver_args,
Expand Down Expand Up @@ -184,17 +182,16 @@ def solver(
solver_queue.put(solved)

# See if we are waiting for alignment
if align_ra !=0 and align_dec != 0:
print("Looking for align...")
if align_ra != 0 and align_dec != 0:
if solved.get("x_target") is not None:
align_target_pixel=(solved["y_target"], solved["x_target"])
print("Found it")
pprint(solved)

align_target_pixel = (
solved["y_target"],
solved["x_target"],
)
logger.debug(f"Align {align_target_pixel=}")
align_result_queue.put(["aligned", align_target_pixel])
align_ra=0
align_dec=0
align_ra = 0
align_dec = 0
solved["x_target"] = None
solved["y_target"] = None

Expand Down
5 changes: 1 addition & 4 deletions python/PiFinder/ui/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def align_on_radec(ra, dec, command_queues, config_object, shared_state) -> bool
except queue.Empty:
break

print("START AL")
# Send command to solver to work out the camera pixel for this target
command_queues["align_command"].put(
[
Expand All @@ -54,7 +53,7 @@ def align_on_radec(ra, dec, command_queues, config_object, shared_state) -> bool
dec,
]
)
print("AL TIMEOUT")
command_queues["console"].put("Align Timeout")
return False

try:
Expand All @@ -71,8 +70,6 @@ def align_on_radec(ra, dec, command_queues, config_object, shared_state) -> bool
# Failed to align
return False

print(f"AL: {target_pixel=}")

# success, set all the things...
shared_state.set_solve_pixel(target_pixel)
config_object.set_option("solve_pixel", target_pixel)
Expand Down

0 comments on commit f959706

Please sign in to comment.