diff options
author | Aaron LI <aly@aaronly.me> | 2017-12-05 11:09:20 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-12-05 11:09:20 +0800 |
commit | 1b7be103d847011f5c4cd810f68804f0a40ff39f (patch) | |
tree | be702e2c5794da01ebb48c3a917d6ef45ff616fb /astro/fits | |
parent | 0bb53d7565b00d27e2a0d5c8bd949586b344cfcb (diff) | |
download | atoolbox-1b7be103d847011f5c4cd810f68804f0a40ff39f.tar.bz2 |
astro/fitscube.py: Add --abs argument to "info" sub-command
Diffstat (limited to 'astro/fits')
-rwxr-xr-x | astro/fits/fitscube.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 <z> <mean> +/- <std>:") @@ -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") |