Thank you very much @mwv for your reply!
@MelissaGraham , you are correct, we are using deepCoadd image. We got all the parameters of a selected galaxy from the DC2 catalog. Screen shots of some of the parameters of a selected galaxy are given below:
As @mwv aksed, here is a piece of code that I have used to generate these images:
I made a cutout (35*35 pixel) image of a galaxy at ra=61.999855458880795 and dec=-36.99883611551307. This cutout is from the deepCoadd image.
Then, I used following information of this galaxy from the DC2 catalog to generate an image using slsim:
position angle
position_angle=np.pi*dc2_galaxies[2][“position_angle_true”]/180
axis ratios of disk dominated galaxy
q_disk=dc2_galaxies[2][‘size_minor_disk_true’]/dc2_galaxies[2][‘size_disk_true’]
q_bulge=dc2_galaxies[2][‘size_minor_bulge_true’]/dc2_galaxies[2][‘size_bulge_true’]
q = dc2_galaxies[2][‘size_minor_true’]/dc2_galaxies[2][‘size_true’]
Disk dominated galaxy
epsilon_disk=(1-q_disk)/(1+q_disk)
epsilon_bulge=(1-q_bulge)/(1+q_bulge)
epsilon = (1-q)/(1+q)
disk dominated
e1_disk = epsilon_disk * np.cos(2 * position_angle)
e2_disk = epsilon_disk * np.sin(2 * position_angle)
e1_bulge = epsilon_bulge * np.cos(2 * position_angle)
e2_bulge = epsilon_bulge * np.sin(2 * position_angle)
e1 = epsilon * np.cos(2 * position_angle)
e2 = epsilon * np.sin(2 * position_angle)
#SLSim kwargs for a disk dominated galaxy. Here, we use
kwargs_lens_1 = [{‘theta_E’: 1,
‘gamma’: 2,
‘e1’: e1,
‘e2’: e2,
‘center_x’: center_cood_x_1,
‘center_y’: center_coord_y_1},
{‘gamma1’: dc2_galaxies[2][“shear_1”],
‘gamma2’: dc2_galaxies[2][“shear_2”],
‘ra_0’: 0,
‘dec_0’: 0},
{‘kappa’: dc2_galaxies[2][“convergence”], ‘ra_0’: 0, ‘dec_0’: 0}]
kwargs_source_1= None
flux_i_1 = 10 ** (-dc2_galaxies[2][“mag_true_i_lsst”] / 2.5)
mag_bulge_i_1 = -2.5 * np.log10(dc2_galaxies[2][“bulge_to_total_ratio_i”] * flux_i_1)
mag_disk_i_1 = -2.5 * np.log10((1-dc2_galaxies[2][“bulge_to_total_ratio_i”]) * flux_i_1)
kwargs_lens_light_i_1 = [{‘magnitude’: mag_bulge_i_1,
‘R_sersic’: dc2_galaxies[2][“size_bulge_true”],
‘n_sersic’: 4.0,
‘e1’: e1_bulge,
‘e2’: e2_bulge,
‘center_x’: center_cood_x_1,
‘center_y’: center_coord_y_1},
{‘magnitude’: mag_disk_i_1,
‘R_sersic’: dc2_galaxies[2][“size_disk_true”],
‘n_sersic’: 1.0,
‘e1’: e1_disk,
‘e2’: e2_disk,
‘center_x’: center_cood_x_1,
‘center_y’: center_coord_y_1}]
flux_r_1 = 10 ** (-dc2_galaxies[2][“mag_true_r_lsst”] / 2.5)
mag_bulge_r_1 = -2.5 * np.log10(dc2_galaxies[2][“bulge_to_total_ratio_i”] * flux_r_1)
mag_disk_r_1 = -2.5 * np.log10((1-dc2_galaxies[2][“bulge_to_total_ratio_i”]) * flux_r_1)
kwargs_lens_light_r_1 = [{‘magnitude’: mag_bulge_r_1,
‘R_sersic’: dc2_galaxies[2][“size_bulge_true”],
‘n_sersic’: 4.0,
‘e1’: e1_bulge,
‘e2’: e2_bulge,
‘center_x’: center_cood_x_1,
‘center_y’: center_coord_y_1},
{‘magnitude’: mag_disk_r_1,
‘R_sersic’: dc2_galaxies[2][“size_disk_true”],
‘n_sersic’: 1.0,
‘e1’: e1_disk,
‘e2’: e2_disk,
‘center_x’: center_cood_x_1,
‘center_y’: center_coord_y_1}]
flux_g_1 = 10 ** (-dc2_galaxies[2][“mag_true_g_lsst”] / 2.5)
mag_bulge_g_1 = -2.5 * np.log10(dc2_galaxies[2][“bulge_to_total_ratio_i”] * flux_g_1)
mag_disk_g_1 = -2.5 * np.log10((1-dc2_galaxies[2][“bulge_to_total_ratio_i”]) * flux_g_1)
kwargs_lens_light_g_1 = [{‘magnitude’: mag_bulge_g_1,
‘R_sersic’: dc2_galaxies[2][“size_bulge_true”],
‘n_sersic’: 4.0,
‘e1’: e1_bulge,
‘e2’: e2_bulge,
‘center_x’: center_cood_x_1,
‘center_y’: center_coord_y_1},
{‘magnitude’: mag_disk_g_1,
‘R_sersic’: dc2_galaxies[2][“size_disk_true”],
‘n_sersic’: 1.0,
‘e1’: e1_disk,
‘e2’: e2_disk,
‘center_x’: center_cood_x_1,
‘center_y’: center_coord_y_1}]
kwargs_ps_1 = None
Then we generate an image using lens_image() function in slsim: slsim/slsim/image_simulation.py at 68adf909194f9114f0692764f7d4361c5001cc6e · LSST-strong-lensing/slsim · GitHub
Variance map, psf, and zeropoint are used from the deepCoadd cutout image.
Image comparision with the actual position angle:
image comparision with the position angle rotated by 140 degree:
For full tutorial, please see: https://app.reviewnb.com/LSST-strong-lensing/slsim/pull/163/
Thank you!