diff options
author | Aaron LI <aly@aaronly.me> | 2017-09-04 12:58:04 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-09-04 12:58:04 +0800 |
commit | ddd21e85176114e896eb68d8f10cd13120801519 (patch) | |
tree | 5a72e6551612dc885113b9de4d8c356ff19cd223 /astro | |
parent | 681a0fbc5df573583f17f508ee085cd49086b18a (diff) | |
download | atoolbox-ddd21e85176114e896eb68d8f10cd13120801519.tar.bz2 |
fits2skymodel.py: Update logging messages
Diffstat (limited to 'astro')
-rwxr-xr-x | astro/oskar/fits2skymodel.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/astro/oskar/fits2skymodel.py b/astro/oskar/fits2skymodel.py index e5b2ea3..ff83fa1 100755 --- a/astro/oskar/fits2skymodel.py +++ b/astro/oskar/fits2skymodel.py @@ -36,7 +36,9 @@ import astropy.units as au from astropy.wcs import WCS -logging.basicConfig(level=logging.INFO) +logging.basicConfig(level=logging.INFO, + format="%(asctime)s [%(levelname)s] %(message)s", + datefmt="%H:%M:%S") logger = logging.getLogger(os.path.basename(sys.argv[0])) @@ -261,14 +263,15 @@ def main(): with fits.open(args.infile) as f: image = f[0].data header = f[0].header - logger.info("Read image slice: %s" % args.infile) + logger.info("Read input FITS image: %s" % args.infile) # Check data unit unit = header.get("BUNIT") if unit is None: - logger.warning("input FITS file of unknown data unit!") + logger.warning("Input FITS file of unknown data unit! " + + "Assuming [K] (kelvin)!") elif unit.upper() not in ["K", "KELVIN"]: - logger.error("input FITS file of wrong data unit: %s" % unit) + logger.error("Input FITS file of wrong data unit: %s" % unit) freq = args.freq if args.freq else header["FREQ"] # [MHz] if args.pixelsize: |