Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unit_id for sequence and image ids #613

Merged
merged 4 commits into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions conf_files/pocs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
---
######################### PANOPTES UNIT ########################################
# name: Can be anything you want it to be. This name is displayed in several
# places and should be a "personal" name for the unit.
#
# pan_id: This is an identification number assigned by the PANOPTES team and is
# the official designator for your unit. This id is used to store image
# files and communicate with the Google Cloud network.
#
# Leave the pan_id at `PAN000` for testing until you have been assigned
# an official id. Update pocs_local.yaml with offical name once received.
################################################################################
name: Generic PANOPTES Unit
# pan_id: PANxyz # This unit's assigned identifier.
pan_id: PAN000

location:
name: Mauna Loa Observatory
latitude: 19.54 # Degrees
Expand Down Expand Up @@ -54,13 +66,13 @@ messaging:
cmd_port: 6500
msg_port: 6510

######################## Google Network ####################################
######################## Google Network ########################################
# By default all images are stored on googlecloud servers and we also
# use a few google services to store metadata, communicate with servers, etc.
#
# See $POCS/pocs/utils/google/README.md for
# details about authentication.
############################################################################
################################################################################
panoptes_network:
image_storage: True
metadata_storage: True
Expand Down
8 changes: 6 additions & 2 deletions pocs/camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,19 @@ def _setup_observation(self, observation, headers, filename, **kwargs):

file_path = filename

unit_id = self.config['pan_id']

# Make the image_id
image_id = '{}_{}_{}'.format(
self.config['name'],
unit_id,
self.uid,
start_time
)
self.logger.debug("image_id: {}".format(image_id))

# Make the sequence_id
sequence_id = '{}_{}_{}'.format(
self.config['name'],
unit_id,
self.uid,
observation.seq_time
)
Expand Down
3 changes: 1 addition & 2 deletions pocs/utils/google/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import warnings

from pocs.utils.error import GoogleCloudError
from pocs.utils.google.storage import PanStorage


Expand All @@ -20,5 +19,5 @@ def is_authenticated():
PanStorage('test-bucket')

return True
except GoogleCloudError:
except Exception:
return False