Skip to content

Commit

Permalink
changes:
Browse files Browse the repository at this point in the history
- fixed invalid character to pass pre-commit check
- resolved merge conflict
- changed a couple variable names that were wrong before
  • Loading branch information
tanaybhandarkar committed Nov 20, 2024
1 parent 3ea0cce commit 6465c4f
Showing 1 changed file with 19 additions and 35 deletions.
54 changes: 19 additions & 35 deletions socs/agents/starcam_lat/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ def pack_and_send_cmds(self):
pack_and_send_cmds()
**Process**
<<<<<<< HEAD
packs commands and parameters to be sent to starcamera and sends
=======
packs commands and parameters to be sent to star camera and sends
>>>>>>> 82252e753327de73c687591486c64dca8f4a8638
**Return**
returns list of values sent
"""
Expand Down Expand Up @@ -115,23 +110,23 @@ def get_astrom_data(self):
(scdata_raw, _) = self.comm.recvfrom(224)
data = struct.unpack_from("dddddddddddddiiiiiiiiddiiiiiiiiiiiiiifiii",
scdata_raw)
sc_keys = ['c_time',
'gmt',
'blob_num',
'obs_ra',
'astrom_ra',
'obs_dec',
'fr',
'ps',
'alt',
'az',
'ir',
'astrom_solve_time',
'camera_time']
keys = ['c_time',
'gmt',
'blob_num',
'obs_ra',
'astrom_ra',
'obs_dec',
'fr',
'ps',
'alt',
'az',
'ir',
'astrom_solve_time',
'camera_time']
# Create a dictionary of the unpacked data
astr_data = [data[i] for i in range(len(sc_keys))]
astr_data_dict = {keys[i]: astr_data[i] for i in range(len(sc_keys))}
return astr_data_dict
astrom_data = [data[i] for i in range(len(keys))]
astrom_data_dict = {keys[i]: astrom_data[i] for i in range(len(keys))}
return astrom_data_dict

def close(self):
"""
Expand Down Expand Up @@ -191,23 +186,17 @@ def acq(self, session, params=None):
acquires data from starcam and publishes to feed
**Return**
<<<<<<< HEAD
once the acq() loop exits (wherein data is retrieved from
the camera and pulished), a touple with True/False and a string
describing whether or not the loop was exited after the end of
an acquisition.
=======
once the acq() loop exits (wherein data is retrieved from the camera and pulished),
a touple with True/False and a string describing whether or not the loop was exited
after the end of an acquisition.
>>>>>>> 82252e753327de73c687591486c64dca8f4a8638
"""
if params is None:
params = {}
with self.lock.acquire_timeout(timeout=100, job='acq') as acquired:
if not acquired:
self.log.warn("Could not start init because {} is already
running".format(self.lock.job))
self.log.warn("Could not start init because {} is already "
"running".format(self.lock.job))
return False, "Could not acquire lock"
session.set_status('running')
self.log.info("Starting acquisition")
Expand All @@ -219,14 +208,9 @@ def acq(self, session, params=None):
'data': {}
}
# get astrometry data
astrom_data = self.StarcamHelper.get_astrom_data()
<<<<<<< HEAD
astrom_data_dict = self.StarcamHelper.get_astrom_data()
# update the data dictionary+session and publish
data['data'].update(astrom_data_dict)
=======
# update the data dictionary, update the session, and publish
data['data'].update(astrom_data_dict)
>>>>>>> 82252e753327de73c687591486c64dca8f4a8638
session.data.update(data['data'])
self.agent.publish_to_feed('starcamera', data)

Expand Down

0 comments on commit 6465c4f

Please sign in to comment.