Skip to content

Commit

Permalink
Various fix and comments related to improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gnthibault committed Jul 21, 2023
1 parent 859d542 commit 1b0556a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
1 change: 0 additions & 1 deletion Camera/IndiCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def on_emergency(self):
self.abort_shoot(sync=False)
self.logger.debug('on emergency routine finished')


def disable_shoot(self):
self.indi_client.disable_blob()

Expand Down
2 changes: 2 additions & 0 deletions Guider/GuiderPHD2.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def connect_profile(self, profile_name=None):
self.disconnect_profile()
self.set_profile_from_name(profile_name)
self.set_connected(True)
# We prefere to use auto exposure
#self.set_exposure(self.exposure_time_sec)

def is_server_connected(self):
return self.state != 'NotConnected'
Expand Down
19 changes: 9 additions & 10 deletions Imaging/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def solve_field(fname, timeout=180, solve_opts=None, **kwargs):
solve_field_script = "{}/scripts/solve_field.sh".format(os.getcwd())

if not os.path.exists(solve_field_script): # pragma: no cover
raise error.InvalidSystemCommand(
"Can't find solve-field: {}".format(solve_field_script))
raise error.InvalidSystemCommand(f"Can't find solve-field: {solve_field_script}")

# Add the options for solving the field
if solve_opts is not None:
Expand All @@ -54,7 +53,7 @@ def solve_field(fname, timeout=180, solve_opts=None, **kwargs):

if kwargs.get('overwrite', True):
options.append('--overwrite')
if kwargs.get('skip_solved', True):
if kwargs.get('skip_solved', False):
options.append('--skip-solved')

if 'ra' in kwargs:
Expand Down Expand Up @@ -133,13 +132,13 @@ def get_solve_field(fname, replace=True, remove_extras=True, **kwargs):
errs = None

# Check for solved file
if kwargs.get('skip_solved', True) and \
(os.path.exists(fname.replace('.fits', '.solved')) or WCS(fname).is_celestial):
if verbose:
print(f"Solved file exists, skipping (pass skip_solved=False to solve again): {fname}")

out_dict['solved_fits_file'] = fname
return out_dict
# if kwargs.get('skip_solved', True) and \
# (os.path.exists(fname.replace('.fits', '.solved')) or WCS(fname).is_celestial):
# if verbose:
# print(f"Solved file exists, skipping (pass skip-solved=False to solve again): {fname}")
#
# out_dict['solved_fits_file'] = fname
# return out_dict

if verbose:
print("Entering get_solve_field:", fname)
Expand Down
5 changes: 3 additions & 2 deletions Manager/Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@ def initialize_tracking(self):
self.mount.set_track_mode('TRACK_SIDEREAL')
if self.guider is not None:
self.logger.info("Start guiding")
if self.guiding_camera is not None:
self.guiding_camera.disable_shoot()
# TODO TN
# if self.guiding_camera is not None:
# self.guiding_camera.disable_shoot()
self.guider.guide()
self.logger.info("Guiding successfully started")
return True
Expand Down
2 changes: 2 additions & 0 deletions StateMachine/States/focusing.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def on_enter(event_data):
model.logger.debug(msg)
model.say(msg)
model.manager.guider.set_paused(paused=True)
time.sleep(5)
# TODO TN URGENT: ASK Guiding camera if it is still waiting for an image, and wait for that amount of time
try:
model.say("Starting focusing")
# Before each observation, we should refocus
Expand Down
2 changes: 1 addition & 1 deletion conf_files/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ pointer:
offset_pointer:
module: StarOffsetPointer #StarOffsetPointer #NoOffsetPointer
timeout_seconds: 300
max_identification_error_seconds: 5
max_identification_error_seconds: 1
sync_mount_upon_solve: False
use_guider_adjust: False
on_star_identification_failure: trust_astrometry # get_brightest or trust_astrometry
Expand Down
2 changes: 1 addition & 1 deletion helper/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ def _start_element(self, name, attrs):
logging.debug(f"Received new element with name/attr: {name, attrs}")
return
if 'message' in attrs:
logging.info(f"Message received from indi: {name, attrs}")
logging.debug(f"Message received from indi: {name, attrs}")
if obj.tag.is_vector():
if obj.tag.get_transfertype() in (inditransfertypes.idef, inditransfertypes.iset):
self.current_vector = obj
Expand Down

0 comments on commit 1b0556a

Please sign in to comment.