Skip to content
Snippets Groups Projects
Commit d65e8d16 authored by Timo Millenaar's avatar Timo Millenaar
Browse files

Add sh and cwl files to run aggregate_and_plot.py

parent 8d8a75a7
No related branches found
No related tags found
1 merge request!12Add aggregate_and_plot.py that for now only prints the contents of input.txt
cwlVersion: v1.0
class: CommandLineTool
requirements:
- class: DockerRequirement
dockerPull: git.astron.nl:5000/ldv/imaging_compress_pipeline:v0.4.1
baseCommand: python3
arguments:
- /src/aggregate_and_plot.py
inputs: {}
outputs: []
......@@ -9,7 +9,7 @@ logging.basicConfig(format=FORMAT, level="INFO")
if __name__ == "__main__":
h5_paths = []
with open("inputs.txt", "r") as file:
with open("/mnt/workdir/inputs.txt", "r") as file:
for line in file:
line = str(line.strip()) # remove white space
path = Path(line)
......@@ -23,11 +23,11 @@ if __name__ == "__main__":
logging.info(f"Could not find the following input file: {line}")
logging.info(f"Found {len(h5_paths)} h5 files")
h5_output_path = "inspect.h5"
h5_output_path = "/mnt/workdir/inspect.h5"
join_inspect_ds(h5_paths, h5_output_path)
plot_paths = plot_inspect_ds(h5_output_path, "./", min_elevation=15)
plot_paths = plot_inspect_ds(h5_output_path, "/mnt/workdir", min_elevation=15)
with open("outputs.txt", "w") as file:
with open("/mnt/workdir/outputs.txt", "w") as file:
file.write(str(Path(h5_output_path).absolute()) + "\n")
for file_path in plot_paths:
path = Path(file_path).absolute()
......
#!/usr/bin/sh
if [ -d "toil_venv" ]; then
echo "Activating existing virtual environment."
source toil_venv/bin/activate
else
echo "Creating new virtual environment for using toil"
python3.11 -m venv toil_venv
source toil_venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install toil[cwl] singularity
fi
export SINGULARITY_BIND="$PWD:/mnt/workdir,/project:/project"
toil-cwl-runner --singularity imaging_compress_pipeline.git/aggregate_and_plot.cwl
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment