##################### generated by xml-casa (v2) from pmaxfit.xml ###################
##################### b3be0c8ff5a66315d1c40770a10aa871 ##############################
from __future__ import absolute_import
import numpy
from casatools.typecheck import CasaValidator as _val_ctor
from casatools.coercetype import coerce as _coerce
from .private.task_pmaxfit import pmaxfit as _pmaxfit_t
from casatasks.private.task_logging import start_log as _start_log
from casatasks.private.task_logging import end_log as _end_log
[docs]
class _pmaxfit:
"""
pmaxfit ---- Find maximum and do parabolic fit in the sky
PARAMETER SUMMARY
imagename Name of the input image
box Rectangular region(s) to select in direction plane. See "help par.box"
for details. Default is to use the entire direction plane.
eg "100, 120, 200, 220, 300, 300, 400, 400" to use two boxes.
OVERVIEW
This application finds the pixel with the maximum value in the region, and then uses function
findsources to generate a Componentlist with one component.
The method returns a dictionary with fours keys, 'succeeded', 'timestamps', 'imagenames'
and 'outputs'. The value of 'outputs' is a dictionary representing
a component list reflecting the fit results over multiple channels.
Both the 'outputs' dictionaries can be read into a component list tool (default tool is named cl)
using the fromrecord() method for easier inspection using tool methods, eg
FITTING OVER MULTIPLE CHANNELS
For fitting over multiple channels, the result of the previous successful fit is used as
the estimate for the next channel. The number of gaussians fit cannot be varied on a channel
by channel basis. Thus the variation of source structure should be reasonably smooth in
frequency to produce reliable fit results.
--------- parameter descriptions ---------------------------------------------
imagefiles A list of the input images
ncpu Number of cpu cores to use
box Rectangular region(s) to select in direction plane. See "help par.box" for details. Default is to use the entire direction plane.
width Half-width of fit grid
[1;42mRETURNS[1;m void
--------- examples -----------------------------------------------------------
EXAMPLE:
Here is how one might fit two gaussians to multiple channels of a cube using the fit
from the previous channel as the initial estimate for the next. It also illustrates
how one can specify a region in the associated continuum image as the region to use
as the fit for the channel.
begin{verbatim}
default pmaxfit
imagename = "co_cube.im"
# specify region using region from continuum
box = "100,120,200,200"
pmaxfit()
"""
[docs]
_info_group_ = """analysis"""
[docs]
_info_desc_ = """Find maximum and do parabolic fit in the sky"""
[docs]
def __call__( self, imagefiles=[ ], ncpu=int(8), box='', width=int(5) ):
schema = {'imagefiles': {'type': 'cReqPathVec', 'coerce': [_coerce.to_list,_coerce.expand_pathvec]}, 'ncpu': {'type': 'cInt'}, 'box': {'type': 'cStr', 'coerce': _coerce.to_str}, 'width': {'type': 'cInt'}}
doc = {'imagefiles': imagefiles, 'ncpu': ncpu, 'box': box, 'width': width}
assert _pc.validate(doc,schema), str(_pc.errors)
_logging_state_ = _start_log( 'pmaxfit', [ 'imagefiles=' + repr(_pc.document['imagefiles']), 'ncpu=' + repr(_pc.document['ncpu']), 'box=' + repr(_pc.document['box']), 'width=' + repr(_pc.document['width']) ] )
return _end_log( _logging_state_, 'pmaxfit', _pmaxfit_t( _pc.document['imagefiles'], _pc.document['ncpu'], _pc.document['box'], _pc.document['width'] ) )