aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xastro/ps2d.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/astro/ps2d.py b/astro/ps2d.py
index c8a4620..718b59a 100755
--- a/astro/ps2d.py
+++ b/astro/ps2d.py
@@ -533,6 +533,9 @@ def main():
help="output 2D power spectrum FITS file")
args = parser.parse_args()
+ if (not args.clobber) and os.path.exists(args.outfile):
+ raise OSError("outfile '%s' already exists" % args.outfile)
+
with fits.open(args.infile[0]) as f:
cube = f[0].data
header = f[0].header