aboutsummaryrefslogtreecommitdiffstats
path: root/astro
diff options
context:
space:
mode:
Diffstat (limited to 'astro')
-rwxr-xr-xastro/oskar/fits2skymodel.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/astro/oskar/fits2skymodel.py b/astro/oskar/fits2skymodel.py
index 46fe883..cc66092 100755
--- a/astro/oskar/fits2skymodel.py
+++ b/astro/oskar/fits2skymodel.py
@@ -264,6 +264,14 @@ def main():
image = f[0].data
header = f[0].header
logger.info("Read image slice: %s" % args.infile)
+
+ # Check data unit
+ unit = header.get("BUNIT")
+ if unit is None:
+ logger.warning("input FITS file of unknown data unit!")
+ elif unit.upper() not in ["K", "KELVIN"]:
+ logger.error("input FITS file of wrong data unit: %s" % unit)
+
freq = args.freq if args.freq else header["FREQ"] # [MHz]
if args.pixelsize:
pixelsize = args.pixelsize # [arcsec]