Beispiel #1
0
 static SBExponential * construct(
     const bp::object & half_light_radius,
     const bp::object & scale_radius,
     double flux
 ) {
     double s = 1.0;
     checkRadii(half_light_radius, scale_radius, bp::object());
     if (half_light_radius.ptr() != Py_None) {
         s = bp::extract<double>(half_light_radius) / 1.6783469900166605; // not analytic
     }
     if (scale_radius.ptr() != Py_None) {
         s = bp::extract<double>(scale_radius);
     }
     return new SBExponential(s, flux);
 }
Beispiel #2
0
 static SBSpergel* construct(
     double nu, const bp::object & scale_radius, const bp::object & half_light_radius,
     double flux, boost::shared_ptr<GSParams> gsparams)
 {
     double s = 1.0;
     checkRadii(half_light_radius, scale_radius, bp::object());
     SBSpergel::RadiusType rType = SBSpergel::HALF_LIGHT_RADIUS;
     if (half_light_radius.ptr() != Py_None) {
         s = bp::extract<double>(half_light_radius);
     }
     if (scale_radius.ptr() != Py_None) {
         s = bp::extract<double>(scale_radius);
         rType = SBSpergel::SCALE_RADIUS;
     }
     return new SBSpergel(nu, s, rType, flux, gsparams);
 }
Beispiel #3
0
 static SBGaussian* construct(
     const bp::object& half_light_radius, const bp::object& sigma, const bp::object& fwhm,
     double flux, boost::shared_ptr<GSParams> gsparams) 
 {
     double s = 1.0;
     checkRadii(half_light_radius, sigma, fwhm);
     if (half_light_radius.ptr() != Py_None) {
         s = bp::extract<double>(half_light_radius) * 0.84932180028801907; // (2\ln2)^(-1/2)
     }
     if (sigma.ptr() != Py_None) {
         s = bp::extract<double>(sigma);
     }
     if (fwhm.ptr() != Py_None) {
         s = bp::extract<double>(fwhm) * 0.42466090014400953; // 1 / (2(2\ln2)^(1/2))
     }
     return new SBGaussian(s, flux, gsparams);
 }
Beispiel #4
0
 static SBMoffat* construct(
     double beta, const bp::object & fwhm, const bp::object & scale_radius,
     const bp::object & half_light_radius, double trunc, double flux,
     boost::shared_ptr<GSParams> gsparams)
 {
     double s = 1.0;
     checkRadii(half_light_radius, scale_radius, fwhm);
     SBMoffat::RadiusType rType = SBMoffat::FWHM;
     if (fwhm.ptr() != Py_None) {
         s = bp::extract<double>(fwhm);
     }
     if (scale_radius.ptr() != Py_None) {
         s = bp::extract<double>(scale_radius);
         rType = SBMoffat::SCALE_RADIUS;
     }
     if (half_light_radius.ptr() != Py_None) {
         s = bp::extract<double>(half_light_radius);
         rType = SBMoffat::HALF_LIGHT_RADIUS;
     }
     return new SBMoffat(beta, s, rType, trunc, flux, gsparams);
 }