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

image component class More...

#include <CasacRegionManager.h>

Inheritance diagram for casa::CasacRegionManager:
casa::RegionManager

List of all members.

Public Types

enum  StokesControl {
  USE_FIRST_STOKES,
  USE_ALL_STOKES
}

Public Member Functions

 CasacRegionManager ()
 CasacRegionManager (const CoordinateSystem &csys)
 ~CasacRegionManager ()
Record fromBCS (String &diagnostics, uInt &nSelectedChannels, String &stokes, const Record *const &regionPtr, const String &regionName, const String &chans, const StokesControl stokesControl, const String &box, const IPosition &imShape, const String &imageName="", Bool verbose=True)
 convert to a record a region specified by a rectangular directional box, chans, and stokes, or althernatively a pointer to a region record.
vector< uIntsetSpectralRanges (uInt &nSelectedChannels, const Record *const regionRec, const IPosition &imShape=IPosition(0)) const
 Return the range(s) of spectral channels selected by the specification or the region record (Note only one of specification or regionRec may be specified).
vector< uIntsetSpectralRanges (String specification, uInt &nSelectedChannels, const IPosition &imShape=IPosition(0)) const

Static Public Member Functions

static vector< uIntconsolidateAndOrderRanges (uInt &nSelected, const vector< uInt > &ranges)
 ranges are pairs describing the pixel range over which to select.
static Record regionFromString (const CoordinateSystem &csys, const String &regionStr, const String &imageName, const IPosition &imShape)

Static Public Attributes

static const String ALL

Private Member Functions

String _pairsToString (const vector< uInt > &pairs) const
vector< uInt_setPolarizationRanges (String &specification, const String &firstStokes, const uInt nStokes, const StokesControl stokesControl) const
vector< Double_setBoxCorners (const String &box) const
ImageRegion _fromBCS (String &diagnostics, uInt &nSelectedChannels, String &stokes, const String &chans, const StokesControl stokesControl, const String &box, const IPosition &imShape) const
ImageRegion _fromBCS (String &diagnostics, const vector< Double > &boxCorners, const vector< uInt > &chanEndPts, const vector< uInt > &polEndPts, const IPosition imShape) const
String _stokesFromRecord (const Record &region, const StokesControl stokesControl, const IPosition &shape) const
void _setRegion (Record &regionRecord, String &diagnostics, const String &regionName, const IPosition &imShape, const String &imageName)
vector< uInt_spectralRangesFromTraditionalFormat (uInt &nSelectedChannels, const String &specification, const uInt nChannels) const
vector< uInt_spectralRangeFromRangeFormat (uInt &nSelectedChannels, const String &specification, const IPosition &imShape) const
vector< uInt_spectralRangeFromRegionRecord (uInt &nSelectedChannels, const Record *const regionRec, const IPosition &imShape) const
Bool _supports2DBox (Bool except) const
 does the image support the setting of a two dimensional box(es).
vector< uInt_initSpectralRanges (uInt &nSelectedChannels, const IPosition &imShape) const

Static Private Member Functions

static void _setRegion (Record &regionRecord, String &diagnostics, const Record *regionPtr)

Detailed Description

image component class

This is a casa based class to provide the funtionality to the RegionManager Tool

Author:
Version:

Definition at line 44 of file CasacRegionManager.h.


Member Enumeration Documentation

Enumerator:
USE_FIRST_STOKES 
USE_ALL_STOKES 

Definition at line 49 of file CasacRegionManager.h.


Constructor & Destructor Documentation


Member Function Documentation

