casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
casa::CasacRegionManager Class Reference

image component class More...

#include <CasacRegionManager.h>

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

Public Types

enum  StokesControl {
  USE_FIRST_STOKES,
  USE_ALL_STOKES
}
 

Public Member Functions

 CasacRegionManager ()
 
 CasacRegionManager (const casacore::CoordinateSystem &csys)
 
 CasacRegionManager (const CasacRegionManager &)=delete
 
 ~CasacRegionManager ()
 
CasacRegionManageroperator= (const CasacRegionManager &)=delete
 
casacore::Record fromBCS (casacore::String &diagnostics, casacore::uInt &nSelectedChannels, casacore::String &stokes, const casacore::Record *const &regionPtr, const casacore::String &regionName, const casacore::String &chans, const StokesControl stokesControl, const casacore::String &box, const casacore::IPosition &imShape, const casacore::String &imageName="", casacore::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. More...
 
casacore::ImageRegion fromBCS (casacore::String &diagnostics, casacore::uInt &nSelectedChannels, casacore::String &stokes, const casacore::String &chans, const StokesControl stokesControl, const casacore::String &box, const casacore::IPosition &imShape) const
 
std::vector< casacore::uIntsetSpectralRanges (casacore::uInt &nSelectedChannels, const casacore::Record *const regionRec, const casacore::IPosition &imShape=casacore::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). More...
 
std::vector< casacore::uIntsetSpectralRanges (casacore::String specification, casacore::uInt &nSelectedChannels, const casacore::IPosition &imShape=casacore::IPosition(0)) const
 
- Public Member Functions inherited from casacore::RegionManager
 RegionManager ()
 blank constructor More...
 
 RegionManager (const CoordinateSystem &csys)
 
virtual ~RegionManager ()
 
String absreltype (const Int absrelval=0)
 
void setcoordsys (const CoordinateSystem &csys)
 
const CoordinateSystemgetcoordsys () const
 
Recordbox (const Vector< Double > &blc, const Vector< Double > &trc, const Vector< Double > &inc, const String &absrel, const Bool frac, const String &comment="")
 LCSlicer box. More...
 
Recordwbox (const Vector< Quantity > &blc, const Vector< Quantity > &trc, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel, const String &comment)
 
Recordwbox (const Vector< String > &blc, const Vector< String > &trc, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel, const String &comment)
 
Recordwbox (const Vector< Quantity > &blc, const Vector< Quantity > &trc, const Vector< Int > &pixelaxes, const String &absrel, const String &comment)
 
Recordwbox (const Vector< String > &blc, const Vector< String > &trc, const Vector< Int > &pixelaxes, const String &absrel, const String &comment)
 
ImageRegionwbox (const Vector< Quantity > &blc, const Vector< Quantity > &trc, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel="abs")
 
ImageRegionwpolygon (const Vector< Quantity > &x, const Vector< Quantity > &y, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
 Wpolygon with coordsys and if pixelaxes[0] is -1 then its assumed to be 0,1,... More...
 
ImageRegionwpolygon (const Vector< Quantity > &x, const Vector< Quantity > &y, const Vector< Int > &pixelaxes, const String &absrel)
 wpolygon version without csys...throws an exception if setcoordsys is not run More...
 
ImageRegionwellipse (const Quantity &xc, const Quantity &yc, const Quantity &a, const Quantity &b, const Quantity &pa, const uInt pixelAxis0, const uInt pixelAxis1, const String &absrel) const
 wellipse version without csys...throws an exception if setcoordsys is not run More...
 
ImageRegionwsphere (const Vector< Quantity > &center, const Quantity &radius, const Vector< Int > &pixelaxes, const String &absrel) const
 wsphere version without csys...throws an exception if setcoordsys is not run More...
 
ImageRegionwellipsoid (const Vector< Quantity > &center, const Vector< Quantity > &radii, const Vector< Int > &pixelaxes, const String &absrel) const
 
ImageRegionwshell (const Vector< Quantity > &center, const Vector< Quantity > &innerRadii, const Vector< Quantity > &outerRadii, const Vector< Int > &pixelaxes, const String &absrel) const
 
ImageRegiondoComplement (const WCRegion &reg1)
 Various versions of creating a complement region. More...
 
ImageRegiondoComplement (const PtrBlock< const WCRegion * > &reg1)
 
ImageRegiondoComplement (const ImageRegion &reg1)
 
ImageRegiondoConcatenation (const WCRegion &region, const WCBox &box)
 Various versions of concatenating a region onto another. More...
 
ImageRegiondoconcatenation (const PtrBlock< const WCRegion * > &regions, const WCBox &box)
 
ImageRegiondoConcatenation (const PtrBlock< const ImageRegion * > &regions, const TableRecord &box)
 
ImageRegiondoConcatenation (const Record &regions, const TableRecord &box)
 
ImageRegiondoDifference (const WCRegion &reg1, const WCRegion &reg2)
 Various versions of handling the difference of regions. More...
 
ImageRegiondoDifference (const PtrBlock< const WCRegion * > &reg1)
 
ImageRegiondoDifference (const ImageRegion &reg1, const ImageRegion &reg2)
 
ImageRegiondoIntersection (const WCRegion &reg1, const WCRegion &reg2)
 Different versions of intersecting regions. More...
 
ImageRegiondoIntersection (const PtrBlock< const WCRegion * > &reg1)
 
ImageRegiondoIntersection (const ImageRegion &reg1, const ImageRegion &reg2)
 
ImageRegiondoUnion (const WCRegion &reg1, const WCRegion &reg2)
 Different versions of unioning regions. More...
 
ImageRegiondoUnion (const PtrBlock< const WCRegion * > &reg1)
 
ImageRegiondoUnion (const ImageRegion &reg1, const ImageRegion &reg2) const
 
String imageRegionToTable (const String &tabName, const ImageRegion &imreg, const String &regName, Bool asmask=False)
 save region into a table (image, blank table or any other such) More...
 
String recordToTable (const String &tabName, const RecordInterface &rec, const String &regName="", Bool asmask=False)
 
RecordtableToRecord (const String &tabName, const String &regname)
 recover region from table More...
 
Vector< StringnamesInTable (const String &tabName)
 names of regions in table More...
 
Bool removeRegionInTable (const String &tabName, const String &regName)
 Remove a region from table...refuse is regionname is "". More...
 

Static Public Member Functions

static casacore::Record regionFromString (const casacore::CoordinateSystem &csys, const casacore::String &regionStr, const casacore::String &imageName, const casacore::IPosition &imShape, casacore::Bool verbose=true)
 
- Static Public Member Functions inherited from casacore::RegionManager
static Bool isPixelRegion (const ImageRegion &reg)
 Some little but useful tidbits. More...
 
static Bool isWorldRegion (const ImageRegion &reg)
 
static Recordbox (const Vector< Double > &blc, const Vector< Double > &trc, const Vector< Int > &shape, const String &comment="")
 LCBox box. More...
 
static ImageRegionwellipse (const Quantity &xc, const Quantity &yc, const Quantity &a, const Quantity &b, const Quantity &pa, const uInt pixelAxis0, const uInt pixelAxis1, const CoordinateSystem &csys, const String &absrel)
 
static ImageRegionwsphere (const Vector< Quantity > &center, const Quantity &radius, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
 
static ImageRegionwellipsoid (const Vector< Quantity > &center, const Vector< Quantity > &radii, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
 
static ImageRegionwshell (const Vector< Quantity > &center, const Vector< Quantity > &innerRadii, const Vector< Quantity > &outerRadii, const Vector< Int > &pixelaxes, const CoordinateSystem &csys, const String &absrel)
 
static ImageRegionwmask (const String &command)
 
static RecordreadImageFile (String filename, String regionname)
 Reading of a file containing an ImageRegion in the AipsIO format dump. More...
 
static Bool writeImageFile (const String &file, const String &regionname, const Record &regionRecord)
 Writing a file of the AipsIO dump of the record representation of the region. More...
 

Static Public Attributes

static const casacore::String ALL
 

Private Member Functions

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

Static Private Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from casacore::RegionManager
LogIO_getLog () const
 

Detailed Description

image component class

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

Author
Version

Definition at line 46 of file CasacRegionManager.h.

Member Enumeration Documentation

Enumerator
USE_FIRST_STOKES 
USE_ALL_STOKES 

Definition at line 51 of file CasacRegionManager.h.

Constructor & Destructor Documentation

casa::CasacRegionManager::CasacRegionManager ( )
casa::CasacRegionManager::CasacRegionManager ( const casacore::CoordinateSystem csys)
casa::CasacRegionManager::CasacRegionManager ( const CasacRegionManager )
delete
casa::CasacRegionManager::~CasacRegionManager ( )

Member Function Documentation

casacore::ImageRegion casa::CasacRegionManager::_fromBCS ( casacore::String diagnostics,
const std::vector< casacore::Double > &  boxCorners,
const std::vector< casacore::uInt > &  chanEndPts,
const std::vector< casacore::uInt > &  polEndPts,
const casacore::IPosition  imShape 
) const
private
std::vector<casacore::uInt> casa::CasacRegionManager::_initSpectralRanges ( casacore::uInt nSelectedChannels,
const casacore::IPosition imShape 
) const
private
casacore::String casa::CasacRegionManager::_pairsToString ( const std::vector< casacore::uInt > &  pairs) const
private
std::vector<casacore::Double> casa::CasacRegionManager::_setBoxCorners ( const casacore::String box) const
private
std::vector<casacore::uInt> casa::CasacRegionManager::_setPolarizationRanges ( casacore::String specification,
const casacore::String firstStokes,
const casacore::uInt  nStokes,
const StokesControl  stokesControl 
) const
private
static void casa::CasacRegionManager::_setRegion ( casacore::Record regionRecord,
casacore::String diagnostics,
const casacore::Record regionPtr 
)
staticprivate
void casa::CasacRegionManager::_setRegion ( casacore::Record regionRecord,
casacore::String diagnostics,
const casacore::String regionName,
const casacore::IPosition imShape,
const casacore::String imageName,
const casacore::String prependBox,
const casacore::String globalOverrideChans,
const casacore::String globalStokesOverride,
casacore::Bool  verbose 
)
private
std::vector<casacore::uInt> casa::CasacRegionManager::_spectralRangeFromRangeFormat ( casacore::uInt nSelectedChannels,
const casacore::String specification,
const casacore::IPosition imShape 
) const
private
std::vector<casacore::uInt> casa::CasacRegionManager::_spectralRangeFromRegionRecord ( casacore::uInt nSelectedChannels,
const casacore::Record *const  regionRec,
const casacore::IPosition imShape 
) const
private
casacore::String casa::CasacRegionManager::_stokesFromRecord ( const casacore::Record region,
const StokesControl  stokesControl,
const casacore::IPosition shape 
) const
private
casacore::Bool casa::CasacRegionManager::_supports2DBox ( casacore::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.

casacore::Record casa::CasacRegionManager::fromBCS ( casacore::String diagnostics,
casacore::uInt nSelectedChannels,
casacore::String stokes,
const casacore::Record *const &  regionPtr,
const casacore::String regionName,
const casacore::String chans,
const StokesControl  stokesControl,
const casacore::String box,
const casacore::IPosition imShape,
const casacore::String imageName = "",
casacore::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 casacore::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.
casacore::ImageRegion casa::CasacRegionManager::fromBCS ( casacore::String diagnostics,
casacore::uInt nSelectedChannels,
casacore::String stokes,
const casacore::String chans,
const StokesControl  stokesControl,
const casacore::String box,
const casacore::IPosition imShape 
) const
CasacRegionManager& casa::CasacRegionManager::operator= ( const CasacRegionManager )
delete
static casacore::Record casa::CasacRegionManager::regionFromString ( const casacore::CoordinateSystem csys,
const casacore::String regionStr,
const casacore::String imageName,
const casacore::IPosition imShape,
casacore::Bool  verbose = true 
)
static
std::vector<casacore::uInt> casa::CasacRegionManager::setSpectralRanges ( casacore::uInt nSelectedChannels,
const casacore::Record *const  regionRec,
const casacore::IPosition imShape = casacore::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").

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

Member Data Documentation

const casacore::String casa::CasacRegionManager::ALL
static

Definition at line 49 of file CasacRegionManager.h.


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