本文整理汇总了C++中ModelObject::GetNValidPixels方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelObject::GetNValidPixels方法的具体用法?C++ ModelObject::GetNValidPixels怎么用?C++ ModelObject::GetNValidPixels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelObject
的用法示例。
在下文中一共展示了ModelObject::GetNValidPixels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
fprintf(stderr, "*** ERROR: Failure in ModelObject::AddMaskVector1D!\n\n");
exit(-1);
}
}
// Add PSF vector, if present, and thereby enable convolution
if (options.psfPresent) {
status = theModel->AddPSFVector1D(nPixels_psf, xVals_psf, yVals_psf);
if (status < 0) {
fprintf(stderr, "*** ERROR: Failure in ModelObject::AddPSFVector1D!\n\n");
exit(-1);
}
}
theModel->FinalSetupForFitting(); // calls ApplyMask(), VetDataVector()
theModel->PrintDescription();
// Parameter limits and other info:
printf("Setting up parameter information vector ...\n");
mp_par newParamLimit;
for (int i = 0; i < nParamsTot; i++) {
memset(&newParamLimit, 0, sizeof(mp_par));
newParamLimit.fixed = paramLimits[i].fixed;
if (paramLimits[i].fixed == 1) {
printf("Fixed parameter detected (i = %d)\n", i);
nFreeParams--;
}
newParamLimit.limited[0] = paramLimits[i].limited[0];
newParamLimit.limited[1] = paramLimits[i].limited[1];
newParamLimit.limits[0] = paramLimits[i].limits[0];
newParamLimit.limits[1] = paramLimits[i].limits[1];
parameterInfo.push_back(newParamLimit);
}
nDegFreedom = theModel->GetNValidPixels() - nFreeParams;
printf("%d free parameters (%d degrees of freedom)\n", nFreeParams, nDegFreedom);
// tell ModelObject about parameterInfo (mainly useful for printing-related methods)
theModel->AddParameterInfo(parameterInfo);
// OK, now we either print chi^2 value for the input parameters and quit, or
// else call one of the solvers!
if (options.printChiSquaredOnly) {
printf("\n");
fitStatus = 1;
PrintFitStatistic(paramsVect, theModel, nFreeParams);
printf("\n");
// turn off saveing of parameter file
options.saveBestFitParams = false;
}
else {
// DO THE FIT!
fitStatus = DispatchToSolver(options.solver, nParamsTot, nFreeParams, nStoredDataVals,
paramsVect, parameterInfo, theModel, options.ftol, paramLimitsExist,
options.verbose, &resultsFromSolver, options.nloptSolverName,
options.rngSeed);
PrintResults(paramsVect, theModel, nFreeParams, fitStatus, resultsFromSolver);
}
// OPTIONAL HANDLING OF BOOTSTRAP RESAMPLING HERE
if ((options.doBootstrap) && (options.bootstrapIterations > 0)) {
printf("\nNow doing bootstrap resampling (%d iterations) to estimate errors...\n",
options.bootstrapIterations);