casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
casa::ImageAnalysis Class Reference

Image analysis and handling tool. More...

#include <ImageAnalysis.h>

List of all members.

Public Member Functions

 ImageAnalysis ()
 ImageAnalysis (const ImageInterface< Float > *inImage)
 ImageInterface constructor.
 ImageAnalysis (ImageInterface< Float > *inImage, const Bool cloneInputPointer)
 Use this constructor with cloneInputPointer=False if you want this object to take over management of the input pointer.
virtual ~ImageAnalysis ()
Bool addnoise (const String &type, const Vector< Double > &pars, Record &region, const Bool zero=False)
ImageInterface< Float > * imagecalc (const String &outfile, const String &pixels, const Bool overwrite=False)
ImageInterface< Float > * imageconcat (const String &outfile, const Vector< String > &infiles, const Int axis, const Bool relax=False, const Bool tempclose=True, const Bool overwrite=False)
Bool imagefromarray (const String &outfile, Array< Float > &pixels, const Record &csys, const Bool linear=False, const Bool overwrite=False, const Bool log=True)
Bool imagefromascii (const String &outfile, const String &infile, const Vector< Int > &shape, const String &sep, const Record &csys, const Bool linear=False, const Bool overwrite=False)
Bool imagefromfits (const String &outfile, const String &infile, const Int whichrep=0, const Int whichhdu=0, const Bool zeroblanks=False, const Bool overwrite=False)
Bool imagefromimage (const String &outfile, const String &infile, Record &region, const String &mask, const Bool dropdeg=False, const Bool overwrite=False)
Bool imagefromshape (const String &outfile, const Vector< Int > &shape, const Record &csys, const Bool linear=True, const Bool overwrite=False, const Bool log=True)
ImageInterface< Float > * convolve (const String &outfile, Array< Float > &kernel, const String &kernImage, const Double scale, Record &region, String &mask, const Bool overwrite=False, const Bool async=False, const Bool stretch=False)
Recordboundingbox (const Record &region)
String brightnessunit ()
Bool calc (const String &pixels)
Bool calcmask (const String &mask, Record &regions, const String &name, const Bool asdefault=True)
 regions should be a Record of Records having different regions
ImageInterface< Float > * continuumsub (const String &outline, const String &outcont, Record &region, const Vector< int > &channels, const String &pol="", const Int fitorder=0, const Bool overwrite=false)
Quantity convertflux (Bool &fakeBeam, const Quantity &value, const Quantity &major, const Quantity &minor, const String &type="Gaussian", const Bool topeak=True, const Bool supressNoBeamWarnings=False, const Int channel=-1, const Int polarization=-1) const
*ImageInterface< Float > * convolve2d (const String &outfile, const Vector< Int > &axes, const String &type, const Quantity &major, const Quantity &minor, const Quantity &pa, Double scale, Record &region, const String &mask, const Bool overwrite=False, const Bool stretch=False, const Bool targetres=False)
CoordinateSystem coordsys (const Vector< int > &axes)
CoordinateSystem csys (const Vector< int > &axes)
Recordcoordmeasures (Quantity &intensity, Record &direction, Record &frequency, Record &velocity, const Vector< double > &pixel)
Matrix< Floatdecompose (Record &region, const String &mask, const Bool simple=false, const Double threshold=-1, const Int ncontour=11, const Int minrange=1, const Int naxis=2, const Bool fit=True, const Double maxrms=-1, const Int maxretry=-1, const Int maxiter=256, const Double convcriteria=0.0001)
Matrix< Floatdecompose (Matrix< Int > &blcs, Matrix< Int > &trcs, Record &region, const String &mask, const Bool simple=false, const Double threshold=-1, const Int ncontour=11, const Int minrange=1, const Int naxis=2, const Bool fit=True, const Double maxrms=-1, const Int maxretry=-1, const Int maxiter=256, const Double convcriteria=0.0001, const Bool stretch=False)
Record deconvolvecomponentlist (const Record &complist, const Int channel, const Int polarization)
Bool remove (Bool verbose=true)
Bool fft (const String &real, const String &imag, const String &amp, const String &phase, const Vector< Int > &axes, Record &region, const String &mask, const Bool stretch)
Record findsources (const Int nmax, const Double cutoff, Record &region, const String &mask, const Bool point=True, const Int width=5, const Bool negfind=False)
Bool getchunk (Array< Float > &pixel, Array< Bool > &pixmask, const Vector< Int > &blc, const Vector< Int > &trc, const Vector< Int > &inc, const Vector< Int > &axes, const Bool list=False, const Bool dropdeg=False, const bool getmask=False)
Bool getregion (Array< Float > &pixels, Array< Bool > &pixmask, Record &region, const Vector< Int > &axes, const String &mask, const Bool list=False, const Bool dropdeg=False, const Bool getmask=False, const Bool extendMask=False)
Recordgetslice (const Vector< Double > &x, const Vector< Double > &y, const Vector< Int > &axes, const Vector< Int > &coord, const Int npts=0, const String &method="linear")
ImageInterface< Float > * hanning (const String &outfile, Record &region, const String &mask, const Int axis=-10, const Bool drop=True, const bool overwrite=False, const Bool extendMask=True)
Vector< Boolhaslock ()
Record histograms (const Vector< Int > &axes, Record &region, const String &mask, const Int nbins, const Vector< Double > &includepix, const Bool gauss, const Bool cumu, const Bool log, const Bool list, const Bool force=False, const Bool disk=False, const Bool extendMask=False)
Vector< Stringhistory (const Bool list=False, const Bool browse=True)
Bool insert (const String &infile, Record &region, const Vector< double > &locate, Bool verbose)
Bool ispersistent ()
 Bool isopen();.
