Skip to content

Commit 4a6124a

Browse files
committed
🐛 Use cube identifier (name-version) to start data cube generation
1 parent 6b307dd commit 4a6124a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

USING.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Brazil Data Cube environment. If you don't have any account, please, refer to `B
231231
Once the data cube definition is created, you can trigger a data cube using the following command::
232232

233233
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
234-
cube-builder build LC8-1M \
234+
cube-builder build LC8-1M-1 \
235235
--stac-url https://brazildatacube.dpi.inpe.br/stac/ \
236236
--collections=LC8_SR-1 \
237237
--tiles=011009 \
@@ -372,7 +372,7 @@ In order to trigger a data cube, we are going to use a collection `S2-16-1` made
372372

373373
# Using cube-builder command line
374374
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
375-
cube-builder build S2-16D \
375+
cube-builder build S2-16D-1 \
376376
--stac-url https://brazildatacube.dpi.inpe.br/stac/ \
377377
--collections=S2_L2A-1 \
378378
--tiles=017019 \
@@ -479,7 +479,7 @@ Trigger data cube generation with following command:
479479
480480
# Using cube-builder command line
481481
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
482-
cube-builder build CB4-16D \
482+
cube-builder build CB4-16D-1 \
483483
--stac-url https://brazildatacube.dpi.inpe.br/stac/ \
484484
--collections=CBERS4_AWFI_L4_SR \
485485
--tiles=005004 \
@@ -495,7 +495,7 @@ When the ``Cube-Builder`` could not generate data cube for any unknown issue, yo
495495
with the same command you have dispatched::
496496

497497
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
498-
cube-builder build CB4-16D \
498+
cube-builder build CB4-16D-1 \
499499
--stac-url https://brazildatacube.dpi.inpe.br/stac/ \
500500
--collections=CBERS4_AWFI_L4_SR \
501501
--tiles=005004 \
@@ -506,7 +506,7 @@ with the same command you have dispatched::
506506
It will reuse most of files that were already processed, executing only the failed tasks. If you notice anything suspicious or want to re-create theses files again, use the option ``--force``::
507507

508508
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
509-
cube-builder build CB4-16D \
509+
cube-builder build CB4-16D-1 \
510510
--stac-url https://brazildatacube.dpi.inpe.br/stac/ \
511511
--collections=CBERS4_AWFI_L4_SR \
512512
--tiles=005004 \
@@ -710,7 +710,7 @@ So you can create a data cube with command::
710710
After cube definition created, you can just use the command line ``cube-builder build-local``::
711711

712712
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
713-
cube-builder build-local S2-LOCAL-16D \
713+
cube-builder build-local S2-LOCAL-16D-1 \
714714
--tiles 003011 \
715715
--start-date 2021-08-29 \
716716
--end-date 2021-09-13 \

cube_builder/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def maestro(cls, datacube, collections, tiles, start_date, end_date, **propertie
443443
"""Search and Dispatch datacube generation on cluster.
444444
445445
Args:
446-
datacube - Data cube name.
446+
datacube - Data cube identifier.
447447
collections - List of collections used to generate datacube.
448448
tiles - List of tiles to generate.
449449
start_date - Start period

cube_builder/maestro.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,7 @@ def _stac(self, collection: str, url: str, **kwargs) -> STAC:
182182

183183
def orchestrate(self):
184184
"""Orchestrate datacube defintion and prepare temporal resolutions."""
185-
self.datacube = (
186-
Collection.query()
187-
.filter(Collection.name == self.params['datacube'])
188-
.first_or_404(f'Cube {self.params["datacube"]} not found.')
189-
)
185+
self.datacube = Collection.get_by_id(self.params['datacube'])
190186

191187
temporal_schema = self.datacube.temporal_composition_schema
192188

0 commit comments

Comments
 (0)