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 Private Member Functions | List of all members
casa::ImageFactory Class Reference

#include <ImageFactory.h>

Public Types

enum  ComplexToFloatFunction {
  REAL,
  IMAG
}
 Static methods for creating images. More...
 

Public Member Functions

 ImageFactory ()=delete
 
 ~ImageFactory ()
 

Static Public Member Functions

template<class T >
static SPIIT createImage (const casacore::String &outfile, const casacore::CoordinateSystem &cSys, const casacore::IPosition &shape, casacore::Bool log, casacore::Bool overwrite, const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &msgs)
 Create a casacore::TempImage if outfile is empty, otherwise a PagedImage. More...
 
static std::shared_ptr
< ComponentListImage
createComponentListImage (const casacore::String &outfile, const casacore::Record &cl, const casacore::Vector< casacore::Int > &shape, const casacore::Record &csys, casacore::Bool overwrite, casacore::Bool log, casacore::Bool cache)
 create a ComponentListImage More...
 
static casacore::String className ()
 
static SPIIF floatImageFromShape (const casacore::String &outfile, const casacore::Vector< casacore::Int > &shape, const casacore::Record &csys, casacore::Bool linear=true, casacore::Bool overwrite=false, casacore::Bool verbose=true, const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &msgs=nullptr)
 create an image with the specified shape and specified coordinate system. More...
 
static SPIIC complexImageFromShape (const casacore::String &outfile, const casacore::Vector< casacore::Int > &shape, const casacore::Record &csys, casacore::Bool linear=true, casacore::Bool overwrite=false, casacore::Bool verbose=true, const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &msgs=nullptr)
 
static SPIID doubleImageFromShape (const casacore::String &outfile, const casacore::Vector< casacore::Int > &shape, const casacore::Record &csys, casacore::Bool linear=true, casacore::Bool overwrite=false, casacore::Bool verbose=true, const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &msgs=nullptr)
 
static SPIIDC complexDoubleImageFromShape (const casacore::String &outfile, const casacore::Vector< casacore::Int > &shape, const casacore::Record &csys, casacore::Bool linear=true, casacore::Bool overwrite=false, casacore::Bool verbose=true, const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &msgs=nullptr)
 
static ITUPLE fromImage (const casacore::String &outfile, const casacore::String &infile, const casacore::Record &region, const casacore::String &mask, casacore::Bool dropdeg=false, casacore::Bool overwrite=false)
 only the pointer of the correct data type will be valid, the other will be null. More...
 
template<class T >
static SPIIT imageFromArray (const casacore::String &outfile, const casacore::Array< T > &pixels, const casacore::Record &csys, casacore::Bool linear=false, casacore::Bool overwrite=false, casacore::Bool verbose=true, const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &msgs=nullptr)
 
static SPIIF fromASCII (const casacore::String &outfile, const casacore::String &infile, const casacore::IPosition &shape, const casacore::String &sep, const casacore::Record &csys, const casacore::Bool linear, const casacore::Bool overwrite)
 
template<class T >
static SPIIT fromShape (const casacore::String &outfile, const casacore::Vector< casacore::Int > &shape, const casacore::Record &csys, casacore::Bool linear=false, casacore::Bool overwrite=false, casacore::Bool verbose=false, const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &msgs=nullptr)
 
template<class T >
static std::shared_ptr
< casacore::TempImage< T > > 
floatFromComplex (std::shared_ptr< const casacore::ImageInterface< std::complex< T >> > complexImage, ComplexToFloatFunction func)
 Create a float-valued image from a complex-valued image. More...
 
template<class T >
static std::shared_ptr
< casacore::TempImage
< std::complex< T > > > 
makeComplexImage (SPCIIT realPart, SPCIIT imagPart)
 Create a complex-valued image from two real valued images. More...
 
template<class T >
static std::shared_ptr
< casacore::ImageInterface
< std::complex< T > > > 
makeComplex (SPCIIT realPart, SPCIIT imagPart, const casacore::String &outfile, const casacore::Record &region, casacore::Bool overwrite=false)
 Create a complex-valued image from two real-valued images. More...
 
static ITUPLE fromFile (const casacore::String &filename, casacore::Bool cache=casacore::True)
 exactly one of the pointers will not be null, indicating the pixel data type. More...
 
static SPIIF fromFile (const casacore::String &filename, casacore::Float, casacore::Bool cache=casacore::True)
 for specific types More...
 
