Source
xxxxxxxxxx
Also adding a beam auto matically sets beamminor and beampa, those values cannot be all chosen using add
##########################################################################
# test_task_imhead.py
#
# Copyright (C) 2018
# Associated Universities, Inc. Washington DC, USA.
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# [Add the link to the JIRA ticket here once it exists]
#
# Based on the requirements listed in plone found here:
# https://casadocs.readthedocs.io/en/stable/api/tt/casatasks.analysis.imhead.html
#
#
##########################################################################
import sys
import os
import unittest
import shutil
import numpy as np
import re
import casatools
from casatasks import casalog, imhead, rmtables, immoments
image = casatools.image
_qa = casatools.quanta()
_tb = casatools.table()
ctsys_resolve = casatools.ctsys.resolve
datapath = ctsys_resolve('unittest/imhead/')
impath = os.path.join(datapath,'ngc5921.clean.imhead.image')
logfile = casalog.logfile()
datacopy = 'clean.image'
testlog = 'testlog.log'
newlog = 'casa_new.log'
cas4355 = 'cas4355.im'
cas6352 = 'CAS-6352.im'
cas5901 = 'CAS-5901.im'
ncpim = 'ncp_proj.im'
cas6727 = 'CAS-6727.im'
cas8095 = 'CAS-8095.im'
myfits = "reorder_in.fits"
cas8500 = 'CAS-8500.im'
cas8500mom = 'CAS-8500_mom.im'
zz = 'zz.im'
expectedKeys = [
'beammajor', 'beamminor', 'beampa', 'bunit', 'cdelt1', 'cdelt2', 'cdelt3', 'cdelt4',
'crpix1', 'crpix2', 'crpix3', 'crpix4', 'crval1', 'crval2', 'crval3', 'crval4',
'ctype1', 'ctype2', 'ctype3', 'ctype4', 'cunit1', 'cunit2', 'cunit3', 'cunit4',
'datamax', 'datamin', 'date-obs', 'equinox', 'imtype', 'masks', 'maxpixpos',
'maxpos', 'minpixpos', 'minpos', 'object', 'observer', 'projection', 'reffreqtype',
'restfreq', 'shape', 'telescope'
]