Skip to content

Commit

Permalink
add project to ee authenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaits committed Feb 22, 2024
2 parents ab2d0fc + 8d57cb8 commit 6b3b666
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/earthengine/earthengine_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@

from counters import Counters

flags.DEFINE_string('ee_gcloud_project', 'datcom-import-automation-prod',
'Gcloud project with Earth Engine API enabled.')
flags.DEFINE_string('ee_dataset', '',
'Load earth engine data set define in config datasets.')
flags.DEFINE_string('gcs_output', '', 'Prefix for output file names on GCS.')
Expand Down Expand Up @@ -169,6 +171,8 @@
}

EE_DEFAULT_CONFIG = {
# GCloud project
'ee_gcloud_project': _FLAGS.ee_gcloud_project,
# Image loading settings.
'datasets': _DEFAULT_DATASETS, # Predefined assets
'ee_dataset': _FLAGS.ee_dataset, # Reference to an asset in 'datasets'
Expand Down Expand Up @@ -606,7 +610,7 @@ def ee_process(config) -> list:
'''
ee_tasks = []
ee.Authenticate()
ee.Initialize()
ee.Initialize(project=config.get('ee_gcloud_project'))
config['ee_image_count'] = config.get('ee_image_count', 1)
time_period = config.get('time_period', 'P1M')
cur_date = utils.date_format_by_time_period(utils.date_today(), time_period)
Expand Down

0 comments on commit 6b3b666

Please sign in to comment.