from __future__ import absolute_import
from numpy import cos, sin, sqrt
import scipy.optimize as optimize
import scipy.special as spspec
from casatasks import casalog
from casatools import quanta
The class to derive the theoretical beam size of an image.
bu = sdbeamutil.TheoreticalBeam()
# set imaging, antenna, and pointing informations
bu.set_antenna('12m',blockage='0.75m',taper=10)
bu.set_sampling(['12arcsec','12arcsec'])
bu.set_image_param('5arcsec', '115GHz','SF', 6, -1, -1, -1)
# print summary of setup to logger
# get theoretical beam size of an image.
beam = bu.get_beamsize_image()
self.is_antenna_set = False
self.is_kernel_set = False
self.is_sampling_set = False
self.antenna_diam_m = -1.
self.antenna_block_m = 0.0
self.sampling_arcsec = []
def __to_arcsec_list(self, angle):
"""Return a list of angles in arcsec (value only without unit)."""
if type(angle) not in [list, tuple, np.ndarray]:
return [self.__to_arcsec(val) for val in angle]
def __to_arcsec(self, angle):
"""Convert angle to arcsec and return the value without unit."""
return my_qa.getvalue(my_qa.convert(angle, "arcsec"))[0]
elif my_qa.getunit(angle) == '':
raise ValueError("Invalid angle: %s" % (str(angle)))
def __parse_width(self, val, cell_size_arcsec):