static SPIID fromFile (const casacore::String &filename, casacore::Double, casacore::Bool cache=casacore::True)
 
static SPIIC fromFile (const casacore::String &filename, casacore::Complex, casacore::Bool cache=casacore::True)
 
static SPIIDC fromFile (const casacore::String &filename, casacore::DComplex, casacore::Bool cache=casacore::True)
 
static SPIIF fromFITS (const casacore::String &outfile, const casacore::String &fitsfile, const casacore::Int whichrep, const casacore::Int whichhdu, const casacore::Bool zeroBlanks, const casacore::Bool overwrite)
 
static std::pair< SPIIF, SPIICfromRecord (const casacore::RecordInterface &rec, const casacore::String &imagename="")
 
template<class T >
static void remove (SPIIT &image, casacore::Bool verbose)
 
static void rename (SPIIF &image, const casacore::String &name, const casacore::Bool overwrite)
 if successful, image will be reset to point to new image upon return More...
 
static void rename (SPIIC &image, const casacore::String &name, const casacore::Bool overwrite)
 
static SPIIF testImage (const casacore::String &outfile, const casacore::Bool overwrite, const casacore::String &imagetype="2d")
 open a canonical image More...
 
static void toASCII (SPCIIF image, const casacore::String &outfile, casacore::Record &region, const casacore::String &mask, const casacore::String &sep=" ", const casacore::String &format="%e", casacore::Double maskvalue=-999, casacore::Bool overwrite=false, casacore::Bool extendMask=false)
 
static void toFITS (SPCIIF image, const casacore::String &outfile, casacore::Bool velocity, casacore::Bool optical, casacore::Int bitpix, casacore::Double minpix, casacore::Double maxpix, const casacore::Record &region, const casacore::String &mask, casacore::Bool overwrite=false, casacore::Bool dropdeg=false, casacore::Bool deglast=false, casacore::Bool dropstokes=false, casacore::Bool stokeslast=false, casacore::Bool wavelength=false, casacore::Bool airWavelength=false, const casacore::String &origin="", casacore::Bool stretch=false, casacore::Bool history=true)
 

Static Private Member Functions

template<class T >
static SPIIT _fromRecord (const casacore::RecordInterface &rec, const casacore::String &name)
 
static void _centerRefPix (casacore::CoordinateSystem &csys, const casacore::IPosition &shape)
 
static void _checkInfile (const casacore::String &infile)
 
static casacore::CoordinateSystem_makeCoordinateSystem (const casacore::Record &cSys, const casacore::IPosition &shape)
 Convert a casacore::Record to a CoordinateSystem. More...
 
static void _checkOutfile (const casacore::String &outfile, casacore::Bool overwrite)
 
static ITUPLE _fromLatticeBase (std::unique_ptr< casacore::LatticeBase > &latt)
 
static casacore::String _imageCreationMessage (const casacore::String &outfile, const ITUPLE &imagePtrs)
 
static casacore::String _imageCreationMessage (const casacore::String &outfile, const casacore::IPosition &shape, casacore::DataType dataType)
 
template<class T >
static ITUPLE _rename (SPIIT &image, const casacore::String &name, const casacore::Bool overwrite)
 if successful, image will point to the newly named image upone return More...
 

Detailed Description

Definition at line 55 of file ImageFactory.h.

Member Enumeration Documentation

Static methods for creating images.

Etymology

Synopsis

Enumerator
REAL 
IMAG 

Definition at line 74 of file ImageFactory.h.

Constructor & Destructor Documentation

casa::ImageFactory::ImageFactory ( )
delete
casa::ImageFactory::~ImageFactory ( )
inline

Definition at line 81 of file ImageFactory.h.

Member Function Documentation

static void casa::ImageFactory::_centerRefPix ( casacore::CoordinateSystem csys,
const casacore::IPosition shape 
)
staticprivate
static void casa::ImageFactory::_checkInfile ( const casacore::String infile)
staticprivate
static void casa::ImageFactory::_checkOutfile ( const casacore::String outfile,
casacore::Bool  overwrite 
)
staticprivate
static ITUPLE casa::ImageFactory::_fromLatticeBase ( std::unique_ptr< casacore::LatticeBase > &  latt)
staticprivate
template<class T >
static SPIIT casa::ImageFactory::_fromRecord ( const casacore::RecordInterface rec,
const casacore::String name 
)
staticprivate
static casacore::String casa::ImageFactory::_imageCreationMessage ( const casacore::String outfile,
const ITUPLE imagePtrs 
)
staticprivate
static casacore::String casa::ImageFactory::_imageCreationMessage ( const casacore::String outfile,
const casacore::IPosition shape,
casacore::DataType  dataType 
)
staticprivate
static casacore::CoordinateSystem* casa::ImageFactory::_makeCoordinateSystem ( const casacore::Record cSys,
const casacore::IPosition shape 
)
staticprivate

