Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/feather.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
1##################### generated by xml-casa (v2) from feather.xml ###################
2##################### 4522695859f175b9c2dc5bdc50749847 ##############################
3from __future__ import absolute_import
4import numpy
5from casatools.typecheck import CasaValidator as _val_ctor
6_pc = _val_ctor( )
7from casatools.coercetype import coerce as _coerce
8from casatools.errors import create_error_string
9from .private.task_feather import feather as _feather_t
10from casatasks.private.task_logging import start_log as _start_log
11from casatasks.private.task_logging import end_log as _end_log
12from casatasks.private.task_logging import except_log as _except_log
14class _feather:
15 """
16 feather ---- Combine two images using their Fourier transforms
19 This task can be used as one method of combining single-dish and
20 interferometric images after they have been separately made.
22 The algorithm converts each image to the gridded visibility plane,
23 combines them, and reconverts them into an combined image. Each image
24 must include a well-defined beam shape (clean beam) in order for
25 feathering to work well. The two images must have the same flux
26 density normalization scale.
28 --------- parameter descriptions ---------------------------------------------
30 imagename Name of output feathered image
31 Default: none
33 Example: imagename='orion_combined.im'
34 highres Name of high resolution (interferometer) image
35 Default: none
37 Example: imagename='orion_vla.im'
38 lowres Name of low resolution (single dish) image
39 Default: none
41 Example: imagename='orion_gbt.im'
42 sdfactor Value by which to scale the Single Dish image.
43 Default: 1.0
45 Basically modifying the flux scale of the SD image
46 effdishdiam New effective SingleDish diameter to use in m
47 Default: -1.0 (leave as is)
49 Obviously one can only reduce the dish
50 effective dish diameter in feathering.
51 lowpassfiltersd Filter out the high spatial frequencies of the SD image
52 Default: False
54 If True the high spatial frequency in the SD
55 image is rejected.
57 Any data outside the maximum uv distance
58 that the SD has illuminated is filtered
59 out.
61 --------- examples -----------------------------------------------------------
65 For more information, see the task pages of feather in CASA Docs:
67 https://casa.nrao.edu/casadocs/
70 """
72 _info_group_ = """imaging"""
73 _info_desc_ = """Combine two images using their Fourier transforms"""
75 def __call__( self, imagename='', highres='', lowres='', sdfactor=float(1.0), effdishdiam=float(-1.0), lowpassfiltersd=False ):
76 schema = {'imagename': {'type': 'cStr', 'coerce': _coerce.to_str}, 'highres': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'lowres': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'sdfactor': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'effdishdiam': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'lowpassfiltersd': {'type': 'cBool'}}
77 doc = {'imagename': imagename, 'highres': highres, 'lowres': lowres, 'sdfactor': sdfactor, 'effdishdiam': effdishdiam, 'lowpassfiltersd': lowpassfiltersd}
78 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
79 _logging_state_ = _start_log( 'feather', [ 'imagename=' + repr(_pc.document['imagename']), 'highres=' + repr(_pc.document['highres']), 'lowres=' + repr(_pc.document['lowres']), 'sdfactor=' + repr(_pc.document['sdfactor']), 'effdishdiam=' + repr(_pc.document['effdishdiam']), 'lowpassfiltersd=' + repr(_pc.document['lowpassfiltersd']) ] )
80 task_result = None
81 try:
82 task_result = _feather_t( _pc.document['imagename'], _pc.document['highres'], _pc.document['lowres'], _pc.document['sdfactor'], _pc.document['effdishdiam'], _pc.document['lowpassfiltersd'] )
83 except Exception as exc:
84 _except_log('feather', exc)
85 raise
86 finally:
87 task_result = _end_log( _logging_state_, 'feather', task_result )
88 return task_result
90feather = _feather( )