ImageRegion casa::CasacRegionManager::_fromBCS ( String diagnostics,
uInt nSelectedChannels,
String stokes,
const String chans,
const StokesControl  stokesControl,
const String box,
const IPosition imShape 
) const [private]
ImageRegion casa::CasacRegionManager::_fromBCS ( String diagnostics,
const vector< Double > &  boxCorners,
const vector< uInt > &  chanEndPts,
const vector< uInt > &  polEndPts,
const IPosition  imShape 
) const [private]
vector<uInt> casa::CasacRegionManager::_initSpectralRanges ( uInt nSelectedChannels,
const IPosition imShape 
) const [private]
String casa::CasacRegionManager::_pairsToString ( const vector< uInt > &  pairs) const [private]
vector<Double> casa::CasacRegionManager::_setBoxCorners ( const String box) const [private]
vector<uInt> casa::CasacRegionManager::_setPolarizationRanges ( String specification,
const String firstStokes,
const uInt  nStokes,
const StokesControl  stokesControl 
) const [private]
static void casa::CasacRegionManager::_setRegion ( Record regionRecord,
String diagnostics,
const Record regionPtr 
) [static, private]
void casa::CasacRegionManager::_setRegion ( Record regionRecord,
String diagnostics,
const String regionName,
const IPosition imShape,
const String imageName 
) [private]
vector<uInt> casa::CasacRegionManager::_spectralRangeFromRangeFormat ( uInt nSelectedChannels,
const String specification,
const IPosition imShape 
) const [private]
vector<uInt> casa::CasacRegionManager::_spectralRangeFromRegionRecord ( uInt nSelectedChannels,
const Record *const  regionRec,
const IPosition imShape 
) const [private]
vector<uInt> casa::CasacRegionManager::_spectralRangesFromTraditionalFormat ( uInt nSelectedChannels,
const String specification,
const uInt  nChannels 
) const [private]
String casa::CasacRegionManager::_stokesFromRecord ( const Record region,
const StokesControl  stokesControl,
const IPosition shape 
) const [private]
Bool casa::CasacRegionManager::_supports2DBox ( Bool  except) const [private]

does the image support the setting of a two dimensional box(es).

If except is True, an exception will be thrown if this image does not support it. If not, False is returned in that case.

static vector<uInt> casa::CasacRegionManager::consolidateAndOrderRanges ( uInt nSelected,
const vector< uInt > &  ranges 
) [static]

ranges are pairs describing the pixel range over which to select.

If you want to select just one pixel in the "range", you must specify that pixel in both parts of the pair. So if you want to select pixels 0 through 5 and pixel 13, you'd specify ranges[0] = 0; ranges[1] = 5; ranges[2] = 13; ranges[3] = 13

Record casa::CasacRegionManager::fromBCS ( String diagnostics,
uInt nSelectedChannels,
String stokes,
const Record *const &  regionPtr,
const String regionName,
const String chans,
const StokesControl  stokesControl,
const String box,
const IPosition imShape,
const String imageName = "",
Bool  verbose = True 
)

convert to a record a region specified by a rectangular directional box, chans, and stokes, or althernatively a pointer to a region record.

If box, chans, or stokes is not blank, regionPtr should be null. Processing happens in the following order:

  1. if box is not empty it, along with chans and stokes if specified, are used to determine the returned record. In this case stokes is not altered.
  2. else if regionPtr is not null, it is used to determine the returned Record. In this case, stokes may be modified to reflect the stokes parameters included in the corresponding region.
  3. else if regionName is not empty, the region file of the same is read and used to create the record, or if regionName is of the form "imagename:regionname" the region record is read from the corresponding iamge. In this case, stokes may be modified to reflect the stokes parameters included in the corresponding region.
  4. else chans and stokes are used to determine the region Record, or if not given, the whole imShape is used. box is specified in comma seperated quadruplets representing blc and trc pixel locations, eg "100, 110, 200, 205". stokes is specified as the concatentation of stokes parameters, eg "IQUV". chans is specified in ways supported by CASA, eg "1~10" for channels 1 through 10.
static Record casa::CasacRegionManager::regionFromString ( const CoordinateSystem csys,
const String regionStr,
const String imageName,
const IPosition imShape 
) [static]
vector<uInt> casa::CasacRegionManager::setSpectralRanges ( uInt nSelectedChannels,
const Record *const  regionRec,
const IPosition imShape = IPosition(0) 
) const

Return the range(s) of spectral channels selected by the specification or the region record (Note only one of specification or regionRec may be specified).

imShape is not used if specification is in the "new" format (ie contains "range").

vector<uInt> casa::CasacRegionManager::setSpectralRanges ( String  specification,
uInt nSelectedChannels,
const IPosition imShape = IPosition(0) 
) const

Member Data Documentation

Definition at line 47 of file CasacRegionManager.h.


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