LCOV - code coverage report
Current view: top level - synthesis/MeasurementEquations - IPLatConvEquation.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 27 0.0 %
Date: 2024-10-04 18:58:15 Functions: 0 5 0.0 %

          Line data    Source code
       1             : //# IPLatConvEquation.cc:  this defines IPLatConvEquation
       2             : //# Copyright (C) 1996,1997,1998,1999,2001
       3             : //# Associated Universities, Inc. Washington DC, USA.
       4             : //#
       5             : //# This library is free software; you can redistribute it and/or modify it
       6             : //# under the terms of the GNU Library General Public License as published by
       7             : //# the Free Software Foundation; either version 2 of the License, or (at your
       8             : //# option) any later version.
       9             : //#
      10             : //# This library is distributed in the hope that it will be useful, but WITHOUT
      11             : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12             : //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
      13             : //# License for more details.
      14             : //#
      15             : //# You should have received a copy of the GNU Library General Public License
      16             : //# along with this library; if not, write to the Free Software Foundation,
      17             : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
      18             : //#
      19             : //# Correspondence concerning AIPS++ should be addressed as follows:
      20             : //#        Internet email: casa-feedback@nrao.edu.
      21             : //#        Postal address: AIPS++ Project Office
      22             : //#                        National Radio Astronomy Observatory
      23             : //#                        520 Edgemont Road
      24             : //#                        Charlottesville, VA 22903-2475 USA
      25             : //#
      26             : //# $Id$
      27             : 
      28             : #include <synthesis/MeasurementEquations/IPLatConvEquation.h>
      29             : #include <synthesis/MeasurementEquations/LinearModel.h>
      30             : #include <synthesis/MeasurementEquations/LatticeModel.h>
      31             : #include <casacore/lattices/LEL/LatticeExpr.h>
      32             : #include <casacore/lattices/LEL/LatticeExprNode.h>
      33             : #include <casacore/lattices/Lattices/SubLattice.h>
      34             : #include <casacore/lattices/LRegions/LCBox.h>
      35             : #include <casacore/casa/Utilities/Assert.h>
      36             : #include <casacore/casa/Arrays/Vector.h>
      37             : #include <casacore/casa/Arrays/Array.h>
      38             : #include <casacore/casa/Arrays/ArrayMath.h>
      39             : #include <casacore/casa/Arrays/IPosition.h>
      40             : #include <casacore/casa/Exceptions/Error.h>
      41             : 
      42             : using namespace casacore;
      43             : namespace casa { //# NAMESPACE CASA - BEGIN
      44             : 
      45           0 : IPLatConvEquation::IPLatConvEquation(Lattice<Float> & psf, 
      46           0 :                                      Lattice<Float> & dirtyImage)
      47           0 :   : LatConvEquation(psf, dirtyImage)
      48             : {
      49           0 :   itsQ = sum(psf).getFloat();
      50           0 : }
      51             : 
      52           0 : IPLatConvEquation::~IPLatConvEquation() 
      53             : {
      54           0 : }
      55             : 
      56           0 : Bool IPLatConvEquation::residual(Lattice<Float> & result, 
      57             :                                const LinearModel< Lattice<Float> > & model) {
      58             : 
      59           0 :   if (LatConvEquation::residual(result, model)) {
      60             :     // Image Plane requires a second convolution
      61           0 :     TempLattice<Float> intermediate(result.shape());
      62           0 :     intermediate.copyData(result);
      63           0 :     LatticeModel intermediateModel (intermediate);
      64           0 :     if (LatConvEquation::evaluate(result, intermediateModel)) {
      65           0 :       result.copyData( LatticeExpr<Float>(result/itsQ) );
      66           0 :       return true;
      67             :     }
      68           0 :   }
      69           0 :   return false;
      70             : }
      71             : 
      72             : 
      73           0 : Bool IPLatConvEquation::residual(Lattice<Float> & result, 
      74             :                                Float & chisq,
      75             :                                const LinearModel<Lattice<Float> > & model) {
      76           0 :   if (LatConvEquation::residual(result, chisq, model)) {
      77             :     // Image Plane requires a second convolution
      78           0 :     TempLattice<Float> intermediate(result.shape());
      79           0 :     intermediate.copyData(result);
      80           0 :     LatticeModel intermediateModel (intermediate);
      81           0 :     if (LatConvEquation::evaluate(result, intermediateModel)) {
      82           0 :      result.copyData( LatticeExpr<Float>(result/itsQ) );
      83           0 :       return true;
      84             :     }
      85           0 :   }
      86           0 :   return false;
      87             : }
      88             : 
      89             : // Local Variables: 
      90             : // compile-command: "gmake OPTLIB=1 IPLatConvEquation"
      91             : // End: 
      92             : 
      93             : } //# NAMESPACE CASA - END
      94             : 

Generated by: LCOV version 1.16