Пример #1
0
    def test_half_light_radius_source(self):
        phi, q = -0.37221683730659516, 0.70799587973181288
        e1, e2 = param_util.phi_q2_ellipticity(phi, q)

        phi2, q2 = 0.14944144075912402, 0.4105628122365978
        e12, e22 = param_util.phi_q2_ellipticity(phi2, q2)

        kwargs_profile = [{
            'Rs': 0.16350224766074103,
            'e1': e12,
            'e2': e22,
            'center_x': 0,
            'center_y': 0,
            'amp': 1.3168943578511678
        }, {
            'Rs': 0.29187068596715743,
            'e1': e1,
            'e2': e2,
            'center_x': 0,
            'center_y': 0,
            'Ra': 0.020000382843298824,
            'amp': 85.948773973262391
        }]
        kwargs_options = {
            'lens_model_list': [],
            'source_light_model_list': ['HERNQUIST_ELLIPSE', 'PJAFFE_ELLIPSE']
        }
        lensAnalysis = LensAnalysis(kwargs_options)
        r_eff_true = 0.282786143932
        r_eff = lensAnalysis.half_light_radius_source(kwargs_profile,
                                                      numPix=1000,
                                                      deltaPix=0.05)
        npt.assert_almost_equal(r_eff / r_eff_true, 1, 2)
Пример #2
0
 def test_half_light_radius_source(self):
     kwargs_profile = [{
         'Rs': 0.16350224766074103,
         'q': 0.4105628122365978,
         'center_x': 0,
         'center_y': 0,
         'phi_G': 0.14944144075912402,
         'sigma0': 1.3168943578511678
     }, {
         'Rs': 0.29187068596715743,
         'q': 0.70799587973181288,
         'center_x': 0,
         'center_y': 0,
         'Ra': 0.020000382843298824,
         'phi_G': -0.37221683730659516,
         'sigma0': 85.948773973262391
     }]
     kwargs_options = {
         'lens_model_list': ['NONE'],
         'source_light_model_list': ['HERNQUIST_ELLIPSE', 'PJAFFE_ELLIPSE']
     }
     lensAnalysis = LensAnalysis(kwargs_options)
     r_eff_true = 0.282786143932
     r_eff = lensAnalysis.half_light_radius_source(kwargs_profile,
                                                   numPix=1000,
                                                   deltaPix=0.05)
     npt.assert_almost_equal(r_eff / r_eff_true, 1, 2)