aboutsummaryrefslogtreecommitdiffstats
path: root/bin/hpx2healpix
diff options
context:
space:
mode:
Diffstat (limited to 'bin/hpx2healpix')
-rwxr-xr-xbin/hpx2healpix10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/hpx2healpix b/bin/hpx2healpix
index ca485ac..bbc3e0d 100755
--- a/bin/hpx2healpix
+++ b/bin/hpx2healpix
@@ -60,11 +60,17 @@ 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 = hpx2healpix(args.infile,
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)