Source
xxxxxxxxxx
+"\nError: Bad region file, 'garbage.rgn', was not reported as missing."
##########################################################################
# test_imsmooth.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.
#
# Based on the requirements listed in casadocs found here:
# https://casadocs.readthedocs.io/en/stable/api/tt/casatasks.analysis.imsmooth.html
#
#
##########################################################################
import random
import os
import numpy
import shutil
import unittest
import math
from casatools import ctsys, image, regionmanager, componentlist, table, quanta
from casatasks import imsmooth, casalog, imsubimage
_ia = image()
_rg = regionmanager()
_tb = table()
_qa = quanta()
ctsys_resolve = ctsys.resolve
datapath = ctsys_resolve('unittest/imsmooth/')
targetres_im = "imsmooth_targetres.fits"
tiny = "tiny.im"
image_names=['g192_a2.image', 'g192_a2.image-2.rgn']
def _near(got, expected, tol):
return _qa.le(
_qa.div(
_qa.abs(_qa.sub(got, expected)),
expected
),
tol
)
def run_imsmooth(
imagename, major, minor, pa, targetres,
outfile, kernel="gauss", overwrite=False, beam={}
):
return imsmooth(
imagename=imagename, kernel=kernel,
major=major, minor=minor, pa=pa,
targetres=targetres, outfile=outfile,
overwrite=overwrite, beam=beam
)