Example #1
0
    def test_lens_model_plot(self):
        f, ax = plt.subplots(1, 1, figsize=(4, 4))
        lensModel = LensModel(lens_model_list=['SIS'])
        kwargs_lens = [{'theta_E': 1., 'center_x': 0, 'center_y': 0}]
        lens_plot.lens_model_plot(ax,
                                  lensModel,
                                  kwargs_lens,
                                  numPix=10,
                                  deltaPix=0.5,
                                  sourcePos_x=0,
                                  sourcePos_y=0,
                                  point_source=True,
                                  with_caustics=True,
                                  fast_caustic=False)
        plt.close()

        lens_plot.lens_model_plot(ax,
                                  lensModel,
                                  kwargs_lens,
                                  numPix=10,
                                  deltaPix=0.5,
                                  sourcePos_x=0,
                                  sourcePos_y=0,
                                  point_source=True,
                                  with_caustics=True,
                                  fast_caustic=True)
        plt.close()
Example #2
0
                                   lens_model_class=None,
                                   source_model_class=source_model_class,
                                   kwargs_numerics=kwargs_numerics)
    image_source = imageModel_source.image([{}],
                                           kwargs_source_list,
                                           unconvolved=True)
    kwargs_lens_light_copy['mag'] = -2.5 * np.log10(
        np.sum(image_deflector)) + zp
    kwargs_source_light_copy['mag'] = -2.5 * np.log10(
        np.sum(image_source)) + zp

    image_highres = image_without_arc + image_arc_conv
    print('total flux:', np.sum(image_highres))
    #print('total_mag:', -2.5*np.log10(np.sum(image_highres))+zp)
    plt.imshow(np.log10(image_highres), origin='lower', vmin=-4.5)
    plt.colorbar()
    plt.show()

    #%%
    ###################Active this part if need to see the caustic and critical line
    from lenstronomy.Plots import lens_plot
    f, ax = plt.subplots(1, 1, figsize=(5, 5), sharex=False, sharey=False)
    lens_plot.lens_model_plot(ax,
                              lensModel=lens_model_class,
                              kwargs_lens=kwargs_lens_list,
                              sourcePos_x=source_pos[0],
                              sourcePos_y=source_pos[1],
                              point_source=True,
                              with_caustics=True)
    f.show()