Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/linearmosaic.py: 65%
23 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
1##################### generated by xml-casa (v2) from linearmosaic.xml ##############
2##################### d7d8ecd70c999ac89b3abe88fb91689c ##############################
3from __future__ import absolute_import
4from .__casac__.linearmosaic import linearmosaic as _linearmosaic
6from .errors import create_error_string
7from .typecheck import CasaValidator as _validator
8_pc = _validator( )
9from .coercetype import coerce as _coerce
12class linearmosaic:
13 _info_group_ = """linearmosaic"""
14 _info_desc_ = """combining images in a weighted fashion"""
15 ### self
16 def __init__(self, *args, **kwargs):
17 """Create a {tt linearmosaic} tool.
18 """
19 self._swigobj = kwargs.get('swig_object',None)
20 if self._swigobj is None:
21 self._swigobj = _linearmosaic()
23 def defineoutputimage(self, nx=int(128), ny=int(-1), cellx=[ ], celly=[ ], imagecenter=[ ], outputimage='', outputweight=''):
24 """Define the direction axes output image parameters.
25 The output image will get the same number of spectral and polarization planes as the input images. This function create a fresh new output image. If an image of the same name exist on disk it will be erased. The spectral and polarization part of the image will be identical to the images that are being mosaiced.
27 The output image will by default be flux correct and the weight image will be ${sum_p A_p^2(theta)}$ where the primary beam is $ A_p(theta)$
28 """
29 return self._swigobj.defineoutputimage(nx, ny, cellx, celly, imagecenter, outputimage, outputweight)
31 def setoutputimage(self, outputimage='', outputweight='', imageweighttype=int(1), weighttype=int(1)):
32 """Use this function if the mosaicing is to be done onto a previous mosaic or image. For now the stokes and spectral characteristic of the images to be mosaic and the output image has to be similar (i.e the user has to regrid them prior to linearmosaic if necessary).
33 The weightimage represents the sensitivity image of the image (for example the weighted primary beam coverage of a mosaic)
35 {tt imageweighttype} parameter:
37 If the image is of the type that has been normalized to be flux correct then the imageweighttype should 0.
38 If the image has been apodized by a primary beam then imageweighttype should be 1
39 and if the image is multiplied by $PB^2$ then it should be 2.
41 {tt weighttype} parameter:
42 This should be 1 if the weight image is the sum of Primary beams or equivalent
43 and it should be 2 if it is the sum of of $PB^2$
44 """
45 return self._swigobj.setoutputimage(outputimage, outputweight, imageweighttype, weighttype)
47 def saultweightimage(self, outputimage='', fracpeak=float(0.1)):
48 """"Sault weighted" image is one which is more pleasant to view (without high noise at the edges of mosaic images), it is flux correct upto a where the beam coverage becomes low and is tapered off onwards just to keep the noise from rising in the overall image(see Eq[2] from Sault, Staveley-Smith and Brouw (1996), Astron. Astrophys. Suppl, 120, 375)
49 """
50 return self._swigobj.saultweightimage(outputimage, fracpeak)
52 def setlinmostype(self, linmostype='optimal'):
53 """Use this function if the mosaicing is to be done using a non optimal weighting mode.
56 For now {tt optimal} (which is the default) follows this equation
57 begin{equation}
58 I^{lm}(theta)={{sum_p A_p(theta)(I_p(theta)A_p(theta))w_p}over{sum_p A_p^2(theta)w_p}}
59 end{equation}
61 And {tt pbweight} follows this one
62 begin{equation}
63 I^{lm}(theta)={{sum_p (I_p(theta)A_p(theta))w_p}over{sum_p A_p(theta)w_p}}
64 end{equation}
66 where $A_p(theta)$ is the primary beam (PB) of a given pointing $p$, $w_p$ is a sensitivity weight and the image of that pointing is $I_p(theta)$; the linear mosaic being $I^{lm}(theta)$
67 For now $w_p=1$
68 """
69 return self._swigobj.setlinmostype(linmostype)
71 def makemosaic(self, images=[ ], weightimages=[ ], imageweighttype=int(1), weighttype=int(1)):
72 """Put the list of images onto the mosaic image using the weight images
73 """
74 return self._swigobj.makemosaic(images, weightimages, imageweighttype, weighttype)