From 1b7be103d847011f5c4cd810f68804f0a40ff39f Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 5 Dec 2017 11:09:20 +0800 Subject: astro/fitscube.py: Add --abs argument to "info" sub-command --- astro/fits/fitscube.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'astro') diff --git a/astro/fits/fitscube.py b/astro/fits/fitscube.py index 13d9be0..bdaca11 100755 --- a/astro/fits/fitscube.py +++ b/astro/fits/fitscube.py @@ -234,6 +234,8 @@ def cmd_info(args): std = np.zeros(cube.nslice) for i in range(cube.nslice): image = cube.get_slice(i, csize=args.center) + if args.abs: + image = np.abs(image) mean[i] = np.mean(image) std[i] = np.std(image) print("Slice +/- :") @@ -274,6 +276,8 @@ def main(): parser_info.add_argument("-m", "--mean-std", dest="meanstd", action="store_true", help="calculate mean+/-std for each slice") + parser_info.add_argument("-a", "--abs", dest="abs", action="store_true", + help="take absolute values for image pixels") parser_info.add_argument("-o", "--outfile", dest="outfile", help="outfile to save mean/std values") parser_info.add_argument("infile", help="FITS cube filename") -- cgit v1.2.2