From d93625ab48460e3dea0e63607c869ba5feddfae2 Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Mon, 13 Nov 2017 20:48:33 +1100 Subject: [PATCH 1/3] * Exit with code 127 if solve-field not found * Catch error from python and show appropriate message --- pocs/utils/images.py | 3 +++ scripts/solve_field.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pocs/utils/images.py b/pocs/utils/images.py index 8c35916f1..b2e23f152 100644 --- a/pocs/utils/images.py +++ b/pocs/utils/images.py @@ -137,6 +137,9 @@ def get_solve_field(fname, replace=True, remove_extras=True, **kwargs): proc.kill() raise error.Timeout("Timeout while solving") else: + if proc.returncode == 127: + raise error.SolveError('solve-field not found: {}'.format(output)) + if verbose: print("Output: {}", output) print("Errors: {}", errs) diff --git a/scripts/solve_field.sh b/scripts/solve_field.sh index 05578e9a1..f683105a1 100755 --- a/scripts/solve_field.sh +++ b/scripts/solve_field.sh @@ -6,7 +6,7 @@ then echo 2>&1 "" echo 2>&1 "Please install astrometry into ${PANDIR}/astrometry to enable $0" echo 2>&1 "" - exit 1 + exit 127 # Command not found fi if [[ $# == 1 ]]; then From 66442db23d048260826401134275223af7df3b39 Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Tue, 14 Nov 2017 20:08:05 +1100 Subject: [PATCH 2/3] Wnat to force matplotlib 2.0.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d7a63b628..f88b758f2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ astropy >= 2.0.0 pymongo >= 3.2.2 coloredlogs >= 5.0 -matplotlib >= 1.5.1 +matplotlib >= 2.0.0 pandas >= 0.18.0 pytest >= 2.8.5 scikit_image >= 0.12.3 From c886b32ae86a70813cac6ffdaf2a294768ecc82d Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Thu, 16 Nov 2017 16:05:40 +1100 Subject: [PATCH 3/3] * Changing to more appropriate error code for missing `solve-field` * Reversing the change to matplotlib which should be in a separate issue --- pocs/utils/images.py | 2 +- requirements.txt | 2 +- scripts/solve_field.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pocs/utils/images.py b/pocs/utils/images.py index b2e23f152..0f8e9126b 100644 --- a/pocs/utils/images.py +++ b/pocs/utils/images.py @@ -137,7 +137,7 @@ def get_solve_field(fname, replace=True, remove_extras=True, **kwargs): proc.kill() raise error.Timeout("Timeout while solving") else: - if proc.returncode == 127: + if proc.returncode == 3: raise error.SolveError('solve-field not found: {}'.format(output)) if verbose: diff --git a/requirements.txt b/requirements.txt index f88b758f2..d7a63b628 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ astropy >= 2.0.0 pymongo >= 3.2.2 coloredlogs >= 5.0 -matplotlib >= 2.0.0 +matplotlib >= 1.5.1 pandas >= 0.18.0 pytest >= 2.8.5 scikit_image >= 0.12.3 diff --git a/scripts/solve_field.sh b/scripts/solve_field.sh index f683105a1..93ffad73a 100755 --- a/scripts/solve_field.sh +++ b/scripts/solve_field.sh @@ -6,7 +6,7 @@ then echo 2>&1 "" echo 2>&1 "Please install astrometry into ${PANDIR}/astrometry to enable $0" echo 2>&1 "" - exit 127 # Command not found + exit 3 # Command not found fi if [[ $# == 1 ]]; then