Skip to content

Commit

Permalink
Merge pull request #42 from casacore/VoronkovMA-casacore-3.4-conversion
Browse files Browse the repository at this point in the history
Voronkov ma casacore 3.4 conversion
  • Loading branch information
aroffringa authored Nov 17, 2021
2 parents 37c76a0 + 1e7702b commit 3acc257
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 58 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ add_definitions(-DCASA_STANDALONE)

# -------- library building ----------------------------
INCLUDE_DIRECTORIES(${CASACORE_INCLUDE_DIR}
${CASACORE_INCLUDE_DIR}/casacore
${CASACORE_INCLUDE_DIR}
${CFITSIO_INCLUDE_DIR}
${WCSLIB_INCLUDE_DIR}
${HDF5_INCLUDE_DIRS}
Expand Down
2 changes: 1 addition & 1 deletion components/ComponentModels/FluxCalc_SS_JPL_Butler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Bool FluxCalc_SS_JPL_Butler::readEphem()
<< "\n\tin " << edir
<< LogIO::POST;

Directory hordir(edir);
const Directory hordir(edir);
DirectoryIterator dirIter(hordir, Regex(tabpat));
uInt firstTimeStart = name_p.length() + 1; // The + 1 is for the _.
Regex timeUnitPat("[ydhms]");
Expand Down
2 changes: 1 addition & 1 deletion msvis/MSVis/VisibilityIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ void ROVisibilityIterator::update_rowIds() const
if (rowIds_p.nelements() == 0) {
rowIds_p = selRows_p.convert();

Vector<uInt> msIter_rowIds(msIter_p.table().rowNumbers(msIter_p.ms()));
Vector<rownr_t> msIter_rowIds(msIter_p.table().rowNumbers(msIter_p.ms()));

for (uInt i = 0; i < rowIds_p.nelements(); i++) {
rowIds_p(i) = msIter_rowIds(rowIds_p(i));
Expand Down
4 changes: 2 additions & 2 deletions synthesis/MeasurementComponents/BeamSkyJones.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/*
// temporary, for debugging
#include <casacore/casa/Quanta/MVAngle.h>
void printDirection(std::ostream &os,const casacore::MDirection &dir) throw (casacore::AipsError) {
void printDirection(std::ostream &os,const casacore::MDirection &dir) {
double lngbuf=dir.getValue().getLong("deg").getValue();
if (lngbuf<0) lngbuf+=360.;
os<<(dir.getRefString()!="GALACTIC"?casacore::MVAngle::Format(casacore::MVAngle::TIME):
Expand Down Expand Up @@ -212,7 +212,7 @@ Bool BeamSkyJones::changed(const VisBuffer& vb, Int row)
// return True if two directions are close enough to consider the
// operator unchanged, False otherwise
Bool BeamSkyJones::directionsCloseEnough(const MDirection &dir1,
const MDirection &dir2) const throw(AipsError)
const MDirection &dir2) const
{
Double sep;
if (dir1.getRef()!=dir2.getRef())
Expand Down
2 changes: 1 addition & 1 deletion synthesis/MeasurementComponents/BeamSkyJones.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class BeamSkyJones : virtual public SkyJones {
// return True if two directions are close enough to consider the
// operator unchanged, False otherwise
Bool directionsCloseEnough(const MDirection &dir1,
const MDirection &dir2) const throw(AipsError);
const MDirection &dir2) const;

// return index of compareTelescope, compareAntenna and compareFeed in
// myTelescopes_p, myAntennaIDs and myFeedIDs; -1 if not found
Expand Down
4 changes: 0 additions & 4 deletions synthesis/MeasurementComponents/EVLAConvFunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@
#include <casacore/coordinates/Coordinates/DirectionCoordinate.h>
#include <casacore/coordinates/Coordinates/SpectralCoordinate.h>
#include <casacore/coordinates/Coordinates/StokesCoordinate.h>
#if defined(casacore)
#include <casacore/lattices/LatticeMath/LatticeFFT.h>
#else
#include <casacore/lattices/LatticeMath/LatticeFFT.h>
#endif
#include <casacore/casa/Logging/LogIO.h>
#include <casacore/casa/Logging/LogSink.h>
#include <casacore/casa/Logging/LogOrigin.h>
Expand Down
17 changes: 8 additions & 9 deletions synthesis/MeasurementComponents/Utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ namespace casacore{
// (e.g. a change in the parallactic angle)

// return True if a change occurs somewhere in the buffer
Bool IChangeDetector::changed(const VisBuffer &vb) const throw(AipsError)
Bool IChangeDetector::changed(const VisBuffer &vb) const
{
for (Int i=0;i<vb.nRow();++i)
if (changed(vb,i)) return True;
Expand All @@ -282,7 +282,7 @@ namespace casacore{
// up to row2 (row2=-1 means up to the end of the buffer). The row number,
// where the change occurs is returned in the row2 parameter
Bool IChangeDetector::changedBuffer(const VisBuffer &vb, Int row1,
Int &row2) const throw(AipsError)
Int &row2) const
{
if (row1<0) row1=0;
Int jrow = row2;
Expand All @@ -305,7 +305,7 @@ namespace casacore{
}

// a virtual destructor to make the compiler happy
IChangeDetector::~IChangeDetector() throw(AipsError) {}
IChangeDetector::~IChangeDetector() {}

//
/////////////////////////////////////////////////////////////////////////////
Expand All @@ -318,8 +318,8 @@ namespace casacore{

// set up the tolerance, which determines how much the position angle should
// change to report the change by this class
ParAngleChangeDetector::ParAngleChangeDetector(const Quantity &pa_tolerance)
throw(AipsError) : pa_tolerance_p(pa_tolerance.getValue("rad")),
ParAngleChangeDetector::ParAngleChangeDetector(const Quantity &pa_tolerance) :
pa_tolerance_p(pa_tolerance.getValue("rad")),
last_pa_p(1000.) {} // 1000 is >> 2pi, so it is changed
// after construction

Expand All @@ -329,21 +329,21 @@ namespace casacore{
pa_tolerance_p = abs(pa_tolerance.getValue("rad"));
}
// reset to the state which exist just after construction
void ParAngleChangeDetector::reset() throw(AipsError)
void ParAngleChangeDetector::reset()
{
last_pa_p=1000.; // it is >> 2pi, which would force a changed state
}

// return parallactic angle tolerance
Quantity ParAngleChangeDetector::getParAngleTolerance() const throw(AipsError)
Quantity ParAngleChangeDetector::getParAngleTolerance() const
{
return Quantity(pa_tolerance_p,"rad");
}

// return True if a change occurs in the given row since the last call
// of update
Bool ParAngleChangeDetector::changed(const VisBuffer &vb, Int row)
const throw(AipsError)
const
{
if (row<0) row=0;
// const Double feed1_pa=vb.feed1_pa()[row];
Expand All @@ -367,7 +367,6 @@ namespace casacore{

// start looking for a change from the given row of the VisBuffer
void ParAngleChangeDetector::update(const VisBuffer &vb, Int row)
throw(AipsError)
{
if (row<0) row=0;
const Double feed1_pa=vb.feed1_pa()[row];
Expand Down
22 changes: 11 additions & 11 deletions synthesis/MeasurementComponents/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,24 @@ namespace casacore
//
struct IChangeDetector {
// return True if a change occurs in the given row since the last call of update
virtual Bool changed(const VisBuffer &vb, Int row) const throw(AipsError) = 0;
virtual Bool changed(const VisBuffer &vb, Int row) const = 0;
// start looking for a change from the given row of the VisBuffer
virtual void update(const VisBuffer &vb, Int row) throw(AipsError) = 0;
virtual void update(const VisBuffer &vb, Int row) = 0;

// reset to the state which exists just after construction
virtual void reset() throw(AipsError) = 0;
virtual void reset() = 0;

// some derived methods, which use the abstract virtual function changed(vb,row)

// return True if a change occurs somewhere in the buffer
Bool changed(const VisBuffer &vb) const throw(AipsError);
Bool changed(const VisBuffer &vb) const;
// return True if a change occurs somewhere in the buffer starting from row1
// up to row2 (row2=-1 means up to the end of the buffer). The row number,
// where the change occurs is returned in the row2 parameter
Bool changedBuffer(const VisBuffer &vb, Int row1, Int &row2) const throw(AipsError);
Bool changedBuffer(const VisBuffer &vb, Int row1, Int &row2) const;
protected:
// a virtual destructor to make the compiler happy
virtual ~IChangeDetector() throw(AipsError);
virtual ~IChangeDetector();
};
//
//////////////////////////////////////////////////////////////////////////////
Expand All @@ -137,21 +137,21 @@ namespace casacore
ParAngleChangeDetector():pa_tolerance_p(0.0) {};
// set up the tolerance, which determines how much the position angle should
// change to report the change by this class
ParAngleChangeDetector(const Quantity &pa_tolerance) throw(AipsError);
ParAngleChangeDetector(const Quantity &pa_tolerance);

virtual void setTolerance(const Quantity &pa_tolerance);
// reset to the state which exists just after construction
virtual void reset() throw(AipsError);
virtual void reset();

// return parallactic angle tolerance
Quantity getParAngleTolerance() const throw(AipsError);
Quantity getParAngleTolerance() const;

// implementation of the base class' virtual functions

// return True if a change occurs in the given row since the last call of update
virtual Bool changed(const VisBuffer &vb, Int row) const throw(AipsError);
virtual Bool changed(const VisBuffer &vb, Int row) const;
// start looking for a change from the given row of the VisBuffer
virtual void update(const VisBuffer &vb, Int row) throw(AipsError);
virtual void update(const VisBuffer &vb, Int row);
};

//
Expand Down
12 changes: 0 additions & 12 deletions synthesis/MeasurementComponents/WOnlyConvFunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ namespace casacore { //# NAMESPACE CASACORE - BEGIN
virtual void setPolMap(const Vector<Int>& polMap) {wTerm_p->setPolMap(polMap);};

virtual Bool findSupport(Array<Complex>& func, Float& threshold,Int& origin, Int& R);

//
// Pedgree baggage (NoOps).
//
Bool makeAverageResponse(const VisBuffer& vb,
const ImageInterface<Complex>& image,
ImageInterface<Float>& theavgPB,
Bool reset=True) {};
Bool makeAverageResponse(const VisBuffer& vb,
const ImageInterface<Complex>& image,
ImageInterface<Complex>& theavgPB,
Bool reset=True) {};
protected:
void setSupport(Array<Complex>& convFunc, CFStore& cfs);

Expand Down
1 change: 1 addition & 0 deletions synthesis/MeasurementComponents/WPConvFunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <synthesis/MeasurementComponents/PixelatedConvFunc.h>
#include <casacore/casa/Containers/Block.h>
#include <casacore/casa/Utilities/CountedPtr.h>
#include <casacore/casa/Arrays/ArrayFwd.h>

namespace casacore{

Expand Down
2 changes: 1 addition & 1 deletion synthesis/MeasurementEquations/ConvolutionEquation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Bool ConvolutionEquation::evaluate(Array<Float> & result,
IPosition newtrc(thePsf.ndim(), 0);
IPosition newblc(thePsf.ndim(), 0);
for(uInt i = 0; i < thePsf.ndim(); i++){
newblc(i) = -min(blc(i), 0);
newblc(i) = -std::min(blc(i), ssize_t{0});
newSize(i) = std::max(trc(i)+1, psfSize(i)) + newblc(i);
newtrc(i) = newblc(i) + psfSize(i) - 1;
}
Expand Down
7 changes: 2 additions & 5 deletions synthesis/MeasurementEquations/Imager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,12 @@ Imager::~Imager()
Directory ledir(rootpath+"/"+dir.name());
ledir.removeRecursive();
dir++;

}

}
else{
throw(AipsError(x));

// Can't throw exception (in destructor), so just output to cmdline
std::cout << "Error in Imager destructor: " << x.what() << '\n';
}

}


Expand Down
4 changes: 0 additions & 4 deletions synthesis/MeasurementEquations/MatrixCleaner.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@
#include <casacore/casa/Arrays/Vector.h>
#include <casacore/casa/Arrays/ArrayFwd.h>
#include <casacore/casa/Containers/Block.h>
#if defined(casacore)
#include <casacore/lattices/LatticeMath/LatticeCleaner.h>
#else
#include <casacore/lattices/LatticeMath/LatticeCleaner.h>
#endif

namespace casacore { //# NAMESPACE CASACORE - BEGIN

Expand Down
6 changes: 3 additions & 3 deletions synthesis/MeasurementEquations/MultiTermMatrixCleaner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ Int MultiTermMatrixCleaner::IND4(Int taylor1, Int taylor2, Int scale1, Int scale
/* Check if scale sizes are appropriate to the image size
If some scales are too big, ignore them.
Reset nscales_p BEFORE all arrays are allocated */
Int MultiTermMatrixCleaner::verifyScaleSizes()
void MultiTermMatrixCleaner::verifyScaleSizes()
{
LogIO os(LogOrigin("MultiTermMatrixCleaner", "verifyScaleSizes()", WHERE));
Vector<Int> scaleflags(nscales_p); scaleflags=0;
Expand Down Expand Up @@ -1017,7 +1017,7 @@ Int MultiTermMatrixCleaner::chooseComponent(Int ntaylor, Int scale, Int criterio
/* Update the RHS vector - Called from 'updateModelandRHS'.
Note : This function is called within the 'scale' omp/pragma loop. Needs to be thread-safe for scales.
*/
Int MultiTermMatrixCleaner::updateRHS(Int ntaylor, Int scale, Float loopgain, Vector<Float> coeffs, IPosition blc, IPosition trc, IPosition blcPsf, IPosition trcPsf)
void MultiTermMatrixCleaner::updateRHS(Int ntaylor, Int scale, Float loopgain, Vector<Float> coeffs, IPosition blc, IPosition trc, IPosition blcPsf, IPosition trcPsf)
{
for(Int taylor1=0;taylor1<ntaylor;taylor1++)
{
Expand Down Expand Up @@ -1230,7 +1230,7 @@ Int MultiTermMatrixCleaner::checkConvergence(Int criterion, Float &fluxlimit, Fl


/* Save a matrix to disk */
Int MultiTermMatrixCleaner::writeMatrixToDisk(String imagename, Matrix<Float>& themat)
void MultiTermMatrixCleaner::writeMatrixToDisk(String imagename, Matrix<Float>& themat)
{
TabularCoordinate tab1(0, 1.0, 0, String("deg"), String("axis1"));
TabularCoordinate tab2(0, 1.0, 0, String("deg"), String("axis2"));
Expand Down
6 changes: 3 additions & 3 deletions synthesis/MeasurementEquations/MultiTermMatrixCleaner.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class MultiTermMatrixCleaner : public MatrixCleaner
FFTServer<Float,Complex> fftcomplex;

// Initial setup functions
Int verifyScaleSizes();
void verifyScaleSizes();
Int allocateMemory();
Int setupScaleFunctions();
Int computeHessianPeak();
Expand All @@ -190,11 +190,11 @@ class MultiTermMatrixCleaner : public MatrixCleaner
Int solveMatrixEqn(Int ntaylor,Int scale);
Int chooseComponent(Int ntaylor,Int scale, Int criterion);
Int updateModelAndRHS(Float loopgain);
Int updateRHS(Int ntaylor, Int scale, Float loopgain,Vector<Float> coeffs, IPosition blc, IPosition trc, IPosition blcPsf, IPosition trcPsf);
void updateRHS(Int ntaylor, Int scale, Float loopgain,Vector<Float> coeffs, IPosition blc, IPosition trc, IPosition blcPsf, IPosition trcPsf);
Int checkConvergence(Int updatetype, Float &fluxlimit, Float &loopgain);

// Helper functions
Int writeMatrixToDisk(String imagename, Matrix<Float> &themat);
void writeMatrixToDisk(String imagename, Matrix<Float> &themat);
Int IND2(Int taylor,Int scale);
Int IND4(Int taylor1, Int taylor2, Int scale1, Int scale2);

Expand Down
1 change: 1 addition & 0 deletions synthesis/apps/lwimager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <casacore/images/Images/HDF5Image.h>
#include <casacore/images/Images/ImageFITSConverter.h>
#include <casacore/casa/Inputs.h>
#include <casacore/casa/Arrays/Vector.h>
#include <casacore/casa/Arrays/ArrayUtil.h>
#include <casacore/casa/Arrays/ArrayMath.h>
#include <casacore/casa/Utilities/Regex.h>
Expand Down

0 comments on commit 3acc257

Please sign in to comment.