From db4e7563ac5bd9f7d981d170f1a163c49f0596a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Terr=C3=B3n?= Date: Wed, 3 Sep 2014 15:39:47 +0200 Subject: [PATCH] Show the percentage of selected and discarded images --- photometry.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/photometry.py b/photometry.py index 1e904bd..58ffa72 100644 --- a/photometry.py +++ b/photometry.py @@ -774,8 +774,14 @@ def get_date(img): return 1 else: - msg = "%s%d images taken in the above filters, %d were discarded." - print msg % (style.prefix, len(files), discarded) + former_total = len(files) + discarded + msg = "%s%d images (%.2f %%) taken in the above filters," + percentage = len(files) / former_total * 100 + print msg % (style.prefix, len(files), percentage) , + + msg = "%d (%.2f %%) were discarded." + percentage = discarded / former_total * 100 + print msg % (discarded, percentage) # If a JSON file is specified with --annuli, it must list the photometric # parameters for all the filters on which photometry is to be done.