Bool lock (const Bool writelock=False, const Int nattempts=0)
Bool makecomplex (const String &outfile, const String &imag, Record &region, const Bool overwrite=False)
Vector< Stringmaskhandler (const String &op, const Vector< String > &nam)
Record miscinfo ()
Bool modify (Record &model, Record &region, const String &mask, const Bool subtract=True, const Bool list=True, const Bool extendMask=False)
Record maxfit (Record &region, const Bool point, const Int width=5, const Bool negfind=False, const Bool list=True)
ImageInterface< Float > * moments (const Vector< Int > &moments, const Int axis, Record &region, const String &mask, const Vector< String > &method, const Vector< Int > &smoothaxes, const Vector< String > &smoothtypes, const Vector< Quantity > &smoothwidths, const Vector< Float > &includepix, const Vector< Float > &excludepix, const Double peaksnr, const Double stddev, const String &doppler="RADIO", const String &outfile="", const String &smoothout="", const String &plotter="/NULL", const Int nx=1, const Int ny=1, const Bool yind=False, const Bool overwrite=False, const Bool drop=True, const Bool stretchMask=False)
void setMomentsProgressMonitor (ImageMomentsProgressMonitor *progressMonitor)
String name (const Bool strippath=False)
Bool open (const String &infile)
Recordpixelvalue (const Vector< Int > &pixel)
void pixelValue (Bool &offImage, Quantum< Double > &value, Bool &mask, Vector< Int > &pos) const
Bool putchunk (const Array< Float > &pixels, const Vector< Int > &blc, const Vector< Int > &inc, const Bool list=False, const Bool locking=True, const Bool replicate=False)
Bool putregion (const Array< Float > &pixels, const Array< Bool > &pixelmask, Record &region, const Bool list=False, const Bool usemask=True, const Bool locking=True, const Bool replicate=False)
ImageInterface< Float > * rebin (const String &outfile, const Vector< Int > &bin, Record &region, const String &mask, const Bool dropdeg, const Bool overwrite=False, const Bool extendMask=False)
ImageInterface< Float > * regrid (const String &outfile, const Vector< Int > &shape, const Record &csys, const Vector< Int > &axes, Record &region, const String &mask, const String &method="linear", const Int decimate=10, const Bool replicate=False, const Bool doref=True, const Bool dropdeg=False, const Bool overwrite=False, const Bool force=False, const Bool specAsVelocity=False, const Bool extendAxes=False) const
 regrids to a given coordinate system...one uses a record that is converted to a CoordinateSytem
ImageInterface< Float > * regrid (const String &outfile, const ImageInterface< Float > *other, const String &method="linear", const Bool specAsVelocity=False, const Vector< Int > &axes=Vector< Int >(0), const Record &region=Record(), const String &mask="", const Int decimate=10, const Bool replicate=False, const Bool doref=True, const Bool dropdeg=False, const Bool overwrite=False, const Bool force=False, const Bool extendAxes=False) const
 regrids to match the "other" image interface...
ImageInterface< Float > * rotate (const String &outfile, const Vector< int > &shape, const Quantity &pa, Record &region, const String &mask, const String &method="cubic", const Int decimate=0, const Bool replicate=False, const Bool dropdeg=False, const Bool overwrite=False, const Bool extendMask=False)
Bool rename (const String &name, const Bool overwrite=False)
Bool replacemaskedpixels (const String &pixels, Record &region, const String &mask, const Bool update=False, const Bool list=False, const Bool extendMask=False)
ImageInterface< Float > * sepconvolve (const String &outfile, const Vector< Int > &axes, const Vector< String > &types, const Vector< Quantity > &widths, Double scale, Record &region, const String &mask, const bool overwrite=False, const bool extendMask=False)
Bool set (const String &pixels, const Int pixelmask, Record &region, const Bool list=false)
Bool setbrightnessunit (const String &unit)
bool setcoordsys (const Record &csys)
bool sethistory (const String &origin, const Vector< String > &history)
bool setmiscinfo (const Record &info)
Bool setrestoringbeam (const Quantity &major, const Quantity &minor, const Quantity &pa, const Record &beam, const Bool remove=False, const Bool log=True, Int channel=-1, Int polarization=-1)
bool twopointcorrelation (const String &outfile, Record &region, const String &mask, const Vector< Int > &axes, const String &method="structurefunction", const Bool overwrite=False, const Bool stretch=False)
Record summary (const String &doppler="RADIO", const Bool list=True, const Bool pixelorder=True, const Bool verbose=False)
Bool tofits (const String &outfile, const Bool velocity, const Bool optical, const Int bitpix, const Double minpix, const Double maxpix, Record &region, const String &mask, const Bool overwrite=False, const Bool dropdeg=False, const Bool deglast=False, const Bool dropstokes=False, const Bool stokeslast=False, const Bool wavelength=False, const Bool airWavelength=False, const String &origin="", Bool stretch=False, const Bool history=True)
Bool toASCII (const String &outfile, Record &region, const String &mask, const String &sep=" ", const String &format="%e", const Double maskvalue=-999, const Bool overwrite=False, const Bool extendMask=False)
Vector< Doubletopixel (Record &value)
Record toworld (const Vector< double > &value, const String &format="n")
Bool unlock ()
Bool detached ()
Record setregion (const Vector< Int > &blc, const Vector< Int > &trc, const String &infile="")
Record setboxregion (const Vector< Double > &blc, const Vector< Double > &trc, const Bool frac=False, const String &infile="")
bool maketestimage (const String &outfile="", const Bool overwrite=False, const String &imagetype="2d")
 make test image...cube or 2d (default)
