Skip to content

Commit

Permalink
Merge pull request #170 from lsst-ts/tickets/DM-47667
Browse files Browse the repository at this point in the history
DM-47667: Improve BaseCamera start/end take data operation to improve efficiency.
  • Loading branch information
tribeiro authored Jan 10, 2025
2 parents 7c92106 + 19580a6 commit 2b053cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/news/DM-47667.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed unit tests for LatissIntraExtraFocalData to work with new take_image command procedure.
17 changes: 10 additions & 7 deletions tests/auxtel/test_latiss_intra_extra_focal_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,6 @@ async def cmd_take_images_callback(self, data):
logger.debug(
f"Exposing for {one_exp_time} seconds for each exposure, total exposures is {data.numImages}"
)
await asyncio.sleep(one_exp_time * data.numImages)
self.nimages += 1
logger.debug("Scheduling finish_take_images before returning from take_images")
self.end_image_tasks.append(asyncio.create_task(self.finish_take_images()))

async def finish_take_images(self):
await asyncio.sleep(0.5)
# Allow an override of image numbers incase the test datasets are
# non-sequential
if not self.img_cnt_override_list:
Expand All @@ -255,6 +248,16 @@ async def finish_take_images(self):
image_name = f"AT_O_{self.date}_{(imgNum):06d}"

logger.debug(f"Mock camera returning imageName={image_name}")
await self.atcamera.evt_startIntegration.set_write(imageName=image_name)
await asyncio.sleep(one_exp_time * data.numImages)
self.nimages += 1
logger.debug("Scheduling finish_take_images before returning from take_images")
self.end_image_tasks.append(
asyncio.create_task(self.finish_take_images(image_name=image_name))
)

async def finish_take_images(self, image_name):
await asyncio.sleep(0.5)
await self.atcamera.evt_endReadout.set_write(imageName=image_name)
await asyncio.sleep(0.5)
await self.atheaderservice.evt_largeFileObjectAvailable.write()
Expand Down

0 comments on commit 2b053cf

Please sign in to comment.