From f39d25a8092d064d24fee419f111feecdbc70dbd Mon Sep 17 00:00:00 2001 From: Matt Ruffalo Date: Mon, 31 Aug 2020 13:48:27 -0400 Subject: [PATCH] ometiff_pyramid.py: add plumbing to pass downsample_type to pipeline Currently disabled via a hardcoded assignment of `is_ims = False`, but I assume that flag can be implemented by examining the Airflow environment or something similar. --- src/ingest-pipeline/airflow/dags/ometiff_pyramid.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ingest-pipeline/airflow/dags/ometiff_pyramid.py b/src/ingest-pipeline/airflow/dags/ometiff_pyramid.py index e3f6cc8f..7d9a6f9d 100644 --- a/src/ingest-pipeline/airflow/dags/ometiff_pyramid.py +++ b/src/ingest-pipeline/airflow/dags/ometiff_pyramid.py @@ -34,6 +34,9 @@ localized_assert_json_matches_schema as assert_json_matches_schema, ) +# Passed directly to the pipeline +DOWNSAMPLE_TYPE = 'LINEAR' + # after running this DAG you should have on disk # 1. 1 OME.TIFF pyramid per OME.TIFF in the original dataset # 2. 1 .N5 file per OME.TIFF in the original dataset @@ -93,6 +96,9 @@ def build_cwltool_cmd1(**kwargs): data_dir = ctx['parent_lz_path'] print('data_dir: ', data_dir) + # TODO: implement this check however is appropriate + is_ims = False + #this is the call to the CWL command = [ *get_cwltool_base_cmd(tmpdir), @@ -100,6 +106,9 @@ def build_cwltool_cmd1(**kwargs): '--ometiff_directory', data_dir, ] + if is_ims: + command.append('--downsample_type') + command.append(DOWNSAMPLE_TYPE) return join_quote_command_str(command)