ImageInterface< Float > * newimage (const String &infile, const String &outfile, Record &region, const String &Mask, const bool dropdeg=False, const bool overwrite=False)
ImageInterface< Float > * newimagefromfile (const String &fileName)
ImageInterface< Float > * newimagefromarray (const String &outfile, Array< Float > &pixelsArray, const Record &csys, const Bool linear=False, const Bool overwrite=False, const Bool log=True)
ImageInterface< Float > * newimagefromshape (const String &outfile, const Vector< Int > &shape, const Record &csys, const Bool linear=True, const Bool overwrite=False, const Bool log=True)
ImageInterface< Float > * newimagefromfits (const String &outfile, const String &infile, const Int whichrep=0, const Int whichhdu=0, const Bool zeroblanks=False, const Bool overwrite=False)
Recordecho (Record &v, const Bool godeep=False)
Bool getFreqProfile (const Vector< Double > &xy, Vector< Float > &zxaxisval, Vector< Float > &zyaxisval, const String &xytype="world", const String &specaxis="freq", const Int &whichStokes=0, const Int &whichTabular=0, const Int &whichLinear=0, const String &xunits="", const String &specframe="", const Int &whichQuality=0, const String &restValue="")
 Functions to get you back a spectral profile at direction position x, y.
Bool getFreqProfile (const Vector< Double > &x, const Vector< Double > &y, Vector< Float > &zxaxisval, Vector< Float > &zyaxisval, const String &xytype="world", const String &specaxis="freq", const Int &whichStokes=0, const Int &whichTabular=0, const Int &whichLinear=0, const String &xunits="", const String &specframe="", const Int &combineType=0, const Int &whichQuality=0, const String &restValue="", Int beamChannel=-1)
 how about using this ? for x.shape(xn) & y shape(yn) if xn == yn == 1, single point if xn == yn == 2, rectangle if (xn == yn) > 2, polygon (could originate from ellipse)
Bool toRecord (RecordInterface &rec)
 Return a record of the associates ImageInterface.
Bool fromRecord (const RecordInterface &rec, const String &imagename="")
 Create a pagedimage if imagename is not "" else create a tempimage.
const ImageInterface< Float > * getImage () const
 get the associated ImageInterface object

Static Public Member Functions

static String className ()
static Bool makeExternalImage (std::auto_ptr< ImageInterface< Float > > &image, const String &fileName, const CoordinateSystem &cSys, const IPosition &shape, const ImageInterface< Float > &inImage, LogIO &os, Bool overwrite=False, Bool allowTemp=False, Bool copyMask=True)
 If file name empty make TempImage (allowTemp=T) or do nothing.

Private Member Functions

void centreRefPix (casa::CoordinateSystem &cSys, const casa::IPosition &shape) const
 Center refpix apart from STokes.
casa::ComponentType::Shape convertModelType (casa::Fit2D::Types typeIn) const
 Convert types.
bool deleteHist ()
 Delete private ImageStatistics and ImageHistograms objects.
void hanning_smooth (casa::Array< casa::Float > &out, casa::Array< casa::Bool > &maskOut, const casa::Vector< casa::Float > &in, const casa::Array< casa::Bool > &maskIn, casa::Bool isMasked) const
 Hanning smooth a vector.
casa::Bool make_image (casa::String &error, const casa::String &image, const casa::CoordinateSystem &cSys, const casa::IPosition &shape, casa::LogIO &os, casa::Bool log=casa::True, casa::Bool overwrite=casa::False)
 Make a new image with given CS.
*casa::CoordinateSystemmakeCoordinateSystem (const casa::Record &cSys, const casa::IPosition &shape) const
 Convert a Record to a CoordinateSystem.
void makeRegionBlock (casa::PtrBlock< const casa::ImageRegion * > &regions, const casa::Record &Regions, casa::LogIO &logger)
 Make a block of regions from a Record.
void set_cache (const casa::IPosition &chunk_shape) const
 Set the cache.
Record toWorldRecord (const Vector< Double > &pixel, const String &format) const
 Prints an error message if the image DO is detached and returns True.
