From eff91749d95139063c88c5161aeafba6c11ef3d6 Mon Sep 17 00:00:00 2001 From: Chris Schnaufer Date: Mon, 11 Nov 2019 11:01:30 -0700 Subject: [PATCH] Readme and return type changes (#1) * Fixed a wrong comment/docstring * Adding to README * Fixing filename extension * Some fixes and updates to README * Fixing up return type --- README.md | 34 ++++++++++++++++++++++++++++++++++ transformer.py | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7067b8f..b111268 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,40 @@ Stereo RGB Image Bin to GeoTIFF Converter. +### Sample Docker Command line +Below is a sample command line that shows how the bin2tif Docker image could be run. +An explanation of the command line options used follows. +Be sure to read up on the [docker run](https://docs.docker.com/engine/reference/run/) command line for more information. + +```docker run --rm --mount "src=/home/test,target=/mnt,type=bind" agpipeline/bin2tif:2.0 --working_space "/mnt" --metadata "/mnt/08f445ef-b8f9-421a-acf1-8b8c206c1bb8_metadata_cleaned.json" "/mnt/08f445ef-b8f9-421a-acf1-8b8c206c1bb8_left.bin" ``` + +This example command line assumes the source files are located in the `/home/test` folder of the local machine. +The name of the image to run is `agpipeline/bin2tif:2.0`. + +We are using the same folder for the source files and the output files. +By using multiple `--mount` options, the source and output files can be located in separate folders. + +**Docker commands** \ +Everything between 'docker' and the name of the image are docker commands. + +- `run` indicates we want to run an image +- `--rm` automatically delete the image instance after it's run +- `--mount "src=/home/test,target=/mnt,type=bind"` mounts the `/home/test` folder to the `/mnt` folder of the running image + +We mount the `/home/test` folder to the running image to make files available to the software in the image. + +**Image's commands** \ +The command line parameters after the image name are passed to the software inside the image. +Note that the paths provided are relative to the running image (see the --mount option specified above). + +- `--working_space "/mnt"` specifies the folder to use as a workspace +- `--metadata "/mnt/08f445ef-b8f9-421a-acf1-8b8c206c1bb8_metadata.cleaned.json"` is the name of the source metadata to be cleaned +- `"/mnt/08f445ef-b8f9-421a-acf1-8b8c206c1bb8_left.bin"` is the name of the raw image to convert + +# Original README +Below are the contents of the original README.md for the TERRA REF project. +It is included here as reference material for the history of this transformer. + ## Authors: * Zongyang Li, Donald Danforth Plant Science Center, St. Louis, MO diff --git a/transformer.py b/transformer.py index d7a29d9..85c83a5 100644 --- a/transformer.py +++ b/transformer.py @@ -21,12 +21,12 @@ def add_parameters(parser: argparse.ArgumentParser) -> None: help='saves the intermediate image file before it\'s saved as a geotiff') # pylint: disable=unused-argument -def check_continue(transformer: transformer_class.Transformer, check_md: dict, transformer_md: dict, full_md: dict) -> list: +def check_continue(transformer: transformer_class.Transformer, check_md: dict, transformer_md: dict, full_md: dict) -> tuple: """Checks if conditions are right for continuing processing Arguments: transformer: instance of transformer class Return: - Returns a dictionary containining the return code for continuing or not, and + Returns a tuple containining the return code for continuing or not, and an error message if there's an error """ have_file = False