from airflow.utils.trigger_rule import TriggerRule

from datetime import timedelta
from pprint import pprint

_params = {{params}}

_steps = {
    'consulta': {
        'algorithm':
        "just-query",
        'version':
        '1.0',
        'queue':
        queue_utils.assign_queue(input_type='multi_temporal_area',
                                 time_range=_params['time_ranges'][0],
                                 lat=_params['lat'],
                                 lon=_params['lon']),
        'params': {},
    },
    'pca': {
        'algorithm':
        "deteccion-cambios-pca-wf",
        'version':
        '1.0',
        'queue':
        queue_utils.assign_queue(input_type='multi_area',
                                 lat=_params['lat'],
                                 lon=_params['lon']),
        'params': {},
        'del_prev_result':
        _params['elimina_resultados_anteriores'],
Exemplo n.º 2
0
from datetime import timedelta
from pprint import pprint

_params = {
    'lat': (9, 11),
    'lon': (-76, -74),
    'time_ranges': ("2013-01-01", "2015-12-31"),
    'products': ["LS8_OLI_LASRC"],
    'mosaic': True,
    'generate-geotiff': True
}

_queues = {
    'wofs-wf':
    queue_utils.assign_queue(),
    'joiner-reduce-wofs':
    queue_utils.assign_queue(input_type='multi_temporal_unidad',
                             time_range=_params['time_ranges'],
                             unidades=len(_params['products'])),
    'wofs-time-series-wf':
    queue_utils.assign_queue(input_type='multi_temporal_unidad',
                             time_range=_params['time_ranges'],
                             unidades=len(_params['products'])),
    'joiner':
    queue_utils.assign_queue(input_type='multi_temporal_unidad_area',
                             time_range=_params['time_ranges'],
                             lat=_params['lat'],
                             lon=_params['lon'],
                             unidades=len(_params['products'])),
}
Exemplo n.º 3
0
from airflow.models import DAG
from airflow.operators import CDColQueryOperator, CDColFromFileOperator, CDColReduceOperator
from airflow.operators.python_operator import PythonOperator
from cdcol_utils import dag_utils, queue_utils, other_utils
from airflow.utils.trigger_rule import TriggerRule

from datetime import timedelta
from pprint import pprint

_params = {{params}}

_steps = {
    'ndvi': {
        'algorithm': "ndvi-wf",
        'version': '1.0',
        'queue': queue_utils.assign_queue(),
        'params': {},
        'del_prev_result': _params['elimina_resultados_anteriores'],
    },
    'bosque': {
        'algorithm': "bosque-no-bosque-wf",
        'version': '1.0',
        'queue': queue_utils.assign_queue(),
        'params': {
            'ndvi_threshold': _params['ndvi_threshold'],
            'vegetation_rate': _params['vegetation_rate'],
            'slice_size': _params['slice_size']
        },
        'del_prev_result': _params['elimina_resultados_anteriores'],
    },
    'mosaico': {
from pprint import pprint

_params = {
    'lat': (4,6),
	'lon': (-74,-72),
	'time_ranges': [("2016-01-01", "2016-12-31"),("2017-01-01", "2017-12-31")],
    'bands': ["blue", "green", "red", "nir", "swir1", "swir2"],
    'minValid':1,
    'normalized':True,
    'products': ["LS8_OLI_LASRC"],
	'mosaic': False
}

_queues = {

    'mascara-landsat': queue_utils.assign_queue(input_type='multi_temporal', time_range=_params['time_ranges'][0]),
    'joiner-reduce': queue_utils.assign_queue(input_type='multi_temporal_unidad', time_range=_params['time_ranges'][0], unidades=len(_params['products'])),
    'compuesto-temporal-medianas-wf':queue_utils.assign_queue(input_type='multi_temporal_unidad', time_range=_params['time_ranges'][0], unidades=len(_params['products']) ),
    'ndvi-wf' : queue_utils.assign_queue(),
    'joiner': queue_utils.assign_queue(input_type='multi_area',lat=_params['lat'], lon=_params['lon'] ),
    'test-reduce': queue_utils.assign_queue(),
}

args = {
    'owner': 'cubo',
    'start_date': airflow.utils.dates.days_ago(2),
    'execID': "ndvi_anomaly",
    'product': "LS8_OLI_LASRC"
}

dag = DAG(
Exemplo n.º 5
0
_params = {
    'lat': (9, 11),
    'lon': (-76, -75),
    'time_ranges': [("2014-01-01", "2014-12-31"), ("2015-01-01", "2015-12-31")],
    'bands': ["blue", "green", "red", "nir", "swir1", "swir2", "pixel_qa"],
    'minValid': 1,
    'normalized': True,
    'products': ["LS7_ETM_LEDAPS"],
    'elimina_resultados_anteriores': True
}

_steps = {
    'mascara': {
        'algorithm': "mascara-landsat",
        'version': '1.0',
        'queue': queue_utils.assign_queue(input_type='multi_temporal', time_range=_params['time_ranges'][0]),
        'params': {'bands': _params['bands']},
    },
    'medianas': {
        'algorithm': "compuesto-temporal-medianas-wf",
        'version': '1.0',
        'queue': queue_utils.assign_queue(
            input_type='multi_temporal_unidad',
            time_range=_params['time_ranges'][0],
            unidades=len(_params['products'])),
        'params': {
            'normalized': _params['normalized'],
            'bands': _params['bands'],
            'minValid': _params['minValid'],
        },
        'del_prev_result': _params['elimina_resultados_anteriores'],
_params = {
    'lat': (9, 11),
    'lon': (-76, -75),
    'time_ranges': [("2014-01-01", "2014-12-31"), ("2015-01-01", "2015-12-31")],
    'bands': ["blue", "green", "red", "nir", "swir1", "swir2", "pixel_qa"],
    'minValid': 1,
    'normalized': True,
    'products': ["LS7_ETM_LEDAPS"],
}

_steps = {
    'mascara': {
        'algorithm': "mascara-landsat",
        'version': '1.0',
        'queue': queue_utils.assign_queue(
            input_type='multi_temporal',
            time_range=_params['time_ranges'][0]),
        'params': {'bands': _params['bands']},
    }

}

args = {
    'owner': 'mp.mancipe10',
    'start_date': airflow.utils.dates.days_ago(2),
    'execID': "mp.mancipe10_pca_paso_4_consulta_varios_tiles",
    'product': _params['products'][0]
}

dag = DAG(
    dag_id=args["execID"], default_args=args,
Exemplo n.º 7
0
from datetime import timedelta
from pprint import pprint

_params = {
    'lat': (9, 11),
    'lon': (-76, -75),
    'time_ranges': ("2010-01-01", "2011-12-31"),
    'products': ["LS7_ETM_LEDAPS"],
}

_steps = {
    'wofs': {
        'algorithm': "wofs-wf",
        'version': '1.0',
        'queue': queue_utils.assign_queue(),
    },
}

args = {
    'owner': 'mp.mancipe10',
    'start_date': airflow.utils.dates.days_ago(2),
    'execID': "mp.mancipe10_wofs_paso_3_clasificacion_varios_anhos",
    'product': _params['products'][0]
}

dag = DAG(dag_id=args['execID'],
          default_args=args,
          schedule_interval=None,
          dagrun_timeout=timedelta(minutes=120))