Record worldVectorToRecord (const Vector< Double > &world, Int c, const String &format, Bool isAbsolute, Bool showAsAbsolute) const
Record worldVectorToMeasures (const Vector< Double > &world, Int c, Bool abs) const
void trim (Vector< Double > &inout, const Vector< Double > &replace) const
Bool getSpectralAxisVal (const String &specaxis, Vector< Float > &specVal, const CoordinateSystem &cSys, const String &xunits, const String &freqFrame="", const String &restValue="")
 return a vector of the spectral axis values in units requested e.g "vel", "fre" or "pix"..specVal has to be sized already
ImageInterface< Float > * _regrid (const String &outfile, const Vector< Int > &shape, const CoordinateSystem &csys, const Vector< Int > &axes, const Record &region, const String &mask, const String &method, const Int decimate, const Bool replicate, const Bool doref, const Bool dropdeg, const Bool overwrite, const Bool force, const Bool extendMask) const
 return a vector of the spectral axis values in units requested e.g "vel", "fre" or "pix"..specVal has to be sized already
ImageInterface< Float > * _regridByVelocity (const String &outfile, const Vector< Int > &shape, const CoordinateSystem &csysTemplate, const Vector< Int > &axes, const Record &region, const String &mask, const String &method, const Int decimate, const Bool replicate, const Bool doref, const Bool dropdeg, const Bool overwrite, const Bool force, const Bool extendMask) const
ImageInterface< Float > * _fitpolynomial (const String &residfile, const String &fitfile, const String &sigmafile, const Int axis, const Int order, Record &region, const String &mask, const bool overwrite=false)

Static Private Member Functions

static Bool _haveRegionsChanged (ImageRegion *pNewRegionRegion, ImageRegion *pNewMaskRegion, ImageRegion *pOldRegionRegion, ImageRegion *pOldMaskRegion)
static Bool makeMask (casa::ImageInterface< Float > &out, String &maskName, Bool init, Bool makeDefault, LogIO &os, Bool list)

Private Attributes

std::auto_ptr< ImageInterface
< Float > > 
_image
std::auto_ptr< LogIO_log
std::auto_ptr< ImageHistograms
< Float > > 
_histograms
 Having private version of IS and IH means that they will only recreate storage images if they have to.
IPosition last_chunk_shape_p
casa::ImageRegionpOldHistRegionRegion_p
casa::ImageRegionpOldHistMaskRegion_p
Bool oldHistStorageForce_p
ImageMomentsProgressMonitorimageMomentsProgressMonitor

Detailed Description

Image analysis and handling tool.

Synopsis

This the casapy image tool. One time it should be merged with pyrap's image tool ImageProxy.

Definition at line 75 of file ImageAnalysis.h.


Constructor & Destructor Documentation

ImageInterface constructor.

casa::ImageAnalysis::ImageAnalysis ( ImageInterface< Float > *  inImage,
const Bool  cloneInputPointer 
)

Use this constructor with cloneInputPointer=False if you want this object to take over management of the input pointer.

The input pointer will be deleted when this object is destroyed.

virtual casa::ImageAnalysis::~ImageAnalysis ( ) [virtual]

Member Function Documentation

ImageInterface<Float>* casa::ImageAnalysis::_fitpolynomial ( const String residfile,
const String fitfile,
const String sigmafile,
const Int  axis,
const Int  order,
Record region,
const String mask,
const bool  overwrite = false 
) [private]
static Bool casa::ImageAnalysis::_haveRegionsChanged ( ImageRegion pNewRegionRegion,
ImageRegion pNewMaskRegion,
ImageRegion pOldRegionRegion,
ImageRegion pOldMaskRegion 
) [static, private]
ImageInterface<Float>* casa::ImageAnalysis::_regrid ( const String outfile,
const Vector< Int > &  shape,
const CoordinateSystem csys,
const Vector< Int > &  axes,
const Record region,
const String mask,
const String method,
const Int  decimate,
const Bool  replicate,
const Bool  doref,
const Bool  dropdeg,
const Bool  overwrite,
const Bool  force,
const Bool  extendMask 
) const [private]

return a vector of the spectral axis values in units requested e.g "vel", "fre" or "pix"..specVal has to be sized already

     
ImageInterface<Float>* casa::ImageAnalysis::_regridByVelocity ( const String outfile,
const Vector< Int > &  shape,
const CoordinateSystem csysTemplate,
const Vector< Int > &  axes,
const Record region,
const String mask,
const String method,
const Int  decimate,
const Bool  replicate,
const Bool  doref,
const Bool  dropdeg,
const Bool  overwrite,
const Bool  force,
const Bool  extendMask 
) const [private]
Bool casa::ImageAnalysis::addnoise ( const String type,
const Vector< Double > &  pars,
Record region,
const Bool  zero = False 
)
Bool casa::ImageAnalysis::calc ( const String pixels)
Bool casa::ImageAnalysis::calcmask ( const String mask,
Record regions,
const String name,
const Bool  asdefault = True 
)

regions should be a Record of Records having different regions

void casa::ImageAnalysis::centreRefPix ( casa::CoordinateSystem cSys,
const casa::IPosition shape 
) const [private]

Center refpix apart from STokes.

static String casa::ImageAnalysis::className ( ) [inline, static]

Definition at line 417 of file ImageAnalysis.h.

