aboutsummaryrefslogtreecommitdiffstats
path: root/astro
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-09-04 12:58:04 +0800
committerAaron LI <aly@aaronly.me>2017-09-04 12:58:04 +0800
commitddd21e85176114e896eb68d8f10cd13120801519 (patch)
tree5a72e6551612dc885113b9de4d8c356ff19cd223 /astro
parent681a0fbc5df573583f17f508ee085cd49086b18a (diff)
downloadatoolbox-ddd21e85176114e896eb68d8f10cd13120801519.tar.bz2
fits2skymodel.py: Update logging messages
Diffstat (limited to 'astro')
-rwxr-xr-xastro/oskar/fits2skymodel.py11
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: