Exemplo n.º 1
0
medianas = dag_utils.IdentityMap(
    mascara_ls8,
    algorithm=_steps['medianas']['algorithm'],
    version=_steps['medianas']['version'],
    task_id="medianas",
    queue=_steps['medianas']['queue'],
    dag=dag,
    delete_partial_results=_steps['medianas']['del_prev_result'],
    params=_steps['medianas']['params'])

mosaico = dag_utils.OneReduce(
    medianas,
    task_id="mosaico_medianas",
    algorithm=_steps['mosaico']['algorithm'],
    version=_steps['mosaico']['version'],
    queue=_steps['mosaico']['queue'],
    delete_partial_results=_steps['mosaico']['del_prev_result'],
    trigger_rule=TriggerRule.NONE_FAILED,
    dag=dag)

normalizacion = CDColReduceOperator(
    algorithm=_steps['normalizacion']['algorithm'],
    version=_steps['normalizacion']['version'],
    queue=_steps['normalizacion']['queue'],
    params=_steps['normalizacion']['params'],
    delete_partial_results=_steps['normalizacion']['del_prev_result'],
    dag=dag,
    task_id="normalizacion",
    to_tiff=True)
Exemplo n.º 2
0
                                 taxprefix="joined",
                                 params={'bands': _params['bands']})

medianas = dag_utils.IdentityMap(reducer,
                                 algorithm="compuesto-temporal-medianas-wf",
                                 version="1.0",
                                 taxprefix="medianas_",
                                 queue='airflow_small',
                                 dag=dag,
                                 params={
                                     'normalized': _params['normalized'],
                                     'bands': _params['bands'],
                                     'minValid': _params['minValid'],
                                 })

mosaico = dag_utils.OneReduce(medianas,
                              algorithm="joiner",
                              version="1.0",
                              queue='airflow_medium',
                              dag=dag,
                              taxprefix="mosaic")

kmeans = dag_utils.IdentityMap(mosaico,
                               algorithm="k-means-wf",
                               version="1.0",
                               taxprefix="kmeans_",
                               queue='airflow_medium',
                               dag=dag,
                               params={'classes': _params['classes']})

kmeans
    lat=_params['lat'],
    lon=_params['lon'],
    time_ranges=_params['time_ranges'],
    algorithm=_steps['generic-step']['algorithm'],
    version=_steps['generic-step']['version'],
    product=_params['products'][0],
    params=_steps['generic-step']['params'],
    queue=_steps['generic-step']['queue'],
    dag=dag,
    task_id="generic-step_" + _params['products'][0]['name'],
    to_tiff=False,
    alg_folder=common.COMPLETE_ALGORITHMS_FOLDER)

workflow = generic_step
if _params['genera_mosaico'] and queue_utils.get_tiles(_params['lat'],
                                                       _params['lon']) > 1:
    mosaico = dag_utils.OneReduce(
        workflow,
        task_id="mosaic",
        algorithm=_steps['mosaico']['algorithm'],
        version=_steps['mosaico']['version'],
        queue=_steps['mosaico']['queue'],
        delete_partial_results=_steps['mosaico']['del_prev_result'],
        trigger_rule=TriggerRule.NONE_FAILED,
        dag=dag,
        to_tiff=False)

    workflow = mosaico

workflow
Exemplo n.º 4
0
    algorithm="compuesto-temporal-medianas-wf",
    version="1.0",
    task_id="medianas_p_2",
    queue=_queues['compuesto-temporal-medianas-wf'],
    dag=dag,
    params={
        'normalized': _params['normalized'],
        'bands': _params['bands'],
        'minValid': _params['minValid'],
    })
print(queue_utils.get_tiles(_params['lat'], _params['lon']))
if queue_utils.get_tiles(_params['lat'], _params['lon']) > 1:
    mosaic1 = dag_utils.OneReduce(medians1,
                                  algorithm="joiner",
                                  version="1.0",
                                  queue=_queues['joiner'],
                                  trigger_rule=TriggerRule.NONE_FAILED,
                                  dag=dag,
                                  task_id="mosaic_p_1")
    mosaic2 = dag_utils.OneReduce(medians2,
                                  algorithm="joiner",
                                  version="1.0",
                                  queue=_queues['joiner'],
                                  trigger_rule=TriggerRule.NONE_FAILED,
                                  dag=dag,
                                  task_id="mosaic_p_2")
    results = mosaic1 + mosaic2
else:
    results = medians1 + medians2

pca = dag_utils.reduceByTile(results,