ImageInterface<Float>* casa::ImageAnalysis::continuumsub ( const String outline,
const String outcont,
Record region,
const Vector< int > &  channels,
const String pol = "",
const Int  fitorder = 0,
const Bool  overwrite = false 
)
Quantity casa::ImageAnalysis::convertflux ( Bool fakeBeam,
const Quantity value,
const Quantity major,
const Quantity minor,
const String type = "Gaussian",
const Bool  topeak = True,
const Bool  supressNoBeamWarnings = False,
const Int  channel = -1,
const Int  polarization = -1 
) const

Convert types.

ImageInterface<Float>* casa::ImageAnalysis::convolve ( const String outfile,
Array< Float > &  kernel,
const String kernImage,
const Double  scale,
Record region,
String mask,
const Bool  overwrite = False,
const Bool  async = False,
const Bool  stretch = False 
)
* ImageInterface<Float>* casa::ImageAnalysis::convolve2d ( const String outfile,
const Vector< Int > &  axes,
const String type,
const Quantity major,
const Quantity minor,
const Quantity pa,
Double  scale,
Record region,
const String mask,
const Bool  overwrite = False,
const Bool  stretch = False,
const Bool  targetres = False 
)
Record* casa::ImageAnalysis::coordmeasures ( Quantity intensity,
Record direction,
Record frequency,
Record velocity,
const Vector< double > &  pixel 
)
Matrix<Float> casa::ImageAnalysis::decompose ( Record region,
const String mask,
const Bool  simple = false,
const Double  threshold = -1,
const Int  ncontour = 11,
const Int  minrange = 1,
const Int  naxis = 2,
const Bool  fit = True,
const Double  maxrms = -1,
const Int  maxretry = -1,
const Int  maxiter = 256,
const Double  convcriteria = 0.0001 
)
Matrix<Float> casa::ImageAnalysis::decompose ( Matrix< Int > &  blcs,
Matrix< Int > &  trcs,
Record region,
const String mask,
const Bool  simple = false,
const Double  threshold = -1,
const Int  ncontour = 11,
const Int  minrange = 1,
const Int  naxis = 2,
const Bool  fit = True,
const Double  maxrms = -1,
const Int  maxretry = -1,
const Int  maxiter = 256,
const Double  convcriteria = 0.0001,
const Bool  stretch = False 
)
Record casa::ImageAnalysis::deconvolvecomponentlist ( const Record complist,
const Int  channel,
const Int  polarization 
)
bool casa::ImageAnalysis::deleteHist ( ) [private]

Delete private ImageStatistics and ImageHistograms objects.

Record* casa::ImageAnalysis::echo ( Record v,
const Bool  godeep = False 
)
Bool casa::ImageAnalysis::fft ( const String real,
const String imag,
const String amp,
const String phase,
const Vector< Int > &  axes,
Record region,
const String mask,
const Bool  stretch 
)
Record casa::ImageAnalysis::findsources ( const Int  nmax,
const Double  cutoff,
Record region,
const String mask,
const Bool  point = True,
const Int  width = 5,
const Bool  negfind = False 
)
Bool casa::ImageAnalysis::fromRecord ( const RecordInterface rec,
const String imagename = "" 
)

Create a pagedimage if imagename is not "" else create a tempimage.

Bool casa::ImageAnalysis::getchunk ( Array< Float > &  pixel,
Array< Bool > &  pixmask,
const Vector< Int > &  blc,
const Vector< Int > &  trc,
const Vector< Int > &  inc,
const Vector< Int > &  axes,
const Bool  list = False,
const Bool  dropdeg = False,
const bool  getmask = False 
)
Bool casa::ImageAnalysis::getFreqProfile ( const Vector< Double > &  xy,
Vector< Float > &  zxaxisval,
Vector< Float > &  zyaxisval,
const String xytype = "world",
const String specaxis = "freq",
const Int whichStokes = 0,
const Int whichTabular = 0,
const Int whichLinear = 0,
const String xunits = "",
const String specframe = "",
const Int whichQuality = 0,
const String restValue = "" 
)

Functions to get you back a spectral profile at direction position x, y.

x, y are to be in the world coord value or pixel value...user specifies by parameter xytype ("world" or "pixel"). On success returns true return value of profile is in zyaxisval, zxaxisval contains the spectral values at which zyaxisval is evaluated its in the spectral type specified by specaxis...possibilities are "pixel", "frequency", "radio velocity" "optical velocity", "wavelength" or "air wavelength" (the code checks for the keywords "pixel", "freq", "vel", "optical", and "radio" in the string) if "vel" is found but no "radio" or "optical", the full relativistic velocity is generated (MFrequency::RELATIVISTIC) xunits determines the units of the x-axis values...default is "GHz" for freq and "km/s" for vel, "mm" for wavelength and "um" for "air wavelength" PLEASE note that the returned value of zyaxisval are the units of the image specframe can be a valid frame from MFrequency...i.e LSRK, LSRD etc...

Bool casa::ImageAnalysis::getFreqProfile ( const Vector< Double > &  x,
const Vector< Double > &  y,
Vector< Float > &  zxaxisval,
Vector< Float > &  zyaxisval,
const String xytype = "world",
const String specaxis = "freq",
const Int whichStokes = 0,
const Int whichTabular = 0,
const Int whichLinear = 0,
const String xunits = "",
const String specframe = "",
const Int combineType = 0,
const Int whichQuality = 0,
const String restValue = "",
Int  beamChannel = -1 
)

how about using this ? for x.shape(xn) & y shape(yn) if xn == yn == 1, single point if xn == yn == 2, rectangle if (xn == yn) > 2, polygon (could originate from ellipse)

get the associated ImageInterface object

Bool casa::ImageAnalysis::getregion ( Array< Float > &  pixels,
Array< Bool > &  pixmask,
Record region,
const Vector< Int > &  axes,
const String mask,
const Bool  list = False,
const Bool  dropdeg = False,
const Bool  getmask = False,
const Bool  extendMask = False 
)
Record* casa::ImageAnalysis::getslice ( const Vector< Double > &  x,
const Vector< Double > &  y,
const Vector< Int > &  axes,
const Vector< Int > &  coord,
const Int  npts = 0,
const String method = "linear" 
)
Bool casa::ImageAnalysis::getSpectralAxisVal ( const String specaxis,
Vector< Float > &  specVal,
const CoordinateSystem cSys,
const String xunits,
const String freqFrame = "",
const String restValue = "" 
) [private]

return a vector of the spectral axis values in units requested e.g "vel", "fre" or "pix"..specVal has to be sized already

ImageInterface<Float>* casa::ImageAnalysis::hanning ( const String outfile,
Record region,
const String mask,
const Int  axis = -10,
const Bool  drop = True,
const bool  overwrite = False,
const Bool  extendMask = True 
)
void casa::ImageAnalysis::hanning_smooth ( casa::Array< casa::Float > &  out,
casa::Array< casa::Bool > &  maskOut,
const casa::Vector< casa::Float > &  in,
const casa::Array< casa::Bool > &  maskIn,
casa::Bool  isMasked 
) const [private]

Hanning smooth a vector.

Record casa::ImageAnalysis::histograms ( const Vector< Int > &  axes,
Record region,
const String mask,
const Int  nbins,
const Vector< Double > &  includepix,
const Bool  gauss,
const Bool  cumu,
const Bool  log,
const Bool  list,
const Bool  force = False,
const Bool  disk = False,
const Bool  extendMask = False 
)
Vector<String> casa::ImageAnalysis::history ( const Bool  list = False,
const Bool  browse = True 
)
ImageInterface<Float>* casa::ImageAnalysis::imagecalc ( const String outfile,
const String pixels,
const Bool  overwrite = False 
)
ImageInterface<Float>* casa::ImageAnalysis::imageconcat ( const String outfile,
const Vector< String > &  infiles,
const Int  axis,
const Bool  relax = False,
const Bool  tempclose = True,
const Bool  overwrite = False 
)
Bool casa::ImageAnalysis::imagefromarray ( const String outfile,
Array< Float > &  pixels,
const Record csys,
const Bool  linear = False,
const Bool  overwrite = False,
const Bool  log = True 
)
Bool casa::ImageAnalysis::imagefromascii ( const String outfile,
const String infile,
const Vector< Int > &  shape,
const String sep,
const Record csys,
const Bool  linear = False,
const Bool  overwrite = False 
)
Bool casa::ImageAnalysis::imagefromfits ( const String outfile,
const String infile,
const Int  whichrep = 0,
const Int  whichhdu = 0,
const Bool  zeroblanks = False,
const Bool  overwrite = False 
)
Bool casa::ImageAnalysis::imagefromimage ( const String outfile,
const String infile,
Record region,
const String mask,
const Bool  dropdeg = False,
const Bool  overwrite = False 
)
Bool casa::ImageAnalysis::imagefromshape ( const String outfile,
const Vector< Int > &  shape,
const Record csys,
const Bool  linear = True,
const Bool  overwrite = False,
const Bool  log = True 
)
Bool casa::ImageAnalysis::insert ( const String infile,
Record region,
const Vector< double > &  locate,
Bool  verbose 
)

Bool isopen();.

Bool casa::ImageAnalysis::lock ( const Bool  writelock = False,
const Int  nattempts = 0 
)
casa::Bool casa::ImageAnalysis::make_image ( casa::String error,
const casa::String image,
const casa::CoordinateSystem cSys,
const casa::IPosition shape,
casa::LogIO os,
casa::Bool  log = casa::True,
casa::Bool  overwrite = casa::False 
) [private]

Make a new image with given CS.

Bool casa::ImageAnalysis::makecomplex ( const String outfile,
const String imag,
Record region,
const Bool  overwrite = False 
)
* casa::CoordinateSystem* casa::ImageAnalysis::makeCoordinateSystem ( const casa::Record cSys,
const casa::IPosition shape 
) const [private]

Convert a Record to a CoordinateSystem.

static Bool casa::ImageAnalysis::makeExternalImage ( std::auto_ptr< ImageInterface< Float > > &  image,
const String fileName,
const CoordinateSystem cSys,
const IPosition shape,
const ImageInterface< Float > &  inImage,
LogIO os,
Bool  overwrite = False,
Bool  allowTemp = False,
Bool  copyMask = True 
) [static]

If file name empty make TempImage (allowTemp=T) or do nothing.

