Skip to content

Instantly share code, notes, and snippets.

@tammojan
Created August 14, 2015 07:29
Show Gist options
  • Save tammojan/7cc75bfb5b151fef13a6 to your computer and use it in GitHub Desktop.
Save tammojan/7cc75bfb5b151fef13a6 to your computer and use it in GitHub Desktop.
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Arrays/ArrayBase.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Arrays/ArrayBase.cc
95c95
< void ArrayBase::baseReform (ArrayBase& tmp, const IPosition& len) const
---
> void ArrayBase::baseReform (ArrayBase& tmp, const IPosition& len, Bool strict) const
98c98
< if (len.product() != Int64(nelements())) {
---
> if (strict && len.product() != Int64(nelements())) {
116a117
> tmp.nels_p = len.product();
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Arrays/ArrayBase.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Arrays/ArrayBase.h
193,194c193,195
< // Reform the array to a shape with the same nr of elements.
< void baseReform (ArrayBase& tmp, const IPosition& shape) const;
---
> // Reform the array to a shape with the same nr of elements. If nonStrict then
> // caller assumes responsibility for not overrunning storage (avoid or use with extreme care).
> void baseReform (ArrayBase& tmp, const IPosition& shape, Bool strict=True) const;
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Arrays/Array.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Arrays/Array.h
170a171,172
> typedef T ElementType;
>
346c348,376
<
---
>
> // Having an array that can be reused without requiring reallocation can
> // be useful for large arrays. The method reformOrResize permits this
> // usage.
> //
> // The reformOrResize method first attempts to reform the matrix so that
> // it reuses the existing storage for an array with a new shape. If the
> // existing storage will not hold the new shape, then the method will
> // resize the array when resizeIfNeeded is true; if a resize is needed and
> // resizeIfNeeded is false, then an ArrayConformanceError is thrown. The
> // copyDataIfNeeded parameter is passed to resize if resizing is performed.
> // resizePercentage is the percent of additional storage to be addeed when
> // a resize is performed; this allows the allocations to be amortized when
> // the caller expects to be callin this method again in the future. The
> // parameter is used to define an allocation shape which differs from the
> // newShape by increasing the last dimension by resizePercentage percent
> // (i.e., lastDim = *lastDim * (100 + resizePercentage)) / 100). If
> // resizePercentage <= 0 then resizing uses newShape as is.
> //
> // To truncate the array so that it no longer holds additional storage,
> // use the resize method.
>
> void reformOrResize (const IPosition & newShape,
> Bool resizeIfNeeded,
> Bool copyDataIfNeeded = True,
> uInt resizePercentage = 0);
>
> size_t capacity () const; // returns the number of elements allocated.
>
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Arrays/Array.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Arrays/Array.tcc
451c451,453
< template<class T> Array<T> Array<T>::reform(const IPosition &len) const
---
> template<class T>
> Array<T>
> Array<T>::reform(const IPosition &len) const
455a458,466
>
> if (len.product () > (Int64) (data_p->nelements())){
> String message =
> String::format ("Array<T>::reform() - insufficient storage for nonStrict reform: "
> "nElementInAllocation=%d, nElementsRequested=%d",
> data_p->nelements(), len.product());
> throw ArrayConformanceError(message);
> }
>
457c468
< baseReform (tmp, len);
---
> baseReform (tmp, len, False);
459a471,545
> }
>
> template<class T>
> void
> Array<T>::reformOrResize (const IPosition & newShape,
> Bool resizeIfNeeded,
> Bool copyDataIfNeeded,
> uInt resizePercentage)
> {
> DebugAssert(ok(), ArrayError);
>
> if (newShape == shape()){
> return; // No op
> }
>
> if (!contiguous_p){
> String message = "Array<T>::reformOrResize() - array must be contiguous";
> throw ArrayConformanceError(message);
> }
>
> // Check if reform is possible and needed.
> // If not needed, simply return a copy.
>
> Bool resizeNeeded = (newShape.product() > (Int64) (data_p->nelements()));
>
> if (resizeNeeded){
>
> // Insufficient storage so resize required
>
> if (resizeNeeded && ! resizeIfNeeded){
>
> // Resize not permitted so throw ArrayConformanceError
>
> String message =
> String::format ("Array<T>::reformOrResize() - insufficient storage for reform: "
> "nElementInAllocation=%d, nElementsRequested=%d",
> data_p->nelements(), newShape.product());
> throw ArrayConformanceError(message);
> }
>
> // Resize the array either exactly or with padding.
>
> if (resizePercentage <= 0){
>
> // Perform an exact resize
>
> resize (newShape, copyDataIfNeeded);
>
> } else {
>
> // Padding was requested so resize to match the padded shape
> // and then reform it to use the desired shape.
>
> IPosition paddedShape;
> paddedShape = newShape;
> paddedShape.last() = (paddedShape.last() * (100 + resizePercentage)) / 100;
> resize (paddedShape, copyDataIfNeeded);
>
> // Reform it
>
> baseReform (* this, newShape, False);
> setEndIter();
> }
> } else {
>
> baseReform (* this, newShape, False);
> setEndIter();
> }
> }
>
> template<class T>
> size_t
> Array<T>::capacity () const
> {
> return data_p->nelements(); // returns the number of elements allocated.
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/BasicMath/test/tMathNaN.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/BasicMath/test/tMathNaN.cc
211c211
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21505 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/BasicSL/Complexfwd.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/BasicSL/Complexfwd.h
44a45
> #ifdef AIPS_CXX11
45a47,51
> #else
> namespace std {
> template<typename T> struct complex;
> }
> #endif
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Exceptions/CasaErrorTools.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Exceptions/CasaErrorTools.cc
59a60
> #include <execinfo.h>
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Exceptions/Error2.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Exceptions/Error2.cc
109c109
< String AipsError::getLastStackTrace ();
---
> String AipsError::getLastStackTrace ()
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/IO/IO_1.html /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/IO/IO_1.html
27c27,29
< <!-- hhmts start -->Last modified: Mon Oct 27 14:15:00 CET 2014 <!-- hhmts end -->
---
> <!-- hhmts start -->
> Last modified: Wed Nov 20 14:34:05 1996
> <!-- hhmts end -->
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/IO/MemoryIO.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/IO/MemoryIO.cc
32,33d31
< #include <iostream>
< #include <sstream>
141,146c139,142
< std::ostringstream oss;
< oss << "MemoryIO::read - incorrect number of bytes read: "
< << std::endl
< << " size=" << size << ", used=" << itsUsed
< << ", pos=" << itsPosition << ", left=" << bytesLeft;
< throw AipsError (oss.str());
---
> String m = String::format ("MemoryIO::read - incorrect number of bytes read:\n"
> " size=%u, used=%lld, pos=%lld, left=%lld",
> size, itsUsed, itsPosition, bytesLeft);
> throw (AipsError (m));
149,154c145,148
< std::ostringstream oss;
< oss << "MemoryIO::read - buffer position is invalid:"
< << std::endl
< << " size=" << size << ", used=" << itsUsed
< << ", pos=" << itsPosition << ", left=" << bytesLeft;
< throw AipsError (oss.str());
---
> String m = String::format ("MemoryIO::read - buffer position is invalid:\n"
> " size=%u, used=%lld, pos=%lld, left=%lld",
> size, itsUsed, itsPosition, bytesLeft);
> throw (AipsError (m));
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/IO/test/CMakeLists.txt /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/IO/test/CMakeLists.txt
19d18
< tMultiHDF5
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/IO/test/tAipsIO.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/IO/test/tAipsIO.cc
33a34
> #include <casacore/casa/IO/MultiHDF5.h>
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Quanta/Quantum.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Quanta/Quantum.h
31,32d30
<
< //# Includes
345,346c343,355
< // Get value in specified units
< Qtype getValue(const Unit &other) const;
---
>
> // Get value in specified units. If the <src>other</src> units do not conform to
> // the units of this object and requireConform is True, an exception is thrown,
> // with the following excepions:
> // angle to/from time conversions are implicitly supported, frequency to/from
> // wavelength conversions are implicitly supported.
> // Note, I added requireConform and made the default value False for backward
> // compatibility. However, I think that ultimately requireConform should be removed
> // and an exception should be thrown if the units do not conform. It's not clear to
> // me what this was not in the original implementation; it's much to easy for
> // non-conformation bugs to slip by unnoticed. - dmehring 09feb2015
> Qtype getValue(const Unit &other, Bool requireConform=False) const;
>
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Quanta/Quantum.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Quanta/Quantum.tcc
227,235c227,264
< Qtype Quantum<Qtype>::getValue(const Unit &other) const {
< Double d1 = other.getValue().getFac() /
< qUnit.getValue().getFac(); // SUN native overloading problems
< if (qUnit.getValue() == UnitVal::ANGLE) {
< if (other.getValue() == UnitVal::TIME)
< d1 *= C::circle/C::day;
< } else if (qUnit.getValue() == UnitVal::TIME) {
< if (other.getValue() == UnitVal::ANGLE)
< d1 *= C::day/C::circle;
---
> Qtype Quantum<Qtype>::getValue(const Unit &other, Bool requireConform) const {
> UnitVal myType = qUnit.getValue();
> UnitVal otherType = other.getValue();
> Double myFac = myType.getFac();
> Double otherFac = otherType.getFac();
> Double d1 = otherFac/myFac;
> if (myType == otherType) {
> return (Qtype)(qVal/d1);
> }
> if (
> myType == UnitVal::ANGLE
> && otherType == UnitVal::TIME
> ) {
> d1 *= C::circle/C::day;
> }
> else if (
> myType == UnitVal::TIME
> && otherType == UnitVal::ANGLE
> ) {
> d1 *= C::day/C::circle;
> }
> else if(
> myType == 1/UnitVal::TIME
> && otherType == UnitVal::LENGTH
> ) {
> return (Qtype)(C::c/qVal/myFac/otherFac);
> }
> else if(
> myType == UnitVal::LENGTH
> && otherType == 1/UnitVal::TIME
> ) {
> return (Qtype)(C::c/qVal/myFac/otherFac);
> }
> else if (requireConform) {
> ThrowCc(
> "From/to units not consistent. Cannot convert "
> + qUnit.getName() + " to " + other.getName()
> );
360d388
<
362d389
<
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Quanta/test/tQuantum.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Quanta/test/tQuantum.cc
26,27c26
< //# $Id$
<
---
> //# $Id: tQuantum.cc 21090 2011-06-01 10:01:28Z gervandiepen $
275a275,308
> {
> // getValue()
> Bool thrown = False;
> try {
> // doesn't throw by default
> Quantum<Double> q(1, "Hz");
> q.getValue("K");
> }
> catch (const AipsError& x) {
> thrown = True;
> }
> AlwaysAssert(! thrown, AipsError);
>
> try {
> Quantum<Double> q(1, "Hz");
> q.getValue("K", True);
> }
> catch (const AipsError& x) {
> thrown = True;
> }
> AlwaysAssert(thrown, AipsError);
>
> Quantum<Double> q(1, "m");
> AlwaysAssert(q.getValue("km") == 0.001, AipsError);
> q = Quantum<Double>(1, "h");
> AlwaysAssert(q.getValue("deg") == 15, AipsError);
> q = Quantum<Double>(30, "deg");
> AlwaysAssert(near(q.getValue("min"), 120.0), AipsError);
> q = Quantum<Double>(1.5, "GHz");
> AlwaysAssert(near(q.getValue("cm"), 19.9862, 1e-5), AipsError);
> q = Quantum<Double>(3, "mm");
> AlwaysAssert(near(q.getValue("MHz"), 99930.8, 1e-5), AipsError);
>
> }
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/Utilities/GenSort.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/Utilities/GenSort.tcc
38c38,39
< #ifdef _OPENMP
---
> // (CAS-7378)
> #ifdef DISABLED_FOR_4_4
80,81c81,85
< #ifdef _OPENMP
< #pragma omp parallel for
---
> /* TODO only uses 2 threads of the group, should use tasks
> * only parallelize when work time ~ barrier spin time (3ms)
> * otherwise oversubscription kills performance */
> #ifdef DISABLED_FOR_4_4
> #pragma omp parallel for if (nr > 50000)
242c246
< #ifdef _OPENMP
---
> #ifdef DISABLED_FOR_4_4
247d250
< omp_set_num_threads (nthr);
264,265c267,268
< #ifdef _OPENMP
< #pragma omp parallel for
---
> #ifdef DISABLED_FOR_4_4
> #pragma omp parallel for num_threads(nthr)
349c352
< #ifdef _OPENMP
---
> #ifdef DISABLED_FOR_4_4
437c440
< #ifdef _OPENMP
---
> #ifdef DISABLED_FOR_4_4
511c514
< #ifdef _OPENMP
---
> #ifdef DISABLED_FOR_4_4
581c584
< #ifdef _OPENMP
---
> #ifdef DISABLED_FOR_4_4
586d588
< omp_set_num_threads (nthr);
603,604c605,606
< #ifdef _OPENMP
< #pragma omp parallel for
---
> #ifdef DISABLED_FOR_4_4
> #pragma omp parallel for num_threads(nthr)
674c676
< #ifdef _OPENMP
---
> #ifdef DISABLED_FOR_4_4
758,759c760,764
< #ifdef _OPENMP
< #pragma omp parallel for
---
> /* TODO only uses 2 threads of the group, should use tasks
> * only parallelize when work time ~ barrier spin time (3ms)
> * otherwise oversubscription kills performance */
> #ifdef DISABLED_FOR_4_4
> #pragma omp parallel for if (nr > 50000)
diff -I '.*\$Id.*' -r casacore-2.0.1/casa/version.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/casa/version.h
34c34
< #define CASACORE_VERSION "2.0.0"
---
> #define CASACORE_VERSION "2.0.2"
Only in casacore-2.0.1/: casacore
Only in casacore-2.0.1/: changescripts
Only in casacore-2.0.1/: CHANGES.md
diff -I '.*\$Id.*' -r casacore-2.0.1/cmake/cmake_assay /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/cmake/cmake_assay
35c35
< $rootdir/build-tools/casacore_assay "$@"
---
> $rootdir/scons-tools/casacore_assay "$@"
diff -I '.*\$Id.*' -r casacore-2.0.1/cmake/FindCFITSIO.cmake /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/cmake/FindCFITSIO.cmake
36c36
< HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio include/libcfitsio0)
---
> PATHS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio)
38c38
< HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib)
---
> PATHS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib)
diff -I '.*\$Id.*' -r casacore-2.0.1/cmake/FindHDF5.cmake /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/cmake/FindHDF5.cmake
205c205
< HINTS
---
> PATHS
diff -I '.*\$Id.*' -r casacore-2.0.1/cmake/FindWCSLIB.cmake /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/cmake/FindWCSLIB.cmake
36c36
< HINTS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES include)
---
> PATHS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES include)
38c38
< HINTS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES lib)
---
> PATHS ${WCSLIB_ROOT_DIR} PATH_SUFFIXES lib)
diff -I '.*\$Id.*' -r casacore-2.0.1/CMakeLists.txt /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/CMakeLists.txt
10c10
< set(PROJECT_VERSION_PATCH 1)
---
> set(PROJECT_VERSION_PATCH 0)
14a15,30
> SET(NO_SOVERSION FALSE CACHE BOOL "do not add version information to shared libraries")
> set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
> if( NOT NO_SOVERSION )
> set( epochdelta 1385614800 )
> execute_process( COMMAND perl -e "$t=time( )-${epochdelta};$z=$t & 0xff; $y=($t>>8)&0xff; $x=($t>>16)&0xffff; print \"$x.$y.$z\""
> OUTPUT_VARIABLE __casa_soversion )
> set(casa_soversion ${__casa_soversion} CACHE STRING "version for shared objects")
> message( STATUS "Shared object version number ${casa_soversion}" )
> file( WRITE ${CMAKE_INSTALL_PREFIX}/casa_sover.txt
> "# generated by casacore/CMakeList.txt... Do not edit\n"
> "${casa_soversion}\n"
> )
> else( )
> message( STATUS "User disabled shared library versioning" )
> endif( )
>
67a84
> set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" )
231c248
< include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
---
> include_directories (${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
304,309c321,336
< set_target_properties(
< casa_${module}
< PROPERTIES
< VERSION "${PROJECT_VERSION}"
< SOVERSION "${PROJECT_VERSION_MAJOR}"
< )
---
> if (casa_soversion)
> set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" )
> set_target_properties(
> casa_${module}
> PROPERTIES
> VERSION "${casa_soversion}"
> SOVERSION "${casa_soversion}"
> )
> else( )
> set_target_properties(
> casa_${module}
> PROPERTIES
> VERSION "${PROJECT_VERSION}"
> SOVERSION "${PROJECT_VERSION_MAJOR}"
> )
> endif( )
345,373d371
<
<
< # List of build variables and defaults.
< # BUILD_PYTHON NO
< # ENABLE_SHARED YES
< # ENABLE_RPATH YES
< # CXX11 NO
< # ENABLE_TABLELOCKING YES
< # USE_HDF5 NO
< # USE_FFTW NO
< # USE_THREADS NO
< # USE_OPENMP NO
< # USE_STACKTRACE NO
< # DATA_DIR ""
< #
< # List of possibly used external packages and where
< # CFITSIO fits
< # WCSLIB coordinates
< # DL casa (optional)
< # READLINE casa (optional)
< # HDF5 casa (optional)
< # BISON tables,images
< # FLEX tables,images
< # LAPACK scimath
< # BLAS scimath
< # FFTW scimath (optional)
< # BOOST python (Boost-Python only)
< # PYTHON python
< # NUMPY python
diff -I '.*\$Id.*' -r casacore-2.0.1/coordinates/Coordinates/CoordinateSystem.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/coordinates/Coordinates/CoordinateSystem.cc
3463a3464,3469
> if (pc->type() == Coordinate::SPECTRAL) {
> SpectralCoordinate* sc = dynamic_cast<SpectralCoordinate*>(pc);
> if (sc->isTabular()) {
> string += " (tab)";
> }
> }
diff -I '.*\$Id.*' -r casacore-2.0.1/coordinates/Coordinates/FITSCoordinateUtil.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/coordinates/Coordinates/FITSCoordinateUtil.cc
594c594
< delete [] tmp;
---
> delete tmp;
diff -I '.*\$Id.*' -r casacore-2.0.1/coordinates/makefile /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/coordinates/makefile
3,5c3,10
< # Use the generic AIPS++ package makefile.
< #-----------------------------------------
< include $(word 1, $(AIPSPATH))/code/install/makefile.pkg
---
> # Use the generic AIPS++ class implementation makefile.
> #------------------------------------------------------
> include $(word 1, $(AIPSPATH))/code/install/makefile.imp
>
> # Set up a parallel make if PARALLEL_MAKE is defined in makedefs.
> ifdef PARALLEL_MAKE
> MAKE := $(PARALLEL_MAKE)
> endif
diff -I '.*\$Id.*' -r casacore-2.0.1/doxygen.cfg /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/doxygen.cfg
2c2
< PROJECT_NUMBER = $Rev$
---
> PROJECT_NUMBER = $Rev: 20931 $
27d26
< CASACORE_NO_AUTO_TEMPLATES \
31c30
< HAVE_HDF5 \
---
> HAVE_LIBHDF5 \
50c49
< INPUT = mainpage.dox casa coordinates derivedmscal fits images lattices measures meas ms msfits python scimath tables
---
> INPUT = mainpage.dox casa components coordinates derivedmscal fits images lattices measures ms msfits scimath tables
52c51
< INPUT_FILTER = build-tools/doxygen_pp
---
> INPUT_FILTER = scons-tools/doxygen_pp
54,57d52
<
< #FILE_PATTERNS = MVAngle0.dout
< #INPUT = doc
< #OUTPUT_DIRECTORY = doc1
diff -I '.*\$Id.*' -r casacore-2.0.1/fits/FITS/blockio.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/fits/FITS/blockio.cc
179,183c179,184
< // iobuffer was added with version 3.181...
< // cfitsio 3.03-3.14 do not have this...
< // However, something like CFITSIO_VERSION 3.03 is greek to CPP.
< // So assume that by 1-Apr-2015 all sites use a sufficiently new cfitsio.
< free((fptr->Fptr)->iobuffer); // free memory for I/O buffers
---
> // iobuffer was added with version 3.181... cfitsio 3.03-3.14 do not have this...
> // cfitsio 3.03 defines CFITSIO_VERSION to be 3.03 (which is greek to CPP)...
> // sometime after 3.181, a translator came along and added CFITSIO_MINOR as a separate #define
> #ifdef CFITSIO_MINOR
> free((fptr->Fptr)->iobuffer); // free memory for I/O buffers
> #endif
diff -I '.*\$Id.*' -r casacore-2.0.1/fits/FITS/hdu.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/fits/FITS/hdu.tcc
769c769
< delete [] extname_x;
---
> delete extname_x;
Only in casacore-2.0.1/: .gitignore
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/ExtendImage.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/ExtendImage.h
34a35
> #include <casacore/casa/Utilities/PtrHolder.h>
41d41
<
190,191c190,191
< ImageInterface<T>* itsImagePtr;
< ExtendLattice<T>* itsExtLatPtr;
---
> PtrHolder<ImageInterface<T> > itsImagePtr;
> PtrHolder<ExtendLattice<T> > itsExtLatPtr;
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/ExtendImage.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/ExtendImage.tcc
62c62
< itsExtLatPtr = new ExtendLattice<T> (image, newShape, newAxes, stretchAxes);
---
> itsExtLatPtr.set(new ExtendLattice<T> (image, newShape, newAxes, stretchAxes));
73,76c73,74
< itsImagePtr (other.itsImagePtr->cloneII())
< {
< itsExtLatPtr = new ExtendLattice<T> (*other.itsExtLatPtr);
< }
---
> itsImagePtr (other.itsImagePtr->cloneII()),
> itsExtLatPtr(new ExtendLattice<T> (*other.itsExtLatPtr)) {}
79,83c77
< ExtendImage<T>::~ExtendImage()
< {
< delete itsImagePtr;
< delete itsExtLatPtr;
< }
---
> ExtendImage<T>::~ExtendImage() {}
90,93c84,85
< delete itsImagePtr;
< itsImagePtr = other.itsImagePtr->cloneII();
< delete itsExtLatPtr;
< itsExtLatPtr = new ExtendLattice<T> (*other.itsExtLatPtr);
---
> itsImagePtr.set(other.itsImagePtr->cloneII());
> itsExtLatPtr.set(new ExtendLattice<T> (*other.itsExtLatPtr));
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/FITSQualityImage.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/FITSQualityImage.cc
77d76
< pPixelMask_p (0),
167,172c166,173
< delete fitsdata_p;
< fitsdata_p=0;
< delete fitserror_p;
< fitserror_p=0;
< delete pPixelMask_p;
< pPixelMask_p = 0;
---
> if (fitsdata_p) {
> delete fitsdata_p;
> fitsdata_p=0;
> }
> if (fitserror_p){
> delete fitserror_p;
> fitserror_p=0;
> }
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/ImageFITS2Converter.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/ImageFITS2Converter.cc
1676d1675
< fitsOut = 0;
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/ImageOpener.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/ImageOpener.cc
105,114c105,112
< // Skip AipsIO's object length, magicval, and string length.
< if (nread >= 30) {
< String str1(buf+12, 14);
< if (str1 == "CompoundImage-") {
< String str2(buf+26, 4);
< if (str2 == "Conc") {
< return IMAGECONCAT;
< } else if (str2 == "Expr") {
< return IMAGEEXPR;
< }
---
> // Ignore AipsIO's object length, magicval, and string length.
> String str1(buf+12, 14);
> if (str1 == "CompoundImage-") {
> String str2(buf+26, 4);
> if (str2 == "Conc") {
> return IMAGECONCAT;
> } else if (str2 == "Expr") {
> return IMAGEEXPR;
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/ImageRegrid.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/ImageRegrid.tcc
161c161
< Quantity outpix = min(Quantity(inc[0], units[0]), Quantity(inc[1], units[1]));
---
> Quantity outpix = min(Quantity(abs(inc[0]), units[0]), Quantity(abs(inc[1]), units[1]));
178,179c178,182
< << "You are regridding an image whose beam is not well sampled by the "
< << "pixel size. Total flux can be lost when regridding such "
---
> << "You are regridding an image whose beam minor axis "
> << inbeam
> << " is not well sampled by the "
> << "pixel size (input=" << inpix << ", output=" << outpix << "). "
> << "Total flux can be lost when regridding such "
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/ImageStatistics.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/ImageStatistics.tcc
428,429c428,435
< String minPosString = CoordinateUtil::formatCoordinate (minPos_p, cSys, precision_);
< String maxPosString = CoordinateUtil::formatCoordinate (maxPos_p, cSys, precision_);
---
> // one of minPos_p or maxPos_p will be empty for fit-to-half stats
> String minPosString, maxPosString;
> if (! minPos_p.empty()) {
> minPosString = CoordinateUtil::formatCoordinate (minPos_p, cSys, precision_);
> }
> if (! maxPos_p.empty()) {
> maxPosString = CoordinateUtil::formatCoordinate (maxPos_p, cSys, precision_);
> }
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/CMakeLists.txt /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/CMakeLists.txt
17a18,28
>
> decon_test.im/logtable/table.info
> decon_test.im/logtable/table.lock
> decon_test.im/logtable/table.dat
> decon_test.im/logtable/table.f0
> decon_test.im/table.info
> decon_test.im/table.lock
> decon_test.im/table.dat
> decon_test.im/table.f0_TSM0
> decon_test.im/table.f0
>
Only in /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test: decon_test.im
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/dImageStatistics.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/dImageStatistics.cc
128c128
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21578 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/dImageSummary.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/dImageSummary.cc
49c49
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21512 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/mexinputtest.fits /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/mexinputtest.fits
2c2
< BBBBBB"B&B*B.B2B6B:B>BBBFBJBNBRBVBZB^BbBfBjBnBrBvBzB~BBƒB…B‡B‰B‹BBB‘B“B•B—B™B›BBŸB¡B£B¥B§B©B«B­B¯B±B³BµB·B¹B»B½B¿BÁBÃBÅBÇXTENSION= 'IMAGE ' / Image extension BITPIX = -64 / array data type NAXIS = 2 / number of array dimensions NAXIS1 = 10 NAXIS2 = 10 PCOUNT = 0 / number of parameters GCOUNT = 1 / number of groups EXTNAME = 'ERR ' EXTVER = 1 CRPIX1 = 5.0 CRVAL1 = 53.071 CDELT1 = 0.001 CTYPE1 = 'RA---TAN' CRPIX2 = 5.0 CRVAL2 = -27.709 CDELT2 = 0.001 CTYPE2 = 'DEC--TAN' EQUINOX = 2000.0 END ?Ó333333?ôÌÌÌÌÌÍ@ffffff@
---
> BBBBBB"B&B*B.B2B6B:B>BBBFBJBNBRBVBZB^BbBfBjBnBrBvBzB~BBƒB…B‡B‰B‹BBB‘B“B•B—B™B›BBŸB¡B£B¥B§B©B«B­B¯B±B³BµB·B¹B»B½B¿BÁBÃBÅBÇXTENSION= 'IMAGE ' / Image extension BITPIX = -64 / array data type NAXIS = 2 / number of array dimensions NAXIS1 = 10 NAXIS2 = 10 PCOUNT = 0 / number of parameters GCOUNT = 1 / number of groups EXTNAME = 'ERR ' EXTVER = 1 CRPIX1 = 5.0 CRVAL1 = 53.071 CDELT1 = 0.001 CTYPE1 = 'RA---TAN' CRPIX2 = 5.0 CRVAL2 = -27.709 CDELT2 = 0.001 CTYPE2 = 'DEC--TAN' EQUINOX = 2000.0 END ?ôÌÌÌÌÌÍ@ffffff@
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/tImageRegrid.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/tImageRegrid.cc
62c62
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21549 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/tImageStatistics2.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/tImageStatistics2.cc
48d47
< delete [] parts;
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/tImageStatistics.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/tImageStatistics.cc
30a31
> #include <casacore/lattices/Lattices/LatticeUtilities.h>
248a250,275
> }
> {
> // check equivalence of old vs new implementation of LatticeStatistics
> // in SubImages made from TempImage
> PagedImage<Float> im("decon_test.im");
> TempImage<Float> tmp(im.shape(), im.coordinates());
> LCBox box(IPosition(2,10,10), IPosition(2,14,14), im.shape());
> PtrHolder<ImageRegion> region(
> ImageRegion::fromRecord(
> NULL, im.coordinates(),
> im.shape(), box.toRecord("")
> )
> );
>
> LogIO os;
> LatticeUtilities::copyDataAndMask(os, tmp, im, False);
> SubImage<Float> s1(tmp, *region, False, AxesSpecifier(), True);
> LatticeStatistics<Float> statsOld(s1, os);
> statsOld.configureClassical(0, 0, 1, 1);
> Array<Double> maxOld;
> statsOld.getStatistic(maxOld, LatticeStatsBase::MAX);
> LatticeStatistics<Float> statsNew(s1, os);
> statsNew.configureClassical(1, 1, 0, 0);
> Array<Double> maxNew;
> statsNew.getStatistic(maxNew, LatticeStatsBase::MAX);
> AlwaysAssert(allTrue(maxOld == maxNew), AipsError);
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Images/test/tRebinImage.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Images/test/tRebinImage.cc
53c53
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21512 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/images/makefile /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/makefile
3,5c3,10
< # Use the generic AIPS++ package makefile.
< #-----------------------------------------
< include $(word 1, $(AIPSPATH))/code/install/makefile.pkg
---
> # Use the generic AIPS++ class implementation makefile.
> #------------------------------------------------------
> include $(word 1, $(AIPSPATH))/code/install/makefile.imp
>
> # Set up a parallel make if PARALLEL_MAKE is defined in makedefs.
> ifdef PARALLEL_MAKE
> MAKE := $(PARALLEL_MAKE)
> endif
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Regions/test/tImageRegion.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Regions/test/tImageRegion.cc
35,78c35,78
< int main ()
< {
< String myname = "tmp.im";
< int ret = 0;
< try {
< PagedImage<Float> im(
< TiledShape(IPosition(4, 1)),
< CoordinateUtil::defaultCoords4D(), myname
< );
< im.flush();
< vector<String> names;
< names.push_back("tmp.im");
< names.push_back("'tmp.im'");
< names.push_back("'./tmp.im'");
< names.push_back("'$PWD/tmp.im'");
< names.push_back("./tmp.im");
< names.push_back("$PWD/tmp.im");
< // various escaping tests for fromLatticeExpession
< uInt lastGood = 3;
< for (uInt i=0; i<names.size(); i++) {
< for (uInt j=0; j<names.size(); j++) {
< String expr = names[i] + " == " + names[j];
< try {
< ImageRegion *z = ImageRegion::fromLatticeExpression(expr);
< AlwaysAssert(z && i <=lastGood && j <= lastGood, AipsError);
< delete z;
< }
< catch (AipsError& x) {
< AlwaysAssert(i > lastGood || j > lastGood, AipsError);
< }
< }
< }
< cout << "OK" << endl;
< }
< catch (const AipsError& x) {
< cerr << "Caught exception: " << x.getMesg() << endl;
< cout << "FAIL" << endl;
< ret = 1;
< }
< Directory d(myname);
< if (d.exists()) {
< d.removeRecursive(False);
< }
< return ret;
---
> int main () {
> String myname = "tmp.im";
> int ret = 0;
> try {
> PagedImage<Float> im(
> TiledShape(IPosition(4, 1)),
> CoordinateUtil::defaultCoords4D(), myname
> );
> im.flush();
> vector<String> names;
> names.push_back("tmp.im");
> names.push_back("'tmp.im'");
> names.push_back("'./tmp.im'");
> names.push_back("'$PWD/tmp.im'");
> names.push_back("./tmp.im");
> names.push_back("$PWD/tmp.im");
> // various escaping tests for fromLatticeExpession
> uInt lastGood = 3;
> for (uInt i=0; i<names.size(); i++) {
> for (uInt j=0; j<names.size(); j++) {
> String expr = names[i] + " == " + names[j];
> try {
> ImageRegion *z = ImageRegion::fromLatticeExpression(
> expr
> );
> AlwaysAssert(z && i <=lastGood && j <= lastGood, AipsError);
> }
> catch (AipsError& x) {
> AlwaysAssert(i > lastGood || j > lastGood, AipsError);
> }
> }
> }
> cout << "OK" << endl;
> }
> catch (const AipsError& x) {
> cerr << "Caught exception: " << x.getMesg() << endl;
> cout << "FAIL" << endl;
> ret = 1;
> }
> Directory d(myname);
> if (d.exists()) {
> d.removeRecursive(False);
> }
> return ret;
diff -I '.*\$Id.*' -r casacore-2.0.1/images/Regions/test/tWCEllipsoid.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/images/Regions/test/tWCEllipsoid.cc
41,67c41,67
< void show(const LCEllipsoid& ellipse) {
< Array<bool> mask = ellipse.get();
< IPosition shape = mask.shape();
< IPosition index = shape-1;
< uInt j=0;
< while(True) {
< for (uInt i=0; i<shape(0); i++) {
< index[0] = i;
< cout << mask(index) << " ";
< }
< cout << index << endl;
< for (j=1; j<shape.size(); j++) {
< if (index[j] == 0) {
< index[j] = shape[j]-1;
< cout << endl;
< }
< else {
< index[j]--;
< break;
< }
<
< }
< if (j == shape.size()) {
< break;
< }
< }
< */
---
> void show(const LCEllipsoid& ellipse) {
> Array<bool> mask = ellipse.get();
> IPosition shape = mask.shape();
> IPosition index = shape-1;
> uInt j=0;
> while(True) {
> for (uInt i=0; i<shape(0); i++) {
> index[0] = i;
> cout << mask(index) << " ";
> }
> cout << index << endl;
> for (j=1; j<shape.size(); j++) {
> if (index[j] == 0) {
> index[j] = shape[j]-1;
> cout << endl;
> }
> else {
> index[j]--;
> break;
> }
>
> }
> if (j == shape.size()) {
> break;
> }
> }
> */
69,80c69,80
< cout << shape << endl;
< for (Int j=shape(1)-1; j>=0; j--) {
< for (uInt i=0; i<shape(0); i++) {
<
< IPosition x;
< x.
< cout << mask[count] << " ";
< mask.
< count++;
< }
< cout << endl;
< }
---
> cout << shape << endl;
> for (Int j=shape(1)-1; j>=0; j--) {
> for (uInt i=0; i<shape(0); i++) {
>
> IPosition x;
> x.
> cout << mask[count] << " ";
> mask.
> count++;
> }
> cout << endl;
> }
82c82
< }
---
> }
87,358c87,343
< try {
< CoordinateSystem csys = CoordinateUtil::defaultCoords3D();
< {
< Vector<Quantity> center(3, Quantity(0, "rad"));
< center[1] += Quantity(20.5, "arcmin");
< Vector<Quantity> radius(3, Quantity(5, "arcmin"));
< IPosition pixelAxes(3, 0, 1, 2);
< try {
< WCEllipsoid(center, radius, pixelAxes, csys);
< AlwaysAssert(False, AipsError);
< }
< catch (AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< radius[2] = Quantity(50, "MHz");
< try {
< WCEllipsoid(center, radius, pixelAxes, csys);
< AlwaysAssert(False, AipsError);
< }
< catch (AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< center[2] = Quantity(1415, "GHz");
< pixelAxes[2] = 3;
< try {
< WCEllipsoid(center, radius, pixelAxes, csys);
< AlwaysAssert(False, AipsError);
< }
< catch (AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< pixelAxes = IPosition(3, 0, 0, 1);
< try {
< WCEllipsoid(center, radius, pixelAxes, csys);
< AlwaysAssert(False, AipsError);
< }
< catch (AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< pixelAxes = IPosition(3, 0, 1, 2);
< center.resize(2, True);
< try {
< WCEllipsoid(center, radius, pixelAxes, csys);
< AlwaysAssert(False, AipsError);
< }
< catch (AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
<
< // generic ellipsoid tests
< center.resize(3, True);
< center[2] = Quantity(1.41501, "GHz");
< radius[1] = Quantity(1200, "arcsec");
< radius[2] = Quantity(50, "kHz");
<
< WCEllipsoid ellipse(center, radius, pixelAxes, csys);
< AlwaysAssert(ellipse == ellipse, AipsError);
< WCEllipsoid ellipse2 = ellipse;
< AlwaysAssert(ellipse == ellipse2, AipsError);
< WCEllipsoid *ellipse3 = dynamic_cast<WCEllipsoid *>(ellipse.cloneRegion());
< AlwaysAssert(ellipse == *ellipse3, AipsError);
< delete ellipse3;
< TableRecord rec = ellipse.toRecord("");
< ellipse3 = WCEllipsoid::fromRecord(rec, "");
< AlwaysAssert(ellipse == *ellipse3, AipsError);
< delete ellipse3;
< IPosition latticeShape(3, 20, 30, 40);
< IPosition pixelAxesMap(3, 0, 1, 2);
< IPosition outOrder(3, 0, 1, 2);
< LCRegion *lcReg = ellipse.doToLCRegion(
< csys, latticeShape, pixelAxesMap, outOrder
< );
< LCEllipsoid *lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
< IPosition lcShape = lcReg->shape();
<
< Vector<Float> lcCenter = lcEllipse->center();
< AlwaysAssert(near(lcCenter[0], 0.0), AipsError);
< AlwaysAssert(near(lcCenter[1], 20.5), AipsError);
< AlwaysAssert(near(lcCenter[2], 10.0), AipsError);
< Vector<Float> lcRadii = lcEllipse->radii();
< Vector<Double> pixel(3, 1);
< Vector<Double> world1;
< csys.toWorld(world1, pixel);
< pixel = 2;
<
< Vector<Double> world2;
<
< csys.toWorld(world2, pixel);
< AlwaysAssert(near(lcRadii[0], 5.0), AipsError);
< AlwaysAssert(near(lcRadii[1], 20.0), AipsError);
< AlwaysAssert(near(lcRadii[2], 50.0), AipsError);
<
< outOrder = IPosition(3, 1, 2, 0);
<
< delete lcReg;
< lcReg = ellipse.doToLCRegion(
< csys, latticeShape, pixelAxesMap, outOrder
< );
< AlwaysAssert(
< lcReg->shape()
< == IPosition(3, lcShape[2], lcShape[0], lcShape[1]),
< AipsError
< );
< lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
< lcCenter = lcEllipse->center();
< AlwaysAssert(near(lcCenter[1], 0.0), AipsError);
< AlwaysAssert(near(lcCenter[2], 20.5), AipsError);
< AlwaysAssert(near(lcCenter[0], 10.0), AipsError);
< lcRadii = lcEllipse->radii();
< AlwaysAssert(near(lcRadii[1], 5.0), AipsError);
< AlwaysAssert(near(lcRadii[2], 20.0), AipsError);
< AlwaysAssert(near(lcRadii[0], 50.0), AipsError);
<
< outOrder = IPosition(3, 0, 1, 2);
< pixelAxesMap = IPosition(3, 1, 2, 0);
<
< delete lcReg;
< lcReg = ellipse.doToLCRegion(
< csys, latticeShape, pixelAxesMap, outOrder
< );
< AlwaysAssert(
< lcReg->shape()
< == IPosition(3, lcShape[1], lcShape[2], lcShape[0]),
< AipsError
< );
< lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
< lcCenter = lcEllipse->center();
< AlwaysAssert(near(lcCenter[2], 0.0), AipsError);
< AlwaysAssert(near(lcCenter[0], 20.5), AipsError);
< AlwaysAssert(near(lcCenter[1], 10.0), AipsError);
< lcRadii = lcEllipse->radii();
< AlwaysAssert(near(lcRadii[2], 5.0), AipsError);
< AlwaysAssert(near(lcRadii[0], 20.0), AipsError);
< AlwaysAssert(near(lcRadii[1], 50.0), AipsError);
<
< // pixelAxesmap and outOrder the same means no net change :)
< outOrder = IPosition(3, 1, 2, 0);
<
< delete lcReg;
< lcReg = ellipse.doToLCRegion(
< csys, latticeShape, pixelAxesMap, outOrder
< );
< AlwaysAssert(
< lcReg->shape() == lcShape,
< AipsError
< );
< lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
< lcCenter = lcEllipse->center();
< AlwaysAssert(near(lcCenter[0], 0.0), AipsError);
< AlwaysAssert(near(lcCenter[1], 20.5), AipsError);
< AlwaysAssert(near(lcCenter[2], 10.0), AipsError);
< lcRadii = lcEllipse->radii();
< AlwaysAssert(near(lcRadii[0], 5.0), AipsError);
< AlwaysAssert(near(lcRadii[1], 20.0), AipsError);
< AlwaysAssert(near(lcRadii[2], 50.0), AipsError);
< delete lcReg;
< }
< {
< // sphere tests
< Vector<Quantity> center(3, Quantity(1, "rad"));
< center[2] = Quantity(1415, "GHz");
< IPosition pixelAxes = IPosition(3, 0, 1, 2);
< Quantity r(1, "arcmin");
< try {
< // unit mismatch between center and radius
< WCEllipsoid sphere(
< center, r, pixelAxes, csys
< );
< AlwaysAssert(False, AipsError);
< }
< catch(AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< pixelAxes.resize(2, True);
< center.resize(2, True);
< WCEllipsoid sphere(
< center, r, pixelAxes, csys
< );
< AlwaysAssert(sphere == sphere, AipsError);
< WCEllipsoid sphere2 = sphere;
< AlwaysAssert(sphere == sphere2, AipsError);
< WCEllipsoid *sphere3 = dynamic_cast<WCEllipsoid *>(sphere.cloneRegion());
< AlwaysAssert(sphere == *sphere3, AipsError);
< delete sphere3;
< TableRecord rec = sphere.toRecord("");
< sphere3 = WCEllipsoid::fromRecord(rec, "");
< AlwaysAssert(sphere == *sphere3, AipsError);
< delete sphere3;
< }
< {
< // 2-D ellipse tests
< Vector<Quantity> center(3, Quantity(1, "rad"));
< center[2] = Quantity(1415, "GHz");
< Vector<Quantity> radius(3, Quantity(1, "arcmin"));
< radius[2] = Quantity(50, "MHz");
< IPosition pixelAxes = IPosition(3, 0, 1, 2);
< try {
< // theta unit issue
< Quantity theta(4, "Hz");
< WCEllipsoid ellipse(
< center[0], center[1], radius[0], radius[1],
< theta, pixelAxes[0], pixelAxes[1], csys
< );
< AlwaysAssert(False, AipsError);
< }
< catch(AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< try {
< // axes unit mismatch
< Quantity theta(40, "deg");
< WCEllipsoid ellipse(
< center[0], center[1], radius[0], radius[1],
< theta, pixelAxes[0], pixelAxes[2], csys
< );
< AlwaysAssert(False, AipsError);
< }
< catch(AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< radius[0].setValue(2);
< Quantity theta(40, "deg");
< WCEllipsoid ellipse(
< center[0], center[1], radius[0], radius[1],
< theta, pixelAxes[0], pixelAxes[1], csys
< );
<
< AlwaysAssert(ellipse == ellipse, AipsError);
< WCEllipsoid ellipse2 = ellipse;
< AlwaysAssert(ellipse == ellipse2, AipsError);
< WCEllipsoid *ellipse3 = dynamic_cast<WCEllipsoid *>(ellipse.cloneRegion());
< AlwaysAssert(ellipse == *ellipse3, AipsError);
< delete ellipse3;
< TableRecord rec = ellipse.toRecord("");
< ellipse3 = WCEllipsoid::fromRecord(rec, "");
< AlwaysAssert(ellipse == *ellipse3, AipsError);
< delete ellipse3;
<
< // switch axes order
< try {
< // major axis smaller than minor axis
< ellipse = WCEllipsoid(
< center[1], center[0], radius[1], radius[0],
< theta, pixelAxes[1], pixelAxes[0], csys
< );
< AlwaysAssert(False, AipsError);
< }
< catch(AipsError x) {
< cout << "Caught as expected " << x.getMesg() << endl;
< }
< ellipse = WCEllipsoid(
< center[1], center[0], radius[0], radius[1],
< theta, pixelAxes[1], pixelAxes[0], csys
< );
< AlwaysAssert(ellipse == ellipse, AipsError);
< ellipse2 = ellipse;
< AlwaysAssert(ellipse == ellipse2, AipsError);
< ellipse3 = dynamic_cast<WCEllipsoid *>(ellipse.cloneRegion());
< AlwaysAssert(ellipse == *ellipse3, AipsError);
< delete ellipse3;
< rec = ellipse.toRecord("");
< ellipse3 = WCEllipsoid::fromRecord(rec, "");
< AlwaysAssert(ellipse == *ellipse3, AipsError);
< delete ellipse3;
< }
<
< } catch (AipsError x) {
< cout << "Caught exception: " << x.getMesg() << endl;
< return 1;
< }
< cout << "OK" << endl;
< return 0;
---
> try {
> CoordinateSystem csys = CoordinateUtil::defaultCoords3D();
> {
> Vector<Quantity> center(3, Quantity(0, "rad"));
> center[1] += Quantity(20.5, "arcmin");
> Vector<Quantity> radius(3, Quantity(5, "arcmin"));
> IPosition pixelAxes(3, 0, 1, 2);
> try {
> WCEllipsoid(center, radius, pixelAxes, csys);
> AlwaysAssert(False, AipsError);
> }
> catch (AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> radius[2] = Quantity(50, "MHz");
> try {
> WCEllipsoid(center, radius, pixelAxes, csys);
> AlwaysAssert(False, AipsError);
> }
> catch (AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> center[2] = Quantity(1415, "GHz");
> pixelAxes[2] = 3;
> try {
> WCEllipsoid(center, radius, pixelAxes, csys);
> AlwaysAssert(False, AipsError);
> }
> catch (AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> pixelAxes = IPosition(3, 0, 0, 1);
> try {
> WCEllipsoid(center, radius, pixelAxes, csys);
> AlwaysAssert(False, AipsError);
> }
> catch (AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> pixelAxes = IPosition(3, 0, 1, 2);
> center.resize(2, True);
> try {
> WCEllipsoid(center, radius, pixelAxes, csys);
> AlwaysAssert(False, AipsError);
> }
> catch (AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
>
> // generic ellipsoid tests
> center.resize(3, True);
> center[2] = Quantity(1.41501, "GHz");
> radius[1] = Quantity(1200, "arcsec");
> radius[2] = Quantity(50, "kHz");
>
> WCEllipsoid ellipse(center, radius, pixelAxes, csys);
> AlwaysAssert(ellipse == ellipse, AipsError);
> WCEllipsoid ellipse2 = ellipse;
> AlwaysAssert(ellipse == ellipse2, AipsError);
> WCEllipsoid *ellipse3 = dynamic_cast<WCEllipsoid *>(ellipse.cloneRegion());
> AlwaysAssert(ellipse == *ellipse3, AipsError);
> TableRecord rec = ellipse.toRecord("");
> AlwaysAssert(ellipse == *(WCEllipsoid::fromRecord(rec, "")), AipsError);
> IPosition latticeShape(3, 20, 30, 40);
> IPosition pixelAxesMap(3, 0, 1, 2);
> IPosition outOrder(3, 0, 1, 2);
> LCRegion *lcReg = ellipse.doToLCRegion(
> csys, latticeShape, pixelAxesMap, outOrder
> );
> LCEllipsoid *lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
> IPosition lcShape = lcReg->shape();
>
> Vector<Float> lcCenter = lcEllipse->center();
> AlwaysAssert(near(lcCenter[0], 0.0), AipsError);
> AlwaysAssert(near(lcCenter[1], 20.5), AipsError);
> AlwaysAssert(near(lcCenter[2], 10.0), AipsError);
> Vector<Float> lcRadii = lcEllipse->radii();
> Vector<Double> pixel(3, 1);
> Vector<Double> world1;
> csys.toWorld(world1, pixel);
> pixel = 2;
>
> Vector<Double> world2;
>
> csys.toWorld(world2, pixel);
> AlwaysAssert(near(lcRadii[0], 5.0), AipsError);
> AlwaysAssert(near(lcRadii[1], 20.0), AipsError);
> AlwaysAssert(near(lcRadii[2], 50.0), AipsError);
>
> outOrder = IPosition(3, 1, 2, 0);
>
> lcReg = ellipse.doToLCRegion(
> csys, latticeShape, pixelAxesMap, outOrder
> );
> AlwaysAssert(
> lcReg->shape()
> == IPosition(3, lcShape[2], lcShape[0], lcShape[1]),
> AipsError
> );
> lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
> lcCenter = lcEllipse->center();
> AlwaysAssert(near(lcCenter[1], 0.0), AipsError);
> AlwaysAssert(near(lcCenter[2], 20.5), AipsError);
> AlwaysAssert(near(lcCenter[0], 10.0), AipsError);
> lcRadii = lcEllipse->radii();
> AlwaysAssert(near(lcRadii[1], 5.0), AipsError);
> AlwaysAssert(near(lcRadii[2], 20.0), AipsError);
> AlwaysAssert(near(lcRadii[0], 50.0), AipsError);
>
> outOrder = IPosition(3, 0, 1, 2);
> pixelAxesMap = IPosition(3, 1, 2, 0);
>
> lcReg = ellipse.doToLCRegion(
> csys, latticeShape, pixelAxesMap, outOrder
> );
> AlwaysAssert(
> lcReg->shape()
> == IPosition(3, lcShape[1], lcShape[2], lcShape[0]),
> AipsError
> );
> lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
> lcCenter = lcEllipse->center();
> AlwaysAssert(near(lcCenter[2], 0.0), AipsError);
> AlwaysAssert(near(lcCenter[0], 20.5), AipsError);
> AlwaysAssert(near(lcCenter[1], 10.0), AipsError);
> lcRadii = lcEllipse->radii();
> AlwaysAssert(near(lcRadii[2], 5.0), AipsError);
> AlwaysAssert(near(lcRadii[0], 20.0), AipsError);
> AlwaysAssert(near(lcRadii[1], 50.0), AipsError);
>
> // pixelAxesmap and outOrder the same means no net change :)
> outOrder = IPosition(3, 1, 2, 0);
> lcReg = ellipse.doToLCRegion(
> csys, latticeShape, pixelAxesMap, outOrder
> );
> AlwaysAssert(
> lcReg->shape() == lcShape,
> AipsError
> );
> lcEllipse = dynamic_cast<LCEllipsoid *>(lcReg);
> lcCenter = lcEllipse->center();
> AlwaysAssert(near(lcCenter[0], 0.0), AipsError);
> AlwaysAssert(near(lcCenter[1], 20.5), AipsError);
> AlwaysAssert(near(lcCenter[2], 10.0), AipsError);
> lcRadii = lcEllipse->radii();
> AlwaysAssert(near(lcRadii[0], 5.0), AipsError);
> AlwaysAssert(near(lcRadii[1], 20.0), AipsError);
> AlwaysAssert(near(lcRadii[2], 50.0), AipsError);
> }
> {
> // sphere tests
> Vector<Quantity> center(3, Quantity(1, "rad"));
> center[2] = Quantity(1415, "GHz");
> IPosition pixelAxes = IPosition(3, 0, 1, 2);
> Quantity r(1, "arcmin");
> try {
> // unit mismatch between center and radius
> WCEllipsoid sphere(
> center, r, pixelAxes, csys
> );
> AlwaysAssert(False, AipsError);
> }
> catch(AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> pixelAxes.resize(2, True);
> center.resize(2, True);
> WCEllipsoid sphere(
> center, r, pixelAxes, csys
> );
> AlwaysAssert(sphere == sphere, AipsError);
> WCEllipsoid sphere2 = sphere;
> AlwaysAssert(sphere == sphere2, AipsError);
> WCEllipsoid *sphere3 = dynamic_cast<WCEllipsoid *>(sphere.cloneRegion());
> AlwaysAssert(sphere == *sphere3, AipsError);
> TableRecord rec = sphere.toRecord("");
> AlwaysAssert(sphere == *(WCEllipsoid::fromRecord(rec, "")), AipsError);
>
>
> }
> {
> // 2-D ellipse tests
> Vector<Quantity> center(3, Quantity(1, "rad"));
> center[2] = Quantity(1415, "GHz");
> Vector<Quantity> radius(3, Quantity(1, "arcmin"));
> radius[2] = Quantity(50, "MHz");
> IPosition pixelAxes = IPosition(3, 0, 1, 2);
> try {
> // theta unit issue
> Quantity theta(4, "Hz");
> WCEllipsoid ellipse(
> center[0], center[1], radius[0], radius[1],
> theta, pixelAxes[0], pixelAxes[1], csys
> );
> AlwaysAssert(False, AipsError);
> }
> catch(AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> try {
> // axes unit mismatch
> Quantity theta(40, "deg");
> WCEllipsoid ellipse(
> center[0], center[1], radius[0], radius[1],
> theta, pixelAxes[0], pixelAxes[2], csys
> );
> AlwaysAssert(False, AipsError);
> }
> catch(AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> radius[0].setValue(2);
> Quantity theta(40, "deg");
> WCEllipsoid ellipse(
> center[0], center[1], radius[0], radius[1],
> theta, pixelAxes[0], pixelAxes[1], csys
> );
>
> AlwaysAssert(ellipse == ellipse, AipsError);
> WCEllipsoid ellipse2 = ellipse;
> AlwaysAssert(ellipse == ellipse2, AipsError);
> WCEllipsoid *ellipse3 = dynamic_cast<WCEllipsoid *>(ellipse.cloneRegion());
> AlwaysAssert(ellipse == *ellipse3, AipsError);
> TableRecord rec = ellipse.toRecord("");
> AlwaysAssert(ellipse == *(WCEllipsoid::fromRecord(rec, "")), AipsError);
>
> // switch axes order
> try {
> // major axis smaller than minor axis
> ellipse = WCEllipsoid(
> center[1], center[0], radius[1], radius[0],
> theta, pixelAxes[1], pixelAxes[0], csys
> );
> AlwaysAssert(False, AipsError);
> }
> catch(AipsError x) {
> cout << "Caught as expected " << x.getMesg() << endl;
> }
> ellipse = WCEllipsoid(
> center[1], center[0], radius[0], radius[1],
> theta, pixelAxes[1], pixelAxes[0], csys
> );
> AlwaysAssert(ellipse == ellipse, AipsError);
> ellipse2 = ellipse;
> AlwaysAssert(ellipse == ellipse2, AipsError);
> ellipse3 = dynamic_cast<WCEllipsoid *>(ellipse.cloneRegion());
> AlwaysAssert(ellipse == *ellipse3, AipsError);
> rec = ellipse.toRecord("");
> AlwaysAssert(ellipse == *(WCEllipsoid::fromRecord(rec, "")), AipsError);
> }
>
> } catch (AipsError x) {
> cout << "Caught exception: " << x.getMesg() << endl;
> return 1;
> }
> cout << "OK" << endl;
> return 0;
diff -I '.*\$Id.*' -r casacore-2.0.1/install/codedevl/template-class-cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/install/codedevl/template-class-cc
30c30
< namespace casacore { //# NAMESPACE CASACORE - BEGIN
---
> namespace casa { //# NAMESPACE CASA - BEGIN
32c32
< } //# NAMESPACE CASACORE - END
---
> } //# NAMESPACE CASA - END
diff -I '.*\$Id.*' -r casacore-2.0.1/install/codedevl/template-main-cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/install/codedevl/template-main-cc
30c30
< #include <casacore/casa/namespace.h>
---
> #include <casa/namespace.h>
diff -I '.*\$Id.*' -r casacore-2.0.1/install/codedevl/template-review-cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/install/codedevl/template-review-cc
20c20
< *** Data types: only Casacore fundamental types used?
---
> *** Data types: only AIPS++ fundamental types used?
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/LatticeMath/LatticeApply.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/LatticeMath/LatticeApply.tcc
128c128
< for (uInt i=0; i<outDim; i++) {
---
> for (uInt i=0; i<outDim; ++i) {
167c167
< for (uInt j=0; j<outDim; j++) {
---
> for (uInt j=0; j<outDim; ++j) {
191c191
< for (uInt i=0; i<n; i++) {
---
> for (uInt i=0; i<n; ++i) {
205c205
< inIter++;
---
> ++inIter;
234c234
< for (i=1; i<nOut; i++) {
---
> for (i=1; i<nOut; ++i) {
265c265
< for (i=0; i<outDim; i++) {
---
> for (i=0; i<outDim; ++i) {
293c293
< for (uInt j=0; j<outDim; j++) {
---
> for (uInt j=0; j<outDim; ++j) {
319c319
< for (i=0; i<n; i++) {
---
> for (i=0; i<n; ++i) {
336c336
< for (uInt j=0; j<nOut; j++) {
---
> for (uInt j=0; j<nOut; ++j) {
342c342
< inIter++;
---
> ++inIter;
348c348
< for (uInt k=0; k<nOut; k++) {
---
> for (uInt k=0; k<nOut; ++k) {
365,373c365,374
< void LatticeApply<T,U>::tiledApply (MaskedLattice<U>& latticeOut,
< const MaskedLattice<T>& latticeIn,
< TiledCollapser<T,U>& collapser,
< const IPosition& collapseAxes,
< Int newOutAxis,
< LatticeProgress* tellProgress)
< {
< // Make veracity check on input and first output lattice
< // and work out map to translate input and output axes.
---
> void LatticeApply<T,U>::tiledApply (
> MaskedLattice<U>& latticeOut,
> const MaskedLattice<T>& latticeIn,
> TiledCollapser<T,U>& collapser,
> const IPosition& collapseAxes,
> Int newOutAxis,
> LatticeProgress* tellProgress
> ) {
> // Make veracity check on input and first output lattice
> // and work out map to translate input and output axes.
376,377c377,380
< IPosition ioMap = prepare (latticeIn.shape(), latticeOut.shape(),
< collapseAxes, newOutAxis);
---
> IPosition ioMap = prepare (
> latticeIn.shape(), latticeOut.shape(),
> collapseAxes, newOutAxis
> );
379,380c382,383
< // Does the input has a mask?
< // If not, can the collapser handle a null mask.
---
> // Does the input has a mask?
> // If not, can the collapser handle a null mask.
384c387
< useMask = (! collapser.canHandleNullMask());
---
> useMask = (! collapser.canHandleNullMask());
387c390
< // The input is traversed using a TileStepper.
---
> // The input is traversed using a TileStepper.
395c398
< // Precalculate various variables.
---
> // Precalculate various variables.
406,410c409,413
< for (i=0; i<outDim; i++) {
< if (ioMap(i) >= 0) {
< outShape(i) = 1;
< iterAxes(j++) = i;
< }
---
> for (i=0; i<outDim; ++i) {
> if (ioMap(i) >= 0) {
> outShape(i) = 1;
> iterAxes(j++) = i;
> }
413,414c416,417
< // Find the first collapse axis which is not immediately after
< // the previous collapse axis.
---
> // Find the first collapse axis which is not immediately after
> // the previous collapse axis.
416,419c419,422
< for (collStart=1; collStart<collDim; collStart++) {
< if (collapseAxes(collStart) != 1+collapseAxes(collStart-1)) {
< break;
< }
---
> for (collStart=1; collStart<collDim; ++collStart) {
> if (collapseAxes(collStart) != 1+collapseAxes(collStart-1)) {
> break;
> }
422,428c425,426
< // cout << "ioMap " << ioMap << endl;
< // cout << "iterAxes " << iterAxes << endl;
< // cout << "outShape " << outShape << endl;
< // cout << "collStart " << collStart << endl;
<
< // See if the output lattice has a writable pixelmask.
< // If so, it will later be used to write the resulting mask to.
---
> // See if the output lattice has a writable pixelmask.
> // If so, it will later be used to write the resulting mask to.
433,435c431,433
< if (! maskOut->isWritable()) {
< maskOut = 0;
< }
---
> if (! maskOut->isWritable()) {
> maskOut = 0;
> }
438,441c436,439
< // Set the number of expected steps.
< // This is the number of tiles to process.
< // Also give the number of resulting output pixels per line, so the
< // collapser can check it.
---
> // Set the number of expected steps.
> // This is the number of tiles to process.
> // Also give the number of resulting output pixels per line, so the
> // collapser can check it.
444,445c442,443
< for (j=0; j<inDim; j++) {
< nsteps *= 1 + trc(j)/inTileShape(j) - blc(j)/inTileShape(j);
---
> for (j=0; j<inDim; ++j) {
> nsteps *= 1 + trc(j)/inTileShape(j) - blc(j)/inTileShape(j);
448,449c446,448
< if (tellProgress != 0) tellProgress->init (nsteps);
< // cout << "nsteps " << nsteps << endl;
---
> if (tellProgress != 0) {
> tellProgress->init (nsteps);
> }
451,452c450,451
< // Determine the axis where the collapsed values are stored in the output.
< // This is the first unmapped axis (the first axis when all axes are mapped).
---
> // Determine the axis where the collapsed values are stored in the output.
> // This is the first unmapped axis (the first axis when all axes are mapped).
454,458c453,457
< for (j=0; j<outDim; j++) {
< if (ioMap(j) < 0) {
< resultAxis = j;
< break;
< }
---
> for (j=0; j<outDim; ++j) {
> if (ioMap(j) < 0) {
> resultAxis = j;
> break;
> }
461,464c460,463
< // Iterate through all the tiles.
< // TileStepper is set up in such a way that the collapse axes are iterated
< // fastest. When all collapse axes are handled, thus when the iter axes
< // position changes, we have to write that part.
---
> // Iterate through all the tiles.
> // TileStepper is set up in such a way that the collapse axes are iterated
> // fastest. When all collapse axes are handled, thus when the iter axes
> // position changes, we have to write that part.
471,519c470,553
< // Calculate the size of each chunk of output data.
< // Each chunk contains the data of a tile in each IterAxis.
< // Determine the index of the first element to take from the cursor.
<
< const Array<T>& cursor = inIter.cursor();
< const IPosition& cursorShape = cursor.shape();
< IPosition pos = inIter.position();
< IPosition latPos = pos;
< Array<Bool> mask;
< if (useMask) {
< // Casting const away is innocent.
< ((MaskedLattice<T>&)latticeIn).getMaskSlice
< (mask, Slicer(pos, cursorShape));
< }
< for (j=0; j<outDim; j++) {
< if (ioMap(j) >= 0) {
< uInt axis = ioMap(j);
< iterPos(j) = pos(axis);
< }
< }
< if (firstTime || outPos != iterPos) {
< if (!firstTime) {
< Array<U> result;
< Array<Bool> resultMask;
< collapser.endAccumulator (result, resultMask, outShape);
< latticeOut.putSlice (result, outPos);
< if (maskOut != 0) {
< maskOut->putSlice (resultMask, outPos);
< }
< }
< firstTime = False;
< outPos = iterPos;
< uInt n1 = 1;
< uInt n3 = 1;
< for (j=0; j<outDim; j++) {
< if (ioMap(j) >= 0) {
< outShape(j) = cursorShape(ioMap(j));
< if (j < resultAxis) {
< n1 *= outShape(j);
< } else {
< n3 *= outShape(j);
< }
< }
< }
< collapser.initAccumulator (n1, n3);
< }
<
< // Put the collapsed lines into an output buffer
< // Initialize the cursor position needed in the loop.
---
> // Calculate the size of each chunk of output data.
> // Each chunk contains the data of a tile in each IterAxis.
> // Determine the index of the first element to take from the cursor.
>
> const Array<T>& iterCursor = inIter.cursor();
> // In order to use the pointers-to-array-data below, the array *must*
> // be contiguous or the results will in general be incorrect.
> // Ditto for the mask
> const Array<T>& cursor = iterCursor.contiguousStorage()
> ? iterCursor : iterCursor.copy();
> ThrowIf(
> ! cursor.contiguousStorage(), "cursor array is not contiguous"
> );
> const IPosition& cursorShape = cursor.shape();
> IPosition pos = inIter.position();
> IPosition latPos = pos;
> Array<Bool> mask;
> if (useMask) {
> // Casting const away is innocent.
> ((MaskedLattice<T>&)latticeIn).getMaskSlice(mask, Slicer(pos, cursorShape));
> if (! mask.contiguousStorage()) {
> mask = mask.copy();
> ThrowIf(
> ! mask.contiguousStorage(), "mask array is not contiguous"
> );
> }
> }
> for (j=0; j<outDim; ++j) {
> if (ioMap(j) >= 0) {
> uInt axis = ioMap(j);
> iterPos(j) = pos(axis);
> }
> }
> if (firstTime || outPos != iterPos) {
> if (!firstTime) {
> Array<U> result;
> Array<Bool> resultMask;
> collapser.endAccumulator (result, resultMask, outShape);
> latticeOut.putSlice (result, outPos);
> if (maskOut != 0) {
> maskOut->putSlice (resultMask, outPos);
> }
> }
> firstTime = False;
> outPos = iterPos;
> uInt n1 = 1;
> uInt n3 = 1;
> for (j=0; j<outDim; ++j) {
> if (ioMap(j) >= 0) {
> outShape(j) = cursorShape(ioMap(j));
> if (j < resultAxis) {
> n1 *= outShape(j);
> }
> else {
> n3 *= outShape(j);
> }
> }
> }
> collapser.initAccumulator (n1, n3);
> }
>
> // Put the collapsed lines into an output buffer
> // Initialize the cursor position needed in the loop.
>
> IPosition curPos (inDim, 0);
>
> // Determine the increment for the first collapse axes.
> // This is done by taking the difference between the adresses of two pixels
> // in the cursor (if there are 2 pixels).
>
> IPosition chunkShape (inDim, 1);
> for (j=0; j<collStart; ++j) {
> const uInt axis = collapseAxes(j);
> chunkShape(axis) = cursorShape(axis);
> }
> uInt nval = chunkShape.product();
> const uInt axis = collapseAxes(0);
>
> IPosition p0(inDim, 0);
> IPosition p1(inDim, 0);
> p1[axis] = 1;
> // general for Arrays with contiguous or non-contiguous storage.
> uInt dataIncr = &(cursor(p1)) - &(cursor(p0));
> uInt maskIncr = useMask ? &(mask(p1)) - &(mask(p0)) : 0;
521c555,556
< IPosition curPos (inDim, 0);
---
> // Iterate in the outer loop through the iterator axes.
> // Iterate in the inner loop through the collapse axes.
523,552c558,559
< // Determine the increment for the first collapse axes.
< // This is done by taking the difference between the adresses of two pixels
< // in the cursor (if there are 2 pixels).
<
< IPosition chunkShape (inDim, 1);
< for (j=0; j<collStart; j++) {
< const uInt axis = collapseAxes(j);
< chunkShape(axis) = cursorShape(axis);
< }
< uInt nval = chunkShape.product();
< const uInt axis = collapseAxes(0);
<
< IPosition p0(inDim, 0);
< IPosition p1(inDim, 0);
< p1[axis] = 1;
< // general for Arrays with contiguous or non-contiguous storage.
< uInt dataIncr = &(cursor(p1)) - &(cursor(p0));
< uInt maskIncr = useMask ? &(mask(p1)) - &(mask(p0)) : 0;
<
< // cout << " cursorShape " << cursorShape << endl;
< // cout << " chunkShape " << chunkShape << endl;
< // cout << " incr " << incr << endl;
< // cout << " nval " << nval << endl;
<
< // Iterate in the outer loop through the iterator axes.
< // Iterate in the inner loop through the collapse axes.
<
< uInt index1 = 0;
< uInt index3 = 0;
< for (;;) {
---
> uInt index1 = 0;
> uInt index3 = 0;
554,575c561,586
< // cout << curPos << ' ' << collPos << endl;
< if (useMask) {
< collapser.process (index1, index3,
< &(cursor(curPos)), &(mask(curPos)),
< dataIncr, maskIncr, nval, latPos, chunkShape);
< } else {
< collapser.process (index1, index3,
< &(cursor(curPos)), 0,
< dataIncr, maskIncr, nval, latPos, chunkShape);
< }
< // Increment a collapse axis until all axes are handled.
< for (j=collStart; j<collDim; j++) {
< uInt axis = collapseAxes(j);
< if (++curPos(axis) < cursorShape(axis)) {
< break;
< }
< curPos(axis) = 0; // restart this axis
< }
< if (j == collDim) {
< break; // all axes are handled
< }
< }
---
> for (;;) {
> if (useMask) {
> collapser.process (
> index1, index3, &(cursor(curPos)), &(mask(curPos)),
> dataIncr, maskIncr, nval, latPos, chunkShape
> );
> }
> else {
> collapser.process(
> index1, index3,
> &(cursor(curPos)), 0,
> dataIncr, maskIncr, nval, latPos, chunkShape
> );
> }
> // Increment a collapse axis until all axes are handled.
> for (j=collStart; j<collDim; ++j) {
> uInt axis = collapseAxes(j);
> if (++curPos(axis) < cursorShape(axis)) {
> break;
> }
> curPos(axis) = 0; // restart this axis
> }
> if (j == collDim) {
> break; // all axes are handled
> }
> }
577c588
< // Increment an iteration axis until all iteration axes are handled.
---
> // Increment an iteration axis until all iteration axes are handled.
579,600c590,614
< for (j=0; j<iterDim; j++) {
< uInt arraxis = iterAxes(j);
< uInt axis = ioMap(arraxis);
< ++latPos(axis);
< if (++curPos(axis) < cursorShape(axis)) {
< if (arraxis < resultAxis) {
< index1++;
< } else {
< index3++;
< index1 = 0;
< }
< break;
< }
< curPos(axis) = 0;
< latPos(axis) = pos(axis);
< }
< if (j == iterDim) {
< break;
< }
< }
< inIter++;
< if (tellProgress != 0) tellProgress->nstepsDone (inIter.nsteps());
---
> for (j=0; j<iterDim; ++j) {
> uInt arraxis = iterAxes(j);
> uInt axis = ioMap(arraxis);
> ++latPos(axis);
> if (++curPos(axis) < cursorShape(axis)) {
> if (arraxis < resultAxis) {
> ++index1;
> }
> else {
> ++index3;
> index1 = 0;
> }
> break;
> }
> curPos(axis) = 0;
> latPos(axis) = pos(axis);
> }
> if (j == iterDim) {
> break;
> }
> }
> ++inIter;
> if (tellProgress != 0) {
> tellProgress->nstepsDone (inIter.nsteps());
> }
603c617
< // Write out the last output array.
---
> // Write out the last output array.
634c648
< for (i=1; i<collDim; i++) {
---
> for (i=1; i<collDim; ++i) {
642c656
< for (i=collDim; i<inDim; i++) {
---
> for (i=collDim; i<inDim; ++i) {
647c661
< newOutAxis++;
---
> ++newOutAxis;
660c674
< for (i=collDim; i<inDim; i++) {
---
> for (i=collDim; i<inDim; ++i) {
670c684
< k++;
---
> ++k;
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/LatticeMath/LatticeStatistics.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/LatticeMath/LatticeStatistics.tcc
288c288,290
< error_p = "Invalid cursor axes";
---
> ostringstream oss;
> oss << "Invalid cursor axes: " << axes;
> error_p = oss.str();
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/LatticeMath/MaskedLatticeStatsDataProvider.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/LatticeMath/MaskedLatticeStatsDataProvider.tcc
42c42
< MaskedLattice<T>& lattice, uInt
---
> MaskedLattice<T>& lattice, uInt iteratorLimitBytes
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/LatticeMath/test/tFit2D.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/LatticeMath/test/tFit2D.cc
60c60
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21509 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/LatticeMath/test/tLatticeSlice1D.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/LatticeMath/test/tLatticeSlice1D.cc
59c59
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21549 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/LatticeMath/test/tLatticeStatistics.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/LatticeMath/test/tLatticeStatistics.cc
173d172
< #if 0
175c174
< // using setAlgorithm()
---
> // using configure*() methods
179c178
< stats.setAlgorithm(StatisticsData::CLASSICAL);
---
> stats.configureClassical();
181c180
< Float expec = casacore::mean(data);
---
> Float expec = casa::mean(data);
184d182
< stats.setAlgorithm(StatisticsData::HINGESFENCES);
191,199d188
< Bool exceptionThrown = False;
< try {
< stats.configureFitToHalf();
< }
< catch (const AipsError& x) {
< exceptionThrown = True;
< }
< AlwaysAssert(exceptionThrown, AipsError);
< stats.setAlgorithm(StatisticsData::FITTOHALF);
201,202c190,191
< FitToHalfStatisticsData::CMEAN,
< FitToHalfStatisticsData::LE_CENTER
---
> FitToHalfStatisticsData::CMEAN,
> FitToHalfStatisticsData::LE_CENTER
207c196
< AlwaysAssert(near(m, casacore::mean(data)), AipsError);
---
> AlwaysAssert(near(m, casa::mean(data)), AipsError);
219c208
< AlwaysAssert(near(*v.begin(), casacore::min(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), casa::min(data)), AipsError);
221c210
< AlwaysAssert(near(*v.begin(), 2*m - casacore::min(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), 2*m - casa::min(data)), AipsError);
237c226
< AlwaysAssert(near(m, casacore::mean(data)), AipsError);
---
> AlwaysAssert(near(m, casa::mean(data)), AipsError);
249c238
< AlwaysAssert(near(*v.begin(), 2*m - casacore::max(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), 2*m - casa::max(data)), AipsError);
251c240
< AlwaysAssert(near(*v.begin(), casacore::max(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), casa::max(data)), AipsError);
272c261
< AlwaysAssert(near(*v.begin(), casacore::min(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), casa::min(data)), AipsError);
274c263
< AlwaysAssert(near(*v.begin(),2*m - casacore::min(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(),2*m - casa::min(data)), AipsError);
295c284
< AlwaysAssert(near(*v.begin(), 2*m - casacore::max(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), 2*m - casa::max(data)), AipsError);
297c286
< AlwaysAssert(near(*v.begin(), casacore::max(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), casa::max(data)), AipsError);
321c310
< AlwaysAssert(near(*v.begin(), 2*m - casacore::min(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), 2*m - casa::min(data)), AipsError);
345c334
< AlwaysAssert(near(*v.begin(), casacore::max(data)), AipsError);
---
> AlwaysAssert(near(*v.begin(), casa::max(data)), AipsError);
362d350
< stats.setAlgorithm(StatisticsData::FITTOHALF);
387d374
< #endif
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/Lattices/SubLattice.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/Lattices/SubLattice.tcc
258,261c258,262
< if (!(itsLatticePtr->shape().isEqual(region.region().latticeShape()))) {
< throw (AipsError ("SubLattice::SubLattice - "
< "shape of lattice mismatches lattice shape in region"));
< }
---
> ThrowIf(
> ! (itsLatticePtr->shape().isEqual(region.region().latticeShape())),
> "shape of lattice " + itsLatticePtr->shape().toString()
> + " mismatches lattice shape in region " + region.region().latticeShape().toString()
> );
505d505
<
509c509,515
< return itsLatticePtr->getAt (positionInParent(where));
---
> return itsLatticePtr->getAt (positionInParent(where));
> /*
> if (! itsAxesMap.isRemoved()) {
> return itsLatticePtr->getAt (itsRegion.convert (where));
> }
> return itsLatticePtr->getAt (itsRegion.convert(itsAxesMap.posToOld (where)));
> */
515,516c521,528
< if (!itsWritable) {
< throw (AipsError ("SubLattice::putAt - non-writable lattice"));
---
> ThrowIf(! itsWritable, "SubLattice::putAt - non-writable lattice");
> itsLatticePtr->putAt (value, positionInParent(where));
> /*
> if (! itsAxesMap.isRemoved()) {
> itsLatticePtr->putAt (value, itsRegion.convert (where));
> } else {
> itsLatticePtr->putAt (value, itsRegion.convert (itsAxesMap.posToOld
> (where)));
518c530
< itsLatticePtr->putAt (value, positionInParent(where));
---
> */
diff -I '.*\$Id.*' -r casacore-2.0.1/lattices/Lattices/test/tRebinLattice.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/lattices/Lattices/test/tRebinLattice.cc
61c61
< inputs.version ("$Revision$");
---
> inputs.version ("$Revision: 21509 $");
diff -I '.*\$Id.*' -r casacore-2.0.1/measures/Measures/MeasTable.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/measures/Measures/MeasTable.cc
4344,4345c4344,4345
< "Until table is updated (see system/CASA manager) times and coordinates\n" +
< "derived from UTC could be wrong by 1s or more." << LogIO::POST;
---
> "Until the table is updated (see the CASA documentation or your system admin),\n" +
> "times and coordinates derived from UTC could be wrong by 1s or more." << LogIO::POST;
diff -I '.*\$Id.*' -r casacore-2.0.1/mirlib/README /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/mirlib/README
42,46c42,46
< MIRIAD V3 (the BIMA version of MIRIAD) has been placed under CVS control,
< mirlib is a direct extraction of that release (June 2001).
< A new version of this library will be needed to deal with
< large (>2GB) files, which is to be extracted from the CARMA version
< of MIRIAD (2011).
---
> MIRIAD V4 (the CARMA version of MIRIAD) has been placed under CVS control,
> mirlib is based on that release (May 2014).
> This version can handle files >2GB. The file maxdimc.h was
> edited to allow larger problems to be handled.
> The code was edited to reduce the number of compiler warnings.
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/CMakeLists.txt /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/CMakeLists.txt
306,307d305
< MSSel.h
< MSOper.h
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/makefile /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/makefile
3,5c3,10
< # Use the generic AIPS++ package makefile.
< #-----------------------------------------
< include $(word 1, $(AIPSPATH))/code/install/makefile.pkg
---
> # Use the generic AIPS++ class implementation makefile.
> #------------------------------------------------------
> include $(word 1, $(AIPSPATH))/code/install/makefile.imp
>
> # Set up a parallel make if PARALLEL_MAKE is defined in makedefs.
> ifdef PARALLEL_MAKE
> MAKE := $(PARALLEL_MAKE)
> endif
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/MSOper/MSConcat.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/MSOper/MSConcat.cc
2259c2259
< if(!fieldCols.ephemPath(i).empty()){ // this is an ephemeris object
---
> if(!otherFieldCols.ephemPath(i).empty()){ // this is an ephemeris object
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/MSOper/MSMetaData.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/MSOper/MSMetaData.cc
33a34
> #include <casacore/ms/MeasurementSets/MSFieldColumns.h>
39a41,42
> //#include <iomanip>
>
916a920,931
> MDirection MSMetaData::phaseDirFromFieldIDAndTime(const uInt fieldID, const MEpoch& ep) const {
> _hasFieldID(fieldID);
> ROMSFieldColumns msfc(_ms->field());
> if(! msfc.needInterTime(fieldID)) {
> return msfc.phaseDirMeas(fieldID, 0.0);
> }
> MEpoch::Types msType = MEpoch::castType(msfc.timeMeas()(fieldID).getRef().getType());
> Unit sec("s");
> Double inSeconds= MEpoch::Convert(ep, msType)().get(sec).getValue();
> return msfc.phaseDirMeas(fieldID, inSeconds);
> }
>
927,928c942,943
< CountedPtr<Vector<Int> > allDDIDs = _getDataDescIDs();
< CountedPtr<Vector<Int> > allFieldIDs = _getFieldIDs();
---
> CountedPtr<Vector<Int> > allDDIDs = _getDataDescIDs();
> CountedPtr<Vector<Int> > allFieldIDs = _getFieldIDs();
1779c1794,1798
< if (*(++times.rend()) >= minTime && *times.begin() <= maxTime) {
---
> Double maxScanTime = *max_element(times.begin(), times.end());
> Double minScanTime = *min_element(times.begin(), times.end());
> //cout << "scan " << *scan << "minscantime " << std::setprecision(20) << minScanTime
> // << " maxscantime " << maxScanTime << " minTime " << minTime << " maxTime " << maxTime << endl;
> if (maxScanTime >= minTime && minScanTime <= maxTime) {
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/MSOper/MSMetaData.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/MSOper/MSMetaData.h
244c244,249
<
---
> //Get the phase direction for a given field id and epoch
> //interpolate polynomial if it is the field id is such or use ephemerides table
> //if that is attached to that field id
> MDirection phaseDirFromFieldIDAndTime(const uInt fieldID,
> const MEpoch& ep=MEpoch(Quantity(0.0, Unit("s")))) const ;
>
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/MSOper/NewMSSimulator.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/MSOper/NewMSSimulator.h
194c194
< const String& state_obs_mode="OBSERVE_TARGET.ON_SOURCE",
---
> const String& state_obs_mode="OBSERVE_TARGET#ON_SOURCE",
212c212
< const String& state_obs_mode="OBSERVE_TARGET.ON_SOURCE",
---
> const String& state_obs_mode="OBSERVE_TARGET#ON_SOURCE",
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/MSOper/test/tMSMetaData.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/MSOper/test/tMSMetaData.cc
353a354,364
>
> }
> cout << "*** test phaseDirFromFieldIDAndTime()" << endl;
> {
>
> MDirection phasCen=md.phaseDirFromFieldIDAndTime(2);
>
> AlwaysAssert(
> near(phasCen.getAngle().getValue()[0], -2.72554329 , 5e-7),
> AipsError
> );
diff -I '.*\$Id.*' -r casacore-2.0.1/ms/MSSel/MSUvDistGram.yy /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/ms/MSSel/MSUvDistGram.yy
39c39
< Double dval;
---
> Double dval, uvrange[2];
51c51,52
< %type <node> uvwdistexpr
---
> //%type <node> uvwdistexpr
> %type <uvrange> uvwdistexpr
73c74,75
< $$ = $1;
---
> //$$ = $1;
> $$ = MSUvDistParse::thisMSUParser->selectUVRange($1[0],$1[1],MSUvDistGramlexGlobalUnits);
77c79,80
< $$ = $3;
---
> //$$ = $3;
> $$ = MSUvDistParse::thisMSUParser->selectUVRange($3[0],$3[1],MSUvDistGramlexGlobalUnits);
95,96c98,99
< // $$ = MSUvDistParse().selectUVRange($1, $1, MSUvDistGramlexGlobalUnits);
< $$ = MSUvDistParse::thisMSUParser->selectUVRange($1, $1, MSUvDistGramlexGlobalUnits);
---
> //$$ = MSUvDistParse::thisMSUParser->selectUVRange($1, $1, MSUvDistGramlexGlobalUnits);
> $$[0] = $1;
100c103,105
< $$ = MSUvDistParse::thisMSUParser->selectUVRange($1, $3, MSUvDistGramlexGlobalUnits);
---
> //$$ = MSUvDistParse::thisMSUParser->selectUVRange($1, $3, MSUvDistGramlexGlobalUnits);
> $$[0] = $1;
> $$[1] = $3;
104,105c109,111
< // $$ = MSUvDistParse().selectUVRange(0, $2, MSUvDistGramlexGlobalUnits);
< $$ = MSUvDistParse::thisMSUParser->selectUVRange(0, $2, MSUvDistGramlexGlobalUnits);
---
> //$$ = MSUvDistParse::thisMSUParser->selectUVRange(0, $2, MSUvDistGramlexGlobalUnits);
> $$[0]=0.0;
> $$[1]=$2;
109,119c115,125
< /* $$ = MSUvDistParse().selectUVRange($2+EPS, std::numeric_limits<Float>::max(), */
< /* MSUvDistGramlexGlobalUnits); */
< $$ = MSUvDistParse::thisMSUParser->selectUVRange($2+EPS, std::numeric_limits<Float>::max(),
< MSUvDistGramlexGlobalUnits);
< }
< | fnumwithunits COLON FNUMBER PERCENT
< {
< /* $$ = MSUvDistParse().selectUVRange($1*(1-$3*0.01), $1*(1+$3*0.01), */
< /* MSUvDistGramlexGlobalUnits); */
< $$ = MSUvDistParse::thisMSUParser->selectUVRange($1*(1-$3*0.01), $1*(1+$3*0.01),
< MSUvDistGramlexGlobalUnits);
---
> // $$ = MSUvDistParse::thisMSUParser->selectUVRange($2+EPS, std::numeric_limits<Float>::max(),
> // MSUvDistGramlexGlobalUnits);
> $$[0]=$2+EPS;
> $$[1]=std::numeric_limits<Float>::max();
> }
> | uvwdistexpr COLON FNUMBER PERCENT
> {
> // $$ = MSUvDistParse::thisMSUParser->selectUVRange($1*(1-$3*0.01), $1*(1+$3*0.01),
> // MSUvDistGramlexGlobalUnits);
> $$[0]=$1[0]*(1-$3*0.01);
> $$[1]=$1[1]*(1+$3*0.01);
121,122c127
< ;
<
---
> ;
diff -I '.*\$Id.*' -r casacore-2.0.1/msfits/MSFits/MSFitsInput.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/msfits/MSFits/MSFitsInput.cc
240,241c240,241
< infile_p(0), msc_p(0), addSourceTable_p(False), itsLog(LogOrigin(
< "MSFitsInput", "MSFitsInput")), newNameStyle(useNewStyle) {
---
> infile_p(0), msc_p(0), restfreq_p(0), addSourceTable_p(False), itsLog(LogOrigin(
> "MSFitsInput", "MSFitsInput")), newNameStyle(useNewStyle), _msCreated(False) {
274,275d273
< //cout << "++infile_p->hdutype()=" << infile_p->hdutype() << endl;
<
296d293
< //cout << "==infile_p->hdutype()=" << infile_p->hdutype() << endl;
300d296
< //cout << "--infile_p->hdutype()=" << infile_p->hdutype() << endl;
311c307
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
332d327
<
336,337d330
< //cout << "priGroup_p.gcount()=" << priGroup_p.gcount()
< // << " ns=" << ns << " nc=" << nc << " nf=" << nf << endl;
341,342d333
< //cout << "=========msFile_p=" << msFile_p
< // << " estStor=" << estStor << endl;
346c337
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
364,365c355,356
< catch(AipsError ex) {
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> catch(const AipsError& ex) {
> itsLog << LogOrigin("MSFitsInput", __func__)
374,375c365,366
< catch(AipsError ex) {
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> catch(const AipsError& ex) {
> itsLog << LogOrigin("MSFitsInput", __func__)
382d372
<
385c375
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
393c383
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
396,397c386
<
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
403d391
<
420c408
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
446d433
<
450c437
< itsLog << LogOrigin("MSFitsInput", "readRandomGroupUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
458c445
< itsLog << LogOrigin("MSFitsInput", "readPrimaryTableUVFits")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
469,470d455
< //cout << "now processing the tables....." << endl;
<
485,487d469
< //cout << "timeVal=" << timeVal << endl;
< //cout << "obstime=" << obsTime(0) << " " << obsTime(1) << endl;
<
497d478
< //cout << "infile_p->err()=" << infile_p->err() << endl;
499d479
< //cout << "infile_p->err()=" << infile_p->err() << endl;
502,504d481
< //cout << "rectype=" << infile_p->rectype() << endl;
< //cout << "rectype FITS::HDURecord=" << FITS::HDURecord << endl;
< //cout << "Data type is " << infile_p->datatype() << endl;
551,552d527
< //cout << "UV table keywords:\n" << pkw << endl;
<
594c569
< itsLog << LogOrigin("MSFitsInput", "readFitsFile")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
598,599c573,574
< if (infile_p->hdutype() == FITS::PrimaryGroupHDU) {
< try {
---
> try {
> if (infile_p->hdutype() == FITS::PrimaryGroupHDU) {
602,612c577
< catch(AipsError ex) {
< itsLog << LogOrigin("MSFitsInput", "readFitsFile")
< << ex.getMesg()
< << LogIO::EXCEPTION;
< }
< } else if (infile_p->hdutype() == FITS::PrimaryTableHDU) {
< //itsLog << LogOrigin("MSFitsInput", "readFitsFile")
< // << LogIO::SEVERE
< // << "Primary Table uvfits not yet handled!"
< // << LogIO::EXCEPTION;
< try {
---
> else if (infile_p->hdutype() == FITS::PrimaryTableHDU) {
614,624c579,596
< }
< catch(AipsError ex) {
< itsLog << LogOrigin("MSFitsInput", "readFitsFile")
< << ex.getMesg()
< << LogIO::EXCEPTION;
< }
< }
< else {
< itsLog << LogOrigin("MSFitsInput", "readFitsFile")
< << LogIO::SEVERE << "unhandled extension type! "
< << LogIO::EXCEPTION;
---
> }
> else {
> ThrowCc("Unhandled extension type");
> }
> }
> catch(const AipsError& ex) {
>
> if (_msCreated) {
> String name = ms_p.tableName();
> itsLog << LogIO::NORMAL << "Exception while processing UVFITS file. Deleting incomplete MS '"
> << name << "'" << LogIO::POST;
> ms_p.closeSubTables();
> ms_p.relinquishAutoLocks(True);
> // detach to close
> ms_p = MeasurementSet();
> Table::deleteTable(name, True);
> }
> ThrowCc(ex.getMesg());
654,658d625
< //cout << "dataType=" << dataType
< // << " FITS::FLOAT=" << FITS::FLOAT
< // << " FITS::SHORT=" << FITS::SHORT
< // << " FITS::LONG=" << FITS::LONG
< // << " FITS::BYTE=" << FITS::BYTE << endl;
852,855d818
<
< // cout << "Discerned type: " << MFrequency::showType(freqsys_p) << endl;
< // cout << "Discerned restfreq: " << restfreq_p << endl;
<
861d823
< // cout << "SPECSYS Override: " << MFrequency::showType(freqsys_p) << endl;
873,874d834
< // cout << "useAltrval = " << boolalpha << useAltrval << endl;
<
913d872
< //cout << "setup New Table" << endl;
941c900
< itsLog << LogOrigin("MSFitsInput", "setupMeasurementSet");
---
> itsLog << LogOrigin("MSFitsInput", __func__);
972c931
< //cout << "ms created" << endl;
---
> _msCreated = True;
1097d1055
< //cout << "nm=" << nm << endl;
1100d1057
< //cout << "history=" << history << endl;
1744,1746d1700
< // cout << "TiledFlag statistics" << endl;
< // dmFlag.showCacheStatistics(cout);
< // cout << "---------------------------------------------------" << endl;
1748,1749d1701
< // cout << endl;
< // cout << "TiledWgtSpectrum statistics" << endl;
1751,1752d1702
< // dmWeight.showCacheStatistics(cout);
< // cout << "---------------------------------------------------" << endl;
1771d1720
< //cout << "nAnt=" << nAnt << endl;
1957d1905
< //cout << "array_p=" << array_p << endl;
2014,2016d1961
<
< //cout << "fSWT type: " << MFrequency::showType(freqsys_p) << endl;
<
2042d1986
< //cout << "nIF_p=" << nIF_p << endl;
2204d2147
<
2210d2152
<
2231c2173
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
2237d2178
<
2239c2180
< restFreq_p.resize(noif, suTab.nrow());
---
> //restFreq_p.resize(noif, suTab.nrow());
2241,2252c2182,2206
< try{
< ROArrayColumn<Double> restfreq(suTab,"RESTFREQ"); // Hz
< ROArrayColumn<Double> sysvel(suTab,"LSRVEL"); // m/s
< restfreq.getColumn(restFreq_p);
< sysvel.getColumn(sysVel_p);
< }
< catch (std::exception x) {
< if(noif>1){
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable") << LogIO::WARN
< << x.what() << ": " << "Inconsistent setup of RESTFREQ and LSRVEL columns." << endl
< << "With NO_IF>1, they should be arrays not scalars." << LogIO::POST;
< }
---
> Bool throwImmediately = False;
> try {
> ROArrayColumn<Double> restfreq(suTab,"RESTFREQ"); // Hz
> ROArrayColumn<Double> sysvel(suTab,"LSRVEL"); // m/s
> restfreq.getColumn(restFreq_p);
> // purposeful assignment of throwImmediately
> // because it appears that the sense of rows and columns are reversed here
> Int nrestfreqs = restFreq_p.nrow();
> throwImmediately = nrestfreqs != noif;
> ThrowIf(
> throwImmediately,
> "Inconsistent SU table, number of elements in rest frequency column is "
> + String::toString(nrestfreqs) + " but number of IFs is "
> + String::toString(noif)
> );
> sysvel.getColumn(sysVel_p);
> }
> catch (const AipsError& x) {
> ThrowIf(throwImmediately, x.getMesg());
> if(noif>1){
> itsLog << LogOrigin("MSFitsInput", __func__) << LogIO::WARN
> << x.what() << ": " << "Inconsistent setup of RESTFREQ and LSRVEL columns." << endl
> << "With NO_IF>1, they should be arrays not scalars." << LogIO::POST;
> }
> restFreq_p.resize(noif, suTab.nrow());
2264d2217
<
2274c2227
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
2281d2233
<
2318d2269
<
2329c2280
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
2333c2284
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
2698d2648
< //cout << "tdim=" << tdim << endl;
2703,2704d2652
< //cout << "ipos=" << shp << endl;
<
2952d2899
< //cout << "-----\n" << pkw << endl;
2991d2937
< //cout << " --------msFile_p=" << msFile_p << endl;
3075,3076d3020
< //cout << "nr=" << tb.nrow() << " nc=" << tb.isNull() << endl;
<
3091,3092d3034
< //cout << "visib=" << visib << endl;
<
3096,3099d3037
< //cout << "time=" << time
< // << " tf=" << time - (TZero(iTime0))
< // << " tm=" << tm << endl;
<
3304,3310d3241
< //cout << "fill field---------"
< // << "\ncoordType=" << coordType_p
< // << "\nrefVal=" << refVal_p
< // << "\nrefPix=" << refPix_p
< // << "\ndelta=" << delta_p
< // << "\nnPixel_p=" << nPixel_p
< // << endl;
3316d3246
<
3318,3319d3247
<
<
3453d3380
< //cout << "ms name=" << tName << endl;
3458,3459d3384
< //cout << "mainRec=\n" << mainRec << endl;
< //cout << "num of scans=" << mainRec.nfields() << endl;
3463,3465d3387
< //cout << "fieldRec=\n" << fieldRec << endl;
< //cout << "num of fields=" << fieldRec.nfields() << endl;
<
3473,3474d3394
< //cout << "subRecord=\n" << rec << endl;
<
3482,3484d3401
<
< //cout << "time=" << time << " fid=" << fid << " name=" << name
< // << " spwIds=" << spwIds << endl;
3639c3556
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
3657c3574
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable") << LogIO::WARN
---
> itsLog << LogOrigin("MSFitsInput", __func__) << LogIO::WARN
3676c3593
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
3731c3648
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
3735c3652
< itsLog << LogOrigin("MSFitsInput", "fillFieldTable")
---
> itsLog << LogOrigin("MSFitsInput", __func__)
diff -I '.*\$Id.*' -r casacore-2.0.1/msfits/MSFits/MSFitsInput.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/msfits/MSFits/MSFitsInput.h
420a421
> Bool _msCreated;
Only in casacore-2.0.1/: README.md
diff -I '.*\$Id.*' -r casacore-2.0.1/scimath/Mathematics/InterpolateArray1D.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/scimath/Mathematics/InterpolateArray1D.tcc
208c208
< DebugAssert(xin.nelements()==yinShape(2),AipsError);
---
> //DebugAssert(xin.nelements()==yinShape(ndim-1),AipsError);
271,273c271,273
< Domain diff=(xin[where]-x_req);
< //static_cast required to get .5 coerced for SGI compiler:
< if (diff < static_cast<Domain>(.5)*(xin[where]-xin[where-1])) {
---
> Domain diff=abs(xin[where]-x_req);
> Domain halfspan=static_cast<Domain>(.5)*abs(xin[where]-xin[where-1]);
> if (diff < halfspan) {
435,437c435,437
< Domain diff=(xin[where] - x_req);
< //static_cast required to get .5 coerced for SGI compiler:
< if (diff < static_cast<Domain>(.5)*(xin[where]-xin[where-1])) {
---
> Domain diff=abs(xin[where] - x_req);
> Domain halfspan=static_cast<Domain>(.5)*abs(xin[where]-xin[where-1]);
> if (diff < halfspan) {
diff -I '.*\$Id.*' -r casacore-2.0.1/scimath/Mathematics/test/tFitToHalfStatistics.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/scimath/Mathematics/test/tFitToHalfStatistics.cc
1442c1442
< AlwaysAssert(medabsdevmed == 249799040801ULL, AipsError);
---
> AlwaysAssert(medabsdevmed == 249799040801, AipsError);
diff -I '.*\$Id.*' -r casacore-2.0.1/scimath/Mathematics/test/tInterpolateArray1D.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/scimath/Mathematics/test/tInterpolateArray1D.cc
36a37
> #include <casacore/casa/Arrays/ArrayMath.h>
229a231,278
> template <class T, class S>
> class TestNearestInterpolation1
> {
> public:
> TestNearestInterpolation1()
> {
>
> Int N(10);
> Vector<T> Xa(N,0.0), Xd(N,0.0);
> Vector<S> Ya(N,0.0), Yd(N,0.0);
> indgen(Xa);
> indgen(Ya);
> for (Int i=0;i<N;++i) {
> Xd[i]=Xa[N-1-i];
> Yd[i]=Ya[N-1-i];
> }
>
> Int n(90);
> Vector<T> x(n,0.0);
> Vector<S> ya(n,0.0), yd(n,0.0);
> indgen(x);
> x/=static_cast<T>(10.0); // tenths
>
> Int method = InterpolateArray1D<T,S>::nearestNeighbour;
>
> InterpolateArray1D<T,S>::interpolate(ya,x,Xa,Ya,method); // Ascending abscissa
> InterpolateArray1D<T,S>::interpolate(yd,x,Xd,Yd,method); // Descending abscissa
>
> Vector<S> yatest(n,0.0),ydtest(n,0.0);
> indgen(yatest);
> yatest/=static_cast<S>(10.0);
> yatest+=static_cast<S>(0.4999); // ensures middle value goes down (matches InterpolateArray1D)
> yatest=floor(yatest);
>
> indgen(ydtest);
> ydtest/=static_cast<S>(10.0);
> ydtest+=static_cast<S>(0.5001); // ensures middle value goes up (matches InterpolateArray1D)
> ydtest=floor(ydtest);
>
> AlwaysAssert(allEQ(ya,yatest),AipsError);
> AlwaysAssert(allEQ(yd,ydtest),AipsError);
>
> ++tests_done;
>
> }
> };
>
>
242a292,300
> template <class T, class S>
> void run_nearest_tests()
> {
>
> TestNearestInterpolation1<T, S> ();
>
> return;
> }
>
249a308,311
>
> run_nearest_tests<Float,Float>();
> run_nearest_tests<Double,Float>();
>
diff -I '.*\$Id.*' -r casacore-2.0.1/scimath/Mathematics/ZScoreCalculator.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/scimath/Mathematics/ZScoreCalculator.cc
51,52c51,52
< _nptsToMaxZScore[6225098696ULL] = 6.5;
< _nptsToMaxZScore[195341107722ULL] = 7;
---
> _nptsToMaxZScore[6225098696] = 6.5;
> _nptsToMaxZScore[195341107722] = 7;
diff -I '.*\$Id.*' -r casacore-2.0.1/scimath_f/atmroutines.f /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/scimath_f/atmroutines.f
435c435
< * sc = scaling factor for the wavelength dependent part of the wet refraction
---
> * sc = scaling factor for the wavelenght dependent part of the wet refration
Only in /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/: scons-tools
Only in /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/: .svn
Binary files casacore-2.0.1/tables/DataMan/test/tSSMAddRemove.in and /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/tables/DataMan/test/tSSMAddRemove.in differ
diff -I '.*\$Id.*' -r casacore-2.0.1/tables/DataMan/TSMCube.cc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/tables/DataMan/TSMCube.cc
109c109,111
< : stmanPtr_p (stman),
---
> : cachedTile_p (0),
> cachedTileLength_p (0),
> stmanPtr_p (stman),
141c143,145
< : stmanPtr_p (stman),
---
> : cachedTile_p (0),
> cachedTileLength_p (0),
> stmanPtr_p (stman),
158a163
> delete cachedTile_p;
690c695,703
< char* local = new char[localTileLength_p];
---
> char* local = 0;
>
> if (cachedTile_p != 0 && cachedTileLength_p == localTileLength_p){
> local = cachedTile_p;
> cachedTile_p = 0;
> } else {
> local = new char[localTileLength_p];
> }
>
704c717
< void TSMCube::deleteCallBack (void*, char* buffer)
---
> void TSMCube::deleteCallBack (void* owner, char* buffer)
706c719,725
< delete [] buffer;
---
> TSMCube * tsmCube = ((TSMCube*)owner);
> if (tsmCube->cachedTile_p == 0){
> tsmCube->cachedTile_p = buffer;
> tsmCube->cachedTileLength_p = tsmCube->localTileLength_p;
> } else {
> delete [] buffer;
> }
diff -I '.*\$Id.*' -r casacore-2.0.1/tables/DataMan/TSMCube.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/tables/DataMan/TSMCube.h
351a352,355
>
> char * cachedTile_p; // optimization to hold one tile chunk
> uInt cachedTileLength_p;
>
diff -I '.*\$Id.*' -r casacore-2.0.1/tables/Tables/ArrayColumn.h /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/tables/Tables/ArrayColumn.h
33a34
> #include <casacore/casa/Arrays/Vector.h>
44a46
> class ColumnSlicer;
333,334c335,336
< const Vector<Vector<Slice> >& arraySlices,
< Array<T>& arr,
---
> const ColumnSlicer & slicerSet,
> Array<T>& destination,
336,339c338,342
< void getSliceForRows (const RefRows& rows,
< const Vector<Vector<Slice> >& arraySlices,
< Array<T>& destination) const
< { getColumnCells (rows, arraySlices, destination, True); }
---
>
> // void getSliceForRows (const RefRows& rows,
> // const Vector<Vector<Slice> >& arraySlices,
> // Array<T>& destination) const
> // { getColumnCells (rows, arraySlices, destination, True); }
501a505,543
> };
>
> class ColumnSlicer {
>
> public:
>
> ColumnSlicer (const IPosition & shape, Vector<Slicer *> dataSlicers, Vector<Slicer *> destinationSlicers)
> : dataSlicers_p (dataSlicers),
> destinationSlicers_p (destinationSlicers),
> shape_p (shape)
> {}
>
> ~ColumnSlicer (){
> for (uInt i = 0; i < dataSlicers_p.size(); i++){
> delete dataSlicers_p [i];
> delete destinationSlicers_p [i];
> }
> }
>
> const Vector <Slicer *> & getDataSlicers () const
> {
> return dataSlicers_p;
> }
>
> const Vector <Slicer *> & getDestinationSlicers () const
> {
> return destinationSlicers_p;
> }
>
> const IPosition & shape () const
> {
> return shape_p;
> }
>
> private:
>
> Vector<Slicer *> dataSlicers_p;
> Vector<Slicer *> destinationSlicers_p;
> IPosition shape_p;
diff -I '.*\$Id.*' -r casacore-2.0.1/tables/Tables/ArrayColumn.tcc /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/tables/Tables/ArrayColumn.tcc
197c197
< {
---
> {
203c203
< blc, trc, inc);
---
> blc, trc, inc);
207c207
< canAccessSlice_p = baseColPtr_p->canAccessSlice (reaskAccessSlice_p);
---
> canAccessSlice_p = baseColPtr_p->canAccessSlice (reaskAccessSlice_p);
215,223c215,223
< baseColPtr_p->getSlice (rownr,
< arraySection,
< &arr);
< } else {
< baseColPtr_p->getSlice (rownr,
< Slicer(blc, trc, inc,
< Slicer::endIsLast),
< &arr);
< }
---
> baseColPtr_p->getSlice (rownr,
> arraySection,
> &arr);
> } else {
> baseColPtr_p->getSlice (rownr,
> Slicer(blc, trc, inc,
> Slicer::endIsLast),
> &arr);
> }
225,227c225,227
< Array<T> array(arrayShape);
< baseColPtr_p->get (rownr, &array);
< arr = array(blc, trc, inc);
---
> Array<T> array(arrayShape);
> baseColPtr_p->get (rownr, &array);
> arr = array(blc, trc, inc);
229c229
< }
---
> }
263c263
< const Vector<Vector<Slice> > & arraySlices,
---
> const ColumnSlicer & columnSlicer,
267c267,354
< // Check to see if the data request makes sense.
---
> // Calculate the shape of the destination data. This will be
> // [s1, s2, ..., nR] where sI are the sum of the slice elements for
> // that axis as contained in arraySlices [i]. nR is the number of rows
> // in the RefRows object rows. Resize the destination array to match.
>
> const Vector<Slicer *> dataSlicers = columnSlicer.getDataSlicers();
> const Vector<Slicer *> destinationSlicers = columnSlicer.getDestinationSlicers();
>
> IPosition destinationShape (columnSlicer.shape());
> destinationShape.append (IPosition (1, rows.nrows()));
>
> static const String tag ("ArrayColumn::getColumnCells (rows, slicers, ...)");
> checkShape (destinationShape, destination, resize, tag);
>
> // Fill the destination array one row at a time.
> // If rows is not sliced then rowNumbers is simply a vector of the relevant
> // row numbers. When sliced, rowNumbers is a triple: (start, nRows, increment).
> // Thus we have two different ways of walking through the selected rows.
>
> const Vector<uInt> & rowNumbers = rows.rowVector();
> Bool useRowSlicing = rows.isSliced();
> int row = 0;
> int increment = 1;
>
> if (useRowSlicing){
>
> AlwaysAssert (rowNumbers.nelements() == 3, AipsError);
>
> increment = rowNumbers [2];
> row = rowNumbers [0] ;
> }
>
> uInt nSlicers = dataSlicers.size();
> uInt nRows = rows.nrows();
>
> for (uInt i = 0; i < nRows; i++){
>
> // Create a section of the destination array that will hold the
> // data for this row ([s1, ...,sN, nR] --> [s1,...,sN].
>
> Array<T> destinationRow = destination [i];
>
> for (uInt j = 0; j < nSlicers; j++){
>
> Array<T> destinationRowSection = destinationRow (* destinationSlicers[j]);
> baseColPtr_p->getSlice (row, * dataSlicers[j], & destinationRowSection);
> }
>
> row = useRowSlicing ? row + increment
> : rowNumbers (i);
> }
> }
>
>
> //template<class T>
> //void
> //ArrayColumn<T>::getColumnCellsSlicers (const Vector<Vector<Slice> > & arraySlices,
> // uInt axis,
> // Vector<uInt> selections,
> // vector<Slicer *> result) const
> //{
> // if (axis == arraySlices.size()){
> //
> // IPosition start (axis), increment (axis), length (axis);
> //
> // for (uInt i = 0; i < axis; i++){
> //
> // const Slice & slice = arraySlices [i] [selections [i]];
> // start [i] = slice.start();
> // increment [i] = slice.inc();
> // length [i] = slice.length();
> //
> // result.push_back = new Slicer (start, length, increment);
> //
> // }
> //
> // return;
> // }
> //
> // const Vector<Slice> & thisAxis = arraySlices [axis];
> //
> // for (uInt i = 0; i < thisAxis.size(); i++){
> //
> // selections [axis] = i;
> // getColumnCellsSlicers (arraySlices, axis + 1, selections, result);
> // }
> //
> //}
269,307d355
< IPosition columnShape = shape(rows.firstRow());
<
< uInt nExpectedDims = arraySlices.nelements();
<
< if (columnShape.nelements() != nExpectedDims){
<
< String message = String::format ("Column has wrong number of dimensions; expected %d "
< " had %d",
< nExpectedDims,
< columnShape.nelements());
< throw (TableArrayConformanceError (message));
< }
<
< // Calculate the shape of the destination data. This will be
< // [s1, s2, ..., nR] where sI are the sum of the slice elements for
< // that axis as contained in arraySlices [i]. nR is the number of rows
< // in the RefRows object rows. Resize the destination array to match.
<
< IPosition destinationShape (columnShape.nelements() + 1);
< destinationShape (destinationShape.nelements() - 1) = rows.nrows();
<
< for (uInt i = 0; i < arraySlices.nelements(); i++){
<
< Int n = 0;
< if (arraySlices [i].nelements () == 0){
< n = columnShape (i); // all elements
< }
< else{
<
< // Count up the number of elements in each slice of this axis.
<
< for (uInt j = 0; j < arraySlices [i].nelements(); j++){
< n += arraySlices (i)(j).length();
< }
< }
<
< destinationShape (i) = n; // Install the size of this dimension
<
< }
309,310d356
< checkShape (destinationShape, destination, resize,
< "ArrayColumn::getSliceForRows");
312,348d357
< // Fill the destination array one row at a time.
<
< const Vector<uInt> & rowNumbers = rows.rowVector();
<
< // If rows is not sliced then rowNumbers is simply a vector of the relevant
< // row numbers. When sliced, rowNumbers is a triple: (start, nRows, increment).
< // Thus we have two different ways of walking through the selected rows.
<
< Bool useSlicing = rows.isSliced();
< int row=0;
< int increment=1;
<
< if (useSlicing){
<
< AlwaysAssert (rowNumbers.nelements() == 3, AipsError);
<
< increment = rowNumbers [2];
< row = rowNumbers [0] - increment; // allows preincrement before first use
< }
<
< for (uInt i = 0; i < rows.nrows(); i++){
<
< // Create a section of the destination array that will hold the
< // data for this row ([s1, ...,sN, nR] --> [s1,...,sN].
<
< Array<T> destinationSection = destination [i];
<
< if (rows.isSliced()){
< row += increment;
< }
< else{
< row = rowNumbers (i);
< }
<
< getSlice (row, arraySlices, destinationSection, False);
< }
< }
Only in casacore-2.0.1/: .travis.yml
Only in /home/dijkema/opt/casacore/casa_release-4_4/casacore-4_4/: VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment