Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: image.fitsky - Function Up: image - Tool Previous: image.fitprofile - Function


image.fitpolynomial - Function



Package general
Module images
Tool image


Fit 1-dimensional polynomials to profiles


Synopsis
fitpolynomial(residfile, fitfile, sigmafile, axis, order, region, mask, overwrite)


Arguments

residfile in Output fitted residuals image file name
    Allowed: String or unset
    Default: unset
fitfile in Output fitted image file name
    Allowed: String or unset
    Default: unset
sigmafile in Input weights image for fitting
    Allowed: String or unset
    Default: unset
axis in The profile axis to fit
    Allowed: Integer or unset
    Default: Spectral axis if exists else last
order in The order of the polynomial
    Allowed: Integer or unset
    Default: 0
region in The region of interest
    Allowed: Region tool
    Default: Whole image
mask in OTF mask
    Allowed: Boolean LEL expression or mask region
    Default: None
overwrite in Overwrite (unprompted) pre-existing output files ?
    Allowed: T or F
    Default: F


Returns
Image tool or fail


Description

This function fits 1-dimensional polynomials to profiles and subtracts the fits. You specify the order of the polynomial via the order argument. The returned Image tool holds the residual image. You can optionally also write out the fitted image.

The output mask is a copy of the default input pixel mask (if any); the OTF mask does not contribute to the output mask. Any other input pixel masks will not be copied. Use function maskhandler if you need to copy other masks too. Use function calcmask if you need to apply the OTF mask to the output.



Example
- myim := image('hcn')
- myim2 := myim.fitpolynomial(order=2, axis=3)      # Image tool is virtual



Example
- myim := image('hcn')
- mask := 'indexin(3, [1:20, 30, 35, 50:60, 90:128])'        # Specify pixels to fit via mask on 
- myim2 := myim.fitpolynomial(order=2, mask=mask, axis=3)    # axis 3

This example could be thought of, for example, as an image-based continuum substraction. You specify the axis and the pixels where the spectrum is line free (continuum), do the fit and write out the residual (continuum subtracted) image.





next up previous contents index
Next: image.fitsky - Function Up: image - Tool Previous: image.fitprofile - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01