Otherwise, make a PagedImage from file name and copy mask and misc from inimage. Returns T if image made, F if not

static Bool casa::ImageAnalysis::makeMask ( casa::ImageInterface< Float > &  out,
String maskName,
Bool  init,
Bool  makeDefault,
LogIO os,
Bool  list 
) [static, private]
void casa::ImageAnalysis::makeRegionBlock ( casa::PtrBlock< const casa::ImageRegion * > &  regions,
const casa::Record Regions,
casa::LogIO logger 
) [private]

Make a block of regions from a Record.

bool casa::ImageAnalysis::maketestimage ( const String outfile = "",
const Bool  overwrite = False,
const String imagetype = "2d" 
)

make test image...cube or 2d (default)

Vector<String> casa::ImageAnalysis::maskhandler ( const String op,
const Vector< String > &  nam 
)
Record casa::ImageAnalysis::maxfit ( Record region,
const Bool  point,
const Int  width = 5,
const Bool  negfind = False,
const Bool  list = True 
)
Bool casa::ImageAnalysis::modify ( Record model,
Record region,
const String mask,
const Bool  subtract = True,
const Bool  list = True,
const Bool  extendMask = False 
)
ImageInterface<Float>* casa::ImageAnalysis::moments ( const Vector< Int > &  moments,
const Int  axis,
Record region,
const String mask,
const Vector< String > &  method,
const Vector< Int > &  smoothaxes,
const Vector< String > &  smoothtypes,
const Vector< Quantity > &  smoothwidths,
const Vector< Float > &  includepix,
const Vector< Float > &  excludepix,
const Double  peaksnr,
const Double  stddev,
const String doppler = "RADIO",
const String outfile = "",
const String smoothout = "",
const String plotter = "/NULL",
const Int  nx = 1,
const Int  ny = 1,
const Bool  yind = False,
const Bool  overwrite = False,
const Bool  drop = True,
const Bool  stretchMask = False 
)
String casa::ImageAnalysis::name ( const Bool  strippath = False)
ImageInterface<Float>* casa::ImageAnalysis::newimage ( const String infile,
const String outfile,
Record region,
const String Mask,
const bool  dropdeg = False,
const bool  overwrite = False 
)
ImageInterface<Float>* casa::ImageAnalysis::newimagefromarray ( const String outfile,
Array< Float > &  pixelsArray,
const Record csys,
const Bool  linear = False,
const Bool  overwrite = False,
const Bool  log = True 
)
ImageInterface<Float>* casa::ImageAnalysis::newimagefromfits ( const String outfile,
const String infile,
const Int  whichrep = 0,
const Int  whichhdu = 0,
const Bool  zeroblanks = False,
const Bool  overwrite = False 
)
ImageInterface<Float>* casa::ImageAnalysis::newimagefromshape ( const String outfile,
const Vector< Int > &  shape,
const Record csys,
const Bool  linear = True,
const Bool  overwrite = False,
const Bool  log = True 
)
Bool casa::ImageAnalysis::open ( const String infile)
void casa::ImageAnalysis::pixelValue ( Bool offImage,
Quantum< Double > &  value,
Bool mask,
Vector< Int > &  pos 
) const
Bool casa::ImageAnalysis::putchunk ( const Array< Float > &  pixels,
const Vector< Int > &  blc,
const Vector< Int > &  inc,
const Bool  list = False,
const Bool  locking = True,
const Bool  replicate = False 
)
Bool casa::ImageAnalysis::putregion ( const Array< Float > &  pixels,
const Array< Bool > &  pixelmask,
Record region,
const Bool  list = False,
const Bool  usemask = True,
const Bool  locking = True,
const Bool  replicate = False 
)
ImageInterface<Float>* casa::ImageAnalysis::rebin ( const String outfile,
const Vector< Int > &  bin,
Record region,
const String mask,
const Bool  dropdeg,
const Bool  overwrite = False,
const Bool  extendMask = False 
)
ImageInterface<Float>* casa::ImageAnalysis::regrid ( const String outfile,
const Vector< Int > &  shape,
const Record csys,
const Vector< Int > &  axes,
Record region,
const String mask,
const String method = "linear",
const Int  decimate = 10,
const Bool  replicate = False,
const Bool  doref = True,
const Bool  dropdeg = False,
const Bool  overwrite = False,
const Bool  force = False,
const Bool  specAsVelocity = False,
const Bool  extendAxes = False 
) const

regrids to a given coordinate system...one uses a record that is converted to a CoordinateSytem

ImageInterface<Float>* casa::ImageAnalysis::regrid ( const String outfile,
const ImageInterface< Float > *  other,
const String method = "linear",
const Bool  specAsVelocity = False,
const Vector< Int > &  axes = VectorInt >(0),
const Record region = Record(),
const String mask = "",
const Int  decimate = 10,
const Bool  replicate = False,
const Bool  doref = True,
const Bool  dropdeg = False,
const Bool  overwrite = False,
const Bool  force = False,
const Bool  extendAxes = False 
) const

regrids to match the "other" image interface...