Convert a casacore::Record to a CoordinateSystem.

template<class T >
static ITUPLE casa::ImageFactory::_rename ( SPIIT image,
const casacore::String name,
const casacore::Bool  overwrite 
)
staticprivate

if successful, image will point to the newly named image upone return

static casacore::String casa::ImageFactory::className ( )
inlinestatic

Definition at line 101 of file ImageFactory.h.

static SPIIDC casa::ImageFactory::complexDoubleImageFromShape ( const casacore::String outfile,
const casacore::Vector< casacore::Int > &  shape,
const casacore::Record csys,
casacore::Bool  linear = true,
casacore::Bool  overwrite = false,
casacore::Bool  verbose = true,
const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &  msgs = nullptr 
)
static
static SPIIC casa::ImageFactory::complexImageFromShape ( const casacore::String outfile,
const casacore::Vector< casacore::Int > &  shape,
const casacore::Record csys,
casacore::Bool  linear = true,
casacore::Bool  overwrite = false,
casacore::Bool  verbose = true,
const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &  msgs = nullptr 
)
static
static std::shared_ptr<ComponentListImage> casa::ImageFactory::createComponentListImage ( const casacore::String outfile,
const casacore::Record cl,
const casacore::Vector< casacore::Int > &  shape,
const casacore::Record csys,
casacore::Bool  overwrite,
casacore::Bool  log,
casacore::Bool  cache 
)
static
template<class T >
static SPIIT casa::ImageFactory::createImage ( const casacore::String outfile,
const casacore::CoordinateSystem cSys,
const casacore::IPosition shape,
casacore::Bool  log,
casacore::Bool  overwrite,
const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &  msgs 
)
static

Create a casacore::TempImage if outfile is empty, otherwise a PagedImage.

If log is true, log useful messages, quiet if false. Created image has all pixel values set to zero and is unmasked.

static SPIID casa::ImageFactory::doubleImageFromShape ( const casacore::String outfile,
const casacore::Vector< casacore::Int > &  shape,
const casacore::Record csys,
casacore::Bool  linear = true,
casacore::Bool  overwrite = false,
casacore::Bool  verbose = true,
const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &  msgs = nullptr 
)
static
template<class T >
static std::shared_ptr<casacore::TempImage<T> > casa::ImageFactory::floatFromComplex ( std::shared_ptr< const casacore::ImageInterface< std::complex< T >> >  complexImage,
ComplexToFloatFunction  func 
)
static

Create a float-valued image from a complex-valued image.

All metadata is copied and pixel values are initialized according to func.

static SPIIF casa::ImageFactory::floatImageFromShape ( const casacore::String outfile,
const casacore::Vector< casacore::Int > &  shape,
const casacore::Record csys,
casacore::Bool  linear = true,
casacore::Bool  overwrite = false,
casacore::Bool  verbose = true,
const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &  msgs = nullptr 
)
static

create an image with the specified shape and specified coordinate system.

If outfile is blank, the returned object is a casacore::TempImage, casacore::PagedImage otherwise. If csys is empty, a default coordiante system is attached to the image, and if linear is true, it has linear coordinates in place of the direction coordinate.

static SPIIF casa::ImageFactory::fromASCII ( const casacore::String outfile,
const casacore::String infile,
const casacore::IPosition shape,
const casacore::String sep,
const casacore::Record csys,
const casacore::Bool  linear,
const casacore::Bool  overwrite 
)
static
static ITUPLE casa::ImageFactory::fromFile ( const casacore::String filename,
casacore::Bool  cache = casacore::True 
)
static

exactly one of the pointers will not be null, indicating the pixel data type.

Cache is only used if the image is a CompoenentListImage

static SPIIF casa::ImageFactory::fromFile ( const casacore::String filename,
casacore::Float  ,
casacore::Bool  cache = casacore::True 
)
static

for specific types

static SPIID casa::ImageFactory::fromFile ( const casacore::String filename,
casacore::Double  ,
casacore::Bool  cache = casacore::True 
)
static
static SPIIC casa::ImageFactory::fromFile ( const casacore::String filename,
casacore::Complex  ,
casacore::Bool  cache = casacore::True 
)
static
static SPIIDC casa::ImageFactory::fromFile ( const casacore::String filename,
casacore::DComplex  ,
casacore::Bool  cache = casacore::True 
)
static
static SPIIF casa::ImageFactory::fromFITS ( const casacore::String outfile,
const casacore::String fitsfile,
const casacore::Int  whichrep,
const casacore::Int  whichhdu,
const casacore::Bool  zeroBlanks,
const casacore::Bool  overwrite 
)
static
static ITUPLE casa::ImageFactory::fromImage ( const casacore::String outfile,
const casacore::String infile,
const casacore::Record region,
const casacore::String mask,
casacore::Bool  dropdeg = false,
casacore::Bool  overwrite = false 
)
static

only the pointer of the correct data type will be valid, the other will be null.

static std::pair<SPIIF, SPIIC> casa::ImageFactory::fromRecord ( const casacore::RecordInterface rec,
const casacore::String imagename = "" 
)
static
template<class T >
static SPIIT casa::ImageFactory::fromShape ( const casacore::String outfile,
const casacore::Vector< casacore::Int > &  shape,
const casacore::Record csys,
casacore::Bool  linear = false,
casacore::Bool  overwrite = false,
casacore::Bool  verbose = false,
const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &  msgs = nullptr 
)
static
template<class T >
static SPIIT casa::ImageFactory::imageFromArray ( const casacore::String outfile,
const casacore::Array< T > &  pixels,
const casacore::Record csys,
casacore::Bool  linear = false,
casacore::Bool  overwrite = false,
casacore::Bool  verbose = true,
const std::vector< std::pair< casacore::LogOrigin, casacore::String > > *const &  msgs = nullptr 
)
static
template<class T >
static std::shared_ptr<casacore::ImageInterface<std::complex<T> > > casa::ImageFactory::makeComplex ( SPCIIT  realPart,
SPCIIT  imagPart,
const casacore::String outfile,
const casacore::Record region,
casacore::Bool  overwrite = false 
)
static

Create a complex-valued image from two real-valued images.

All metadata is copied from the real image and pixel values are initialized to realPart + i*complexPart

template<class T >
static std::shared_ptr<casacore::TempImage<std::complex<T> > > casa::ImageFactory::makeComplexImage ( SPCIIT  realPart,
SPCIIT  imagPart 
)
static

Create a complex-valued image from two real valued images.

All metadata is copied from the real image and pixel values are initialized to realPart + i*complexPart

template<class T >
static void casa::ImageFactory::remove ( SPIIT image,
casacore::Bool  verbose 
)
static
static void casa::ImageFactory::rename ( SPIIF image,
const casacore::String name,
const casacore::Bool  overwrite 
)
static

if successful, image will be reset to point to new image upon return

static void casa::ImageFactory::rename ( SPIIC image,
const casacore::String name,
const casacore::Bool  overwrite 
)
static
static SPIIF casa::ImageFactory::testImage ( const casacore::String outfile,
const casacore::Bool  overwrite,
const casacore::String imagetype = "2d" 
)
static

open a canonical image

static void casa::ImageFactory::toASCII ( SPCIIF  image,
const casacore::String outfile,
casacore::Record region,
const casacore::String mask,
const casacore::String sep = " ",
const casacore::String format = "%e",
casacore::Double  maskvalue = -999,
casacore::Bool  overwrite = false,
casacore::Bool  extendMask = false 
)
static
static void casa::ImageFactory::toFITS ( SPCIIF  image,
const casacore::String outfile,
casacore::Bool  velocity,
casacore::Bool  optical,
casacore::Int  bitpix,
casacore::Double  minpix,
casacore::Double  maxpix,
const casacore::Record region,
const casacore::String mask,
casacore::Bool  overwrite = false,
casacore::Bool  dropdeg = false,
casacore::Bool  deglast = false,
casacore::Bool  dropstokes = false,
casacore::Bool  stokeslast = false,
casacore::Bool  wavelength = false,
casacore::Bool  airWavelength = false,
const casacore::String origin = "",
casacore::Bool  stretch = false,
casacore::Bool  history = true 
)
static

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