from __future__ import absolute_import
from casatasks.private.casa_transition import is_CASA6
from casatools import imager
from casatasks import casalog
def feather(imagename=None,highres=None,lowres=None, sdfactor=None, effdishdiam=None, lowpassfiltersd=None):
""" Feathering: Combine two images using the Fourier Addition:
The algorithm converts each image to the gridded visibility
plane, combines them, and reconverts them into an combined
image. The images must have a well-defined beam shape (clean beam),
given in the image, in order for feathering to work well.
The two images must be on the same grid and have the same
flux density normalization scale.
imagename -- Name of output feathered image
default: none; example: imagename='orion_combined'
highres -- Name of high resolution (interferometer) image
default: none; example: imagename='orion_vla.im'
This image is often a clean image obtained from synthesis
lowres -- Name of low resolution (single dish) image
default: none; example: imagename='orion_gbt.im'
This image is often a image from a single-dish observations
or a clean image obtained from a lower resolution synthesis
casalog.origin('feather')
imFea.setsdoptions(scale=sdfactor)
imFea.feather(image=imagename,highres=highres,lowres=lowres,
effdishdiam=effdishdiam, lowpassfiltersd=lowpassfiltersd)