Source
1212
1212
os << LogIO::WARN << "Ignoring scale " << scale <<
1213
1213
" since it is too large to fit within the mask" << LogIO::POST;
1214
1214
}
1215
1215
1216
1216
}
1217
1217
1218
1218
return true;
1219
1219
}
1220
1220
1221
1221
1222
-
1222
+
Matrix<casacore::Float> MatrixCleaner::residual(const Matrix<Float>& model){
1223
+
FFTServer<Float,Complex> fft(model.shape());
1224
+
if(!itsDirty.null() && (model.shape() != (itsDirty->shape())))
1225
+
throw(AipsError("MatrixCleaner: model size has to be consistent with dirty image size"));
1226
+
if(itsXfr.null())
1227
+
throw(AipsError("MatrixCleaner: need to know the psf to calculate the residual"));
1228
+
1229
+
Matrix<Complex> modelFT;
1230
+
///Convolve model with psf
1231
+
fft.fft0(modelFT, model);
1232
+
modelFT= (*itsXfr) * modelFT;
1233
+
Matrix<Float> newResidual(itsDirty->shape());
1234
+
fft.fft0(newResidual, modelFT, false);
1235
+
fft.flip(newResidual, false, false);
1236
+
newResidual=(*itsDirty)-newResidual;
1237
+
return newResidual;
1238
+
}
1223
1239
1224
1240
1225
1241
Float MatrixCleaner::threshold() const
1226
1242
{
1227
1243
if (! itsDoSpeedup) {
1228
1244
return max(itsFracThreshold.get("%").getValue() * itsMaximumResidual /100.0,
1229
1245
itsThreshold.get("Jy").getValue());
1230
1246
} else {
1231
1247
const Float factor = exp( (Float)( itsIteration - itsStartingIter )/ itsNDouble )
1232
1248
/ 2.7182818;
1280
1296
if(psupport > nx || psupport > ny) psupport = std::min(nx,ny);
1281
1297
1282
1298
// Make it even.
1283
1299
if (psupport%2 != 0) psupport -= 1;
1284
1300
1285
1301
return psupport;
1286
1302
}
1287
1303
1288
1304
1289
1305
} //# NAMESPACE CASA - END
1290
-