Source
shared_ptr<SIImageStore> retval(new SimpleSIImageStore(itsImageName, subimPtrs[0], subimPtrs[1], subimPtrs[2], subimPtrs[3], subimPtrs[4], subimPtrs[5], subimPtrs[6], subimPtrs[7], subimPtrs[8], subimPtrs[9], subimPtrs[10], itsUseWeight));
/*
* SimpleSIImageStore is an implementation without much checking the caller must make sure pointers exist before using them
* Copyright (C) 2019 Associated Universities, Inc. Washington DC, USA.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Queries concerning CASA should be submitted at
* https://help.nrao.edu
*
* Postal address: CASA Project Manager
* National Radio Astronomy Observatory
* 520 Edgemont Road
* Charlottesville, VA 22903-2475 USA
*/
using namespace std;
using namespace casacore;
namespace casa { //# NAMESPACE CASA - BEGIN
SimpleSIImageStore::SimpleSIImageStore (casacore::String &imageName, const shared_ptr<ImageInterface<Float> > &modelim,
const shared_ptr<ImageInterface<Float> > &residim, const shared_ptr<ImageInterface<Float> > &psfim,
const shared_ptr<ImageInterface<Float> > &weightim,const shared_ptr<ImageInterface<Float> > &restoredim,
const shared_ptr<ImageInterface<Float> > &maskim,const shared_ptr<ImageInterface<Float> > &sumwtim,
const shared_ptr<ImageInterface<Float> > &gridwtim, const shared_ptr<ImageInterface<Float> > &pbim,
const shared_ptr<ImageInterface<Float> > &restoredpbcorim,
const shared_ptr<ImageInterface<Float> > & tempworkimage, const Bool useweightimage) : SIImageStore() {
if(!psfim && !residim && !modelim) {
throw(AipsError("SimpleSIImagestore has to have a valid residual or psf image"));
}
else{
shared_ptr<ImageInterface<Float> >theim=psfim ? psfim : residim;
///this is constructed for divide/mult modelbyweight
if(!theim)
theim=modelim;
itsCoordSys=theim->coordinates();
itsImageShape=theim->shape();
itsParentImageShape=itsImageShape; //validate looks for that
}
if(useweightimage && !weightim)
throw(AipsError("SimpleSIImagestore has to have a valid weightimage for this kind of weighting scheme"));
itsImageName = casacore::String(imageName);
itsPsf = psfim;
itsModel=modelim;
itsResidual=residim;
itsWeight=weightim;
itsImage=restoredim;
itsSumWt=sumwtim;
itsMask=maskim;
itsImagePBcor=restoredpbcorim;
itsTempWorkIm=tempworkimage;
itsPB=pbim;
itsGridWt=gridwtim;
itsUseWeight=useweightimage;
}
shared_ptr<ImageInterface<Float> > SimpleSIImageStore::psf(uInt){
if(!itsPsf)
throw(AipsError("Programmer's error: calling for psf without setting it"));
return itsPsf;
}
shared_ptr<ImageInterface<Float> > SimpleSIImageStore::residual(uInt){
if(!itsResidual)
throw(AipsError("Programmer's error: calling for residual without setting it"));
return itsResidual;
}
shared_ptr<ImageInterface<Float> > SimpleSIImageStore::weight(uInt){
if(!itsWeight)
throw(AipsError("Programmer's error: calling for weight without setting it"));
return itsWeight;