Bool casa::ImageAnalysis::remove ( Bool  verbose = true)
Bool casa::ImageAnalysis::rename ( const String name,
const Bool  overwrite = False 
)
Bool casa::ImageAnalysis::replacemaskedpixels ( const String pixels,
Record region,
const String mask,
const Bool  update = False,
const Bool  list = False,
const Bool  extendMask = False 
)
ImageInterface<Float>* casa::ImageAnalysis::rotate ( const String outfile,
const Vector< int > &  shape,
const Quantity pa,
Record region,
const String mask,
const String method = "cubic",
const Int  decimate = 0,
const Bool  replicate = False,
const Bool  dropdeg = False,
const Bool  overwrite = False,
const Bool  extendMask = False 
)
ImageInterface<Float>* casa::ImageAnalysis::sepconvolve ( const String outfile,
const Vector< Int > &  axes,
const Vector< String > &  types,
const Vector< Quantity > &  widths,
Double  scale,
Record region,
const String mask,
const bool  overwrite = False,
const bool  extendMask = False 
)
Bool casa::ImageAnalysis::set ( const String pixels,
const Int  pixelmask,
Record region,
const Bool  list = false 
)
void casa::ImageAnalysis::set_cache ( const casa::IPosition chunk_shape) const [private]

Set the cache.

Record casa::ImageAnalysis::setboxregion ( const Vector< Double > &  blc,
const Vector< Double > &  trc,
const Bool  frac = False,
const String infile = "" 
)
bool casa::ImageAnalysis::setcoordsys ( const Record csys)
bool casa::ImageAnalysis::sethistory ( const String origin,
const Vector< String > &  history 
)
bool casa::ImageAnalysis::setmiscinfo ( const Record info)
Record casa::ImageAnalysis::setregion ( const Vector< Int > &  blc,
const Vector< Int > &  trc,
const String infile = "" 
)
Bool casa::ImageAnalysis::setrestoringbeam ( const Quantity major,
const Quantity minor,
const Quantity pa,
const Record beam,
const Bool  remove = False,
const Bool  log = True,
Int  channel = -1,
Int  polarization = -1 
)
Record casa::ImageAnalysis::summary ( const String doppler = "RADIO",
const Bool  list = True,
const Bool  pixelorder = True,
const Bool  verbose = False 
)
Bool casa::ImageAnalysis::toASCII ( const String outfile,
Record region,
const String mask,
const String sep = " ",
const String format = "%e",
const Double  maskvalue = -999,
const Bool  overwrite = False,
const Bool  extendMask = False 
)
Bool casa::ImageAnalysis::tofits ( const String outfile,
const Bool  velocity,
const Bool  optical,
const Int  bitpix,
const Double  minpix,
const Double  maxpix,
Record region,
const String mask,
const Bool  overwrite = False,
const Bool  dropdeg = False,
const Bool  deglast = False,
const Bool  dropstokes = False,
const Bool  stokeslast = False,
const Bool  wavelength = False,
const Bool  airWavelength = False,
const String origin = "",
Bool  stretch = False,
const Bool  history = True 
)

Return a record of the associates ImageInterface.

Record casa::ImageAnalysis::toworld ( const Vector< double > &  value,
const String format = "n" 
)
Record casa::ImageAnalysis::toWorldRecord ( const Vector< Double > &  pixel,
const String format 
) const [private]

Prints an error message if the image DO is detached and returns True.

bool detached() const;

Convert object-id's in the expression to LatticeExprNode objects. It returns a string where the object-id's are placed by $n. That string can be parsed by ImageExprParse. Furthermore it fills the string exprName with the expression where the object-id's are replaced by the image names. Note that an image name can be an expression in itself, so this string is not suitable for the ImageExprParse. casa::String substituteOID (casa::Block<casa::LatticeExprNode>& nodes, casa::String& exprName, const casa::String& expr) const;

Some helper functions that needs to be in casa namespace coordsys

void casa::ImageAnalysis::trim ( Vector< Double > &  inout,
const Vector< Double > &  replace 
) const [private]
bool casa::ImageAnalysis::twopointcorrelation ( const String outfile,
Record region,
const String mask,
const Vector< Int > &  axes,
const String method = "structurefunction",
const Bool  overwrite = False,
const Bool  stretch = False 
)
Record casa::ImageAnalysis::worldVectorToMeasures ( const Vector< Double > &  world,
Int  c,
Bool  abs 
) const [private]
Record casa::ImageAnalysis::worldVectorToRecord ( const Vector< Double > &  world,
Int  c,
const String format,
Bool  isAbsolute,
Bool  showAsAbsolute 
) const [private]

Member Data Documentation

Having private version of IS and IH means that they will only recreate storage images if they have to.

Definition at line 598 of file ImageAnalysis.h.

std::auto_ptr<ImageInterface<Float> > casa::ImageAnalysis::_image [private]

Definition at line 592 of file ImageAnalysis.h.

std::auto_ptr<LogIO> casa::ImageAnalysis::_log [private]

Definition at line 593 of file ImageAnalysis.h.

Definition at line 604 of file ImageAnalysis.h.

Definition at line 599 of file ImageAnalysis.h.

Definition at line 603 of file ImageAnalysis.h.

Definition at line 602 of file ImageAnalysis.h.

Definition at line 601 of file ImageAnalysis.h.


The documentation for this class was generated from the following file: