Skip to content

Commit

Permalink
Pretty image uplaods and pathname fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed May 19, 2024
1 parent aa6ff9d commit 5ccc427
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/panoptes/pocs/camera/gphoto/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def process_exposure(self, metadata, **kwargs):
while self.is_exposing:
time.sleep(0.5)

metadata['cr2_filepath'] = metadata['filepath']
metadata['filepath'] = metadata['filepath'].replace('.cr2', '.fits')
super(AbstractGPhotoCamera, self).process_exposure(metadata, **kwargs)
self._command_proc = None
Expand Down
7 changes: 3 additions & 4 deletions src/panoptes/pocs/observatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,14 @@ def process_observation(
try:
image_title = f'{field_name} [{exptime}s] {seq_id}'

if 'cr2_filepath' in metadata:
file_path = metadata['cr2_filepath']
cr2_file_path = file_path.replace('.fits', '.cr2').repalce('.fz', '')

link_path = None
if metadata.get('is_primary', False):
link_path = Path(self.get_config('directories.images')) / 'latest.jpg'
self.logger.debug(f"Making pretty image for {file_path=!r}")
self.logger.debug(f"Making pretty image for {cr2_file_path=!r}")

pretty_image_path = img_utils.make_pretty_image(file_path, title=image_title, link_path=link_path)
pretty_image_path = img_utils.make_pretty_image(cr2_file_path, title=image_title, link_path=link_path)
self.logger.debug(f"Pretty image created: {pretty_image_path}")
self.logger.debug(f'Pretty image linked to {link_path}')
if should_upload:
Expand Down

0 comments on commit 5ccc427

Please sign in to comment.