From ddd21e85176114e896eb68d8f10cd13120801519 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 4 Sep 2017 12:58:04 +0800 Subject: fits2skymodel.py: Update logging messages --- astro/oskar/fits2skymodel.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'astro') 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: -- cgit v1.2.2