Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
gnthibault committed Aug 12, 2023
1 parent e60c271 commit 3353830
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 45 deletions.
2 changes: 1 addition & 1 deletion Camera/IndiAbstractCameraSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ def unpark(self):

def set_cooling_on(self):
# This feels like a bug from the simulator ...
self.logger.warning(f"set_cooling_on removed as there seems to be a bug in simulator implementation")
self.logger.warning(f"set_cooling_on working in async mode, as it seems to be a bug in simulator implementation")
self.set_switch('CCD_COOLER', ['COOLER_ON'], sync=False, timeout=self.defaultTimeout)
13 changes: 5 additions & 8 deletions Imaging/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def solve_field(fname, timeout=360, solve_opts=None, **kwargs):
'--match', 'none',
'--corr', 'none',
'--wcs', 'none',
'--downsample', '1',
]

if kwargs.get('overwrite', True):
Expand All @@ -75,9 +74,9 @@ def solve_field(fname, timeout=360, solve_opts=None, **kwargs):
options.append("arcsecperpix")
if kwargs.get("downsample", 1) > 1:
options.append('--downsample')
options.append(kwargs.get('downsample'))
options.append(str(kwargs.get('downsample')))
options.append('--plot-scale')
options.append(1/kwargs.get('downsample'))
options.append(str(1/kwargs.get('downsample')))

cmd = [solve_field_script] + options + [fname]
if verbose:
Expand All @@ -88,13 +87,11 @@ def solve_field(fname, timeout=360, solve_opts=None, **kwargs):
proc = subprocess.Popen(cmd, universal_newlines=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
except OSError as e:
raise error.InvalidCommand(
"Can't send command to solve_field.sh: {} \t {}".format(e, cmd))
raise error.AstrometrySolverError(f"Error: {e} - Can't send command to solve_field.sh: {cmd}")
except ValueError as e:
raise error.InvalidCommand(
"Bad parameters to solve_field: {} \t {}".format(e, cmd))
raise error.AstrometrySolverError(f"Error: {e} - Bad parameters to solve_field: {cmd}")
except Exception as e:
raise error.PanError("Error on plate solving: {}".format(e))
raise error.AstrometrySolverError(f"Error: {e} - Error for solve_field: {cmd}")

if verbose:
print("Returning proc from solve_field")
Expand Down
2 changes: 1 addition & 1 deletion Mount/IndiAbstractMount.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def initialize(self):
self.logger.debug("Successfully initialized from IndiAbstractMount")

def slew_to_coord(self, coord):
self.slew_to_coord_and_track(self, coord)
self.slew_to_coord_and_track(coord)

def get_current_coordinates(self):
return IndiMount.get_current_coordinates(self)
Expand Down
19 changes: 13 additions & 6 deletions Observatory/IndiDomeController.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ def __init__(self, config=None, connect_on_create=True):
self.logger.debug('Indi dome configured successfully')

def initialize(self):
self._is_initialized = True
self.logger.debug("Initializing dome, not doing much actually")
self.logger.debug(f"Initializing dome {self.device_name}")
self.set_switch("DOME_PARK", on_switches=["UNPARK"], sync=True, timeout=self.dome_movement_timeout_s)
self.set_switch("DOME_AUTOSYNC", on_switches=["DOME_AUTOSYNC_ENABLE"], sync=True)
self.set_number("DOME_PARAMS", {"AUTOSYNC_THRESHOLD": 0.5})
self.logger.debug(f"Successfully initialized dome {self.device_name}")

def deinitialize(self):
self._is_initialized = False
self.logger.debug("Deinitializing dome, not doing much actually")
self.logger.debug(f"Deinitializing dome {self.device_name}")
if self._is_initialized:
self.set_switch("DOME_PARK", on_switches=["PARK"], sync=True, timeout=self.dome_movement_timeout_s)
self.logger.debug(f"Successfully deinitialized dome {self.device_name}")

@property
def is_initialized(self):
Expand All @@ -47,14 +52,16 @@ def unpark(self):
self.start_indi_server()
self.start_indi_driver()
self.connect(connect_device=True)
self.set_switch("DOME_PARK", on_switches=["UNPARK"], sync=True, timeout=self.dome_movement_timeout_s)
self.initialize()
self._is_initialized = True
self.logger.debug("Successfully unparked")

def park(self):
self.logger.debug("Parking")
self.set_switch("DOME_PARK", on_switches=["PARK"], sync=True, timeout=self.dome_movement_timeout_s)
self.deinitialize()
self.disconnect()
self.stop_indi_server()
self._is_initialized = False
self.logger.debug("Successfully parked")

def open(self):
Expand Down
2 changes: 1 addition & 1 deletion conf_files/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mount:
indi_port : 7624
cameras:
-
module: IndiAbstractCameraSimulator
module: IndiAbstractCameraSimulatorNonCoolNonOffset
camera_name : Guide Simulator
do_acquisition: false
SIMULATOR_SETTINGS: # 290MM
Expand Down
63 changes: 35 additions & 28 deletions conf_files/spectral_targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,41 @@ constraints :
maxairmass : 17 #for testing, normally use 2
minmoonseparationdeg : 2 # normally put 45
targets :
# "Altair" : #HD214680 #HD222404
# priority : 0
# count : 1
# temperature : 15
# gain: 150
# offset: 30
# exp_time_sec : 20
# "10 Lacertae": #HD214680 #HD222404
# priority: 0
# count: 1
# temperature: 15
# gain: 150
# offset: 30
# exp_time_sec: 20
# "T CrB" :
# priority : 0
# count : 1
# temperature : 15
# gain: 150
# offset: 30
# exp_time_sec : 20
# "V375 Lac" :
# priority : 0
# count : 2
# temperature : 15
# gain: 150
# offset: 30
# exp_time_sec : 5
"Altair" : #HD214680 #HD222404
priority : 0
count : 1
temperature : 15
gain: 150
offset: 30
exp_time_sec : 20
"Arcturus":
priority: 0
count: 1
temperature: 15
gain: 150
offset: 30
exp_time_sec: 20
"10 Lacertae": #HD214680 #HD222404
priority: 0
count: 1
temperature: 15
gain: 150
offset: 30
exp_time_sec: 20
"T CrB" :
priority : 0
count : 1
temperature : 15
gain: 150
offset: 30
exp_time_sec : 20
"V375 Lac" :
priority : 0
count : 2
temperature : 15
gain: 150
offset: 30
exp_time_sec : 5
"GK Per":
priority: 0
count: 2
Expand Down

0 comments on commit 3353830

Please sign in to comment.