OptimizeBeta

Attempt to find the optimal scale factors for each galaxy in a galaxy set. A standard chi2 minimization is used, where chi2 is the sum of the squares of the differences between pixel in the original image and the image reconstructed from shapelets.

The GSL library's one-dimensional minimization routine actually performs the optimization.

Parameters
NameTypeDescription
MaxIter int Maximum number of iterations to run the minimizer for each galaxy.
LowerBound double Lower bound for the scale factor.
UpperBound double Upper bound for the scale factor.
Guess double Initial guess of optimal beta. If not set, a value half-way between the upper and lower bounds is used.
Accuracy double Run minimizer until result seems to be correct within this bound. Default is .01
NumCoeff int Number of coefficients to use in decomposition. This should match whatever value will eventually be used to create final decompositions.
Subsample int If set, the number of subsamples to use when generating the basis functions. If not set, the function is not subsampled.
Verbose keyword If set, print out debugging information to cout.

Inputs
NameTypeDescription
GalSet/Width int Pixel width of the input galaxy set images.
GalSet/Height int Pixel height of the input galaxy set images.
GalSet/BiasedCount int Number of biased galaxy images in set.
GalSet/BiasedImages double* Pixel value array of images of biased galaxies.
GalSet/UnbiasedCount int Number of unbiased galaxy images in set.
GalSet/UnbiasedImages double* Pixel value array of images of unbiased galaxies.

Outputs
NameTypeDescription
GalSet/BiasedOptimalBetas double* Array of optimal scale factors, one for each biased galaxy.
GalSet/BiasedOptimalMeanBeta double Average optimal scale factor.
GalSet/UnbiasedOptimalBetas double* Array of optimal scale factors, one for each unbiased galaxy.
GalSet/UnbiasedOptimalMeanBeta double Average optimal scale factor.