aboutsummaryrefslogtreecommitdiffstats
path: root/bin/zea2healpix
diff options
context:
space:
mode:
Diffstat (limited to 'bin/zea2healpix')
-rwxr-xr-xbin/zea2healpix10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/zea2healpix b/bin/zea2healpix
index 33cb694..334bf6d 100755
--- a/bin/zea2healpix
+++ b/bin/zea2healpix
@@ -76,14 +76,20 @@ def main():
'See also {0}'.format(fg21sim.__url__)
]
+ if os.path.exists(args.outfile):
+ if args.clobber:
+ logger.warning("Remove existing output file: %s" % args.outfile)
+ os.remove(args.outfile)
+ else:
+ raise OSError("Output file already exists: %s" % args.outfile)
+
hp_data, hp_header, __ = zea2healpix(args.infile1, args.infile2,
nside=args.nside,
order=args.interp_order,
inpaint=args.inpaint,
append_history=history,
append_comment=comments)
- write_fits_healpix(args.outfile, hpmap=hp_data, header=hp_header,
- clobber=args.clobber)
+ write_fits_healpix(args.outfile, hpmap=hp_data, header=hp_header)
logger.info("HEALPix data write to FITS file: %s" % args.outfile)