29 #ifndef IMAGES_IMAGEREGRID_H
30 #define IMAGES_IMAGEREGRID_H
43 template<
class T>
class MaskedLattice;
44 template<
class T>
class ImageInterface;
45 template<
class T>
class Lattice;
209 std::set<Coordinate::Type>& coordsToBeRegridded,
249 Int inCoordinate,
Int outCoordinate,
264 Bool outIsMasked,
Bool showProgress,
272 const Unit& imageUnit,
275 Int inCoordinate,
Int outCoordinate,
292 Int inCoordinate,
Int outCoordinate,
310 uInt xOutCorrAxis,
uInt yOutCorrAxis,
320 Int inAxisInCoordinate,
321 Int outAxisInCoordinate,
337 Int inAxisInCoordinate,
338 Int outAxisInCoordinate,
343 Bool useMachine,
Bool showProgress);
388 #ifndef CASACORE_NO_AUTO_TEMPLATES
389 #include <casacore/images/Images/ImageRegrid.tcc>
390 #endif //# CASACORE_NO_AUTO_TEMPLATES
A Vector of integers, for indexing into Array<T> objects.
Matrix< Bool > its2DCoordinateGridMask
A read/write lattice iterator.
void make1DCoordinateGrid(Block< typename NumericTraits< T >::BaseType > &xOut, Vector< Bool > &failed, Bool &allFailed, Bool &allGood, const Coordinate &inCoord, const Coordinate &outCoord, Int inAxisInCoordinate, Int outAxisInCoordinate, MFrequency::Convert &machine, Bool useMachine)
Make regridding coordinate grid for this axis.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void set2DCoordinateGrid(const Cube< Double > &grid, const Matrix< Bool > &gridMask, Bool notify=False)
Bool insert(ImageInterface< T > &outImage, const Vector< Double > &outPixelLocation, const ImageInterface< T > &inImage)
Inserts inImage into outImage.
A templated, abstract base class for array-like objects with masks.
ostream-like interface to creating log messages.
void regrid2DMatrix(Lattice< T > &outCursor, LatticeIterator< Bool > *&outMaskIterPtr, const Interpolate2D &interp, ProgressMeter *&pProgress, Double &iPix, uInt nDim, uInt xInAxis, uInt yInAxis, uInt xOutAxis, uInt yOutAxis, Double scale, Bool inIsMasked, Bool outIsMasked, const IPosition &outPos, const IPosition &outCursorShape, const IPosition &inChunkShape, const IPosition &inChunkBlc, const IPosition &pixelAxisMap2, Array< T > &inDataChunk, Array< Bool > *&inMaskChunkPtr, const Cube< Double > &pix2DPos, const Matrix< Bool > &succeed)
Store miscellaneous information related to an observation.
Bool itsDisableConversions
Matrix< Bool > itsUser2DCoordinateGridMask
ImageRegrid< T > & operator=(const ImageRegrid &other)
Assignment copy semantics)
Cube< Double > its2DCoordinateGrid
A templated, abstract base class for array-like objects.
A base class for astronomical images.
Interconvert pixel positions and directions (e.g. RA/DEC).
Interface for converting between world and pixel coordinates.
void make2DCoordinateGrid(LogIO &os, Bool &allFail, Bool &missedIt, Double &minInX, Double &minInY, Double &maxInX, Double &maxInY, Cube< Double > &in2DPos, Matrix< Bool > &succeed, const CoordinateSystem &inCoords, const CoordinateSystem &outCoords, Int inCoordinate, Int outCoordinate, uInt xInAxis, uInt yInAxis, uInt xOutAxis, uInt yOutAxis, const IPosition &inPixelAxes, const IPosition &outPixelAxes, const IPosition &inShape, const IPosition &outPos, const IPosition &cursorShape, uInt decimate=0)
Make regridding coordinate grid for this cursor.
void findMaps(uInt nDim, Vector< Int > &pixelAxisMap1, Vector< Int > &pixelAxisMap2, const CoordinateSystem &inCoords, const CoordinateSystem &outCoords) const
Find maps between coordinate systems.
void get2DCoordinateGrid(Cube< Double > &grid, Matrix< Bool > &gridMask) const
Get and set the 2-D coordinate grid.
void regrid1D(MaskedLattice< T > &outLattice, const MaskedLattice< T > &inLattice, const Coordinate &inCoord, const Coordinate &outCoord, const Vector< Int > &inPixelAxes, const Vector< Int > &outPixelAxes, Int inAxisInCoordinate, Int outAxisInCoordinate, const Vector< Int > pixelAxisMap, typename Interpolate2D::Method method, MFrequency::Convert &machine, Bool replicate, Bool useMachine, Bool showProgress)
Regrid 1 axis.
bool Bool
Define the standard types used by Casacore.
void regrid(ImageInterface< T > &outImage, typename Interpolate2D::Method method, const IPosition &whichOutPixelAxes, const ImageInterface< T > &inImage, Bool replicate=False, uInt decimate=0, Bool showProgress=False, Bool forceRegrid=False, Bool verbose=False)
Regrid inImage onto the grid specified by outImage.
Bool minmax(Double &minX, Double &maxX, Double &minY, Double &maxY, const Array< Double > &xData, const Array< Double > &yData, const Array< Bool > &mask)
void showDebugInfo(Int level=0)
Print out useful debugging information (level 0 is none, 1 is some, 2 is too much) ...
This regrids one image to match the coordinate system of another.
Visual indication of a tasks progress.
void regridTwoAxisCoordinate(LogIO &os, MaskedLattice< T > &outLattice, const MaskedLattice< T > &inLattice, const Unit &imageUnit, const CoordinateSystem &inCoords, const CoordinateSystem &outCoords, Int inCoordinate, Int outCoordinate, const Vector< Int > inPixelAxes, const Vector< Int > outPixelAxes, const Vector< Int > pixelAxisMap1, const Vector< Int > pixelAxisMap2, typename Interpolate2D::Method method, Bool replicate, uInt decimate, Bool showProgress)
Regrid DirectionCoordinate or 2-axis LinearCoordinate.
void findXYExtent(Bool &missedIt, Bool &allFailed, Double &minInX, Double &minInY, Double &maxInX, Double &maxInY, Cube< Double > &in2DPos, const Matrix< Bool > &succeed, uInt xInAxis, uInt yInAxis, uInt xOutAxis, uInt yOutAxis, const IPosition &outPos, const IPosition &outCursorShape, const IPosition &inShape)
ImageRegrid()
Default constructor.
void disableReferenceConversions(Bool disable=True)
Enable/disable Measures Reference conversions.
void _checkAxes(IPosition &outPixelAxes, const IPosition &inShape, const IPosition &outShape, const Vector< Int > &pixelAxisMap, const CoordinateSystem &outCoords, Bool verbose)
Check shape and axes.
Cube< Double > itsUser2DCoordinateGrid
A two dimension interpolator for Matrices or Arrays.
Char BaseType
Numeric type.
void _regridOneCoordinate(LogIO &os, IPosition &outShape2, Vector< Bool > &doneOutPixelAxes, MaskedLattice< T > *&finalOutPtr, MaskedLattice< T > *&inPtr, MaskedLattice< T > *&outPtr, CoordinateSystem &outCoords, const CoordinateSystem &inCoords, Int outPixelAxis, const ImageInterface< T > &inImage, const IPosition &outShape, Bool replicate, uInt decimate, Bool outIsMasked, Bool showProgress, Bool forceRegrid, typename Interpolate2D::Method method, Bool verbose)
Regrid one Coordinate.
Interconvert pixel and world coordinates.
Double findScaleFactor(const Unit &units, const CoordinateSystem &inCoords, const CoordinateSystem &outCoords, Int inCoordinate, Int outCoordinate, LogIO &os) const
Find scale factor to conserve flux.
static CoordinateSystem makeCoordinateSystem(LogIO &os, std::set< Coordinate::Type > &coordsToBeRegridded, const CoordinateSystem &cSysTo, const CoordinateSystem &cSysFrom, const IPosition &axes, const IPosition &inShape=IPosition(), Bool giveStokesWarning=True)
Helper function.