Converting the cube coordinates to arcsecond

21 views
Skip to first unread message

Avijit Mandal

unread,
Sep 7, 2024, 10:01:40 AM9/7/24
to pyCloudy
Hello Everyone,
I am trying to generate Hbeta image using PyCloudy. When I plot the generated image, it is in cube dimension defined by dim_list as given below:
dim = 202
n_cut = int((dim-1) /2)
proj_axis=1
angles = [90,45,0]
m3d = pc.C3D(list_of_models=list_model,dims=dim_list,angles=angle_list,plan_sym=True)
plt.imshow(m3d.get_emis(emis_label).sum(axis = proj_axis)*m3d.cub_coord.cell_size,cmap='gray')
My question is , is it possible to plot the image in arc-second coordinate? If yes, how?
Any help would be greatly appreciated.
Thanks & Regards,
Avijit 

Christophe Morisset

unread,
Sep 7, 2024, 10:30:01 PM9/7/24
to pyCloudy
Hi Avijit,
Your question is more on the use of matplotlib than pyCloudy. You can change the axes ticks once you image is shown, here is an example where I set the x axis between -10 and 10, and the y axis between 50 and 60.:

d2 = m3d.get_emis(emis_label).sum(axis = proj_axis)*m3d.cub_coord.cell_size

f, ax = plt.subplots()

ax.imshow(d2, origin='lower')

x_ticks = np.linspace(0,d2.shape[1]-1,5)

y_ticks = np.linspace(0,d2.shape[0]-1,5)

x_ticklabels = ["{:6.2f}".format(i) for i in np.linspace(-10,10,5)]

y_ticklabels = ["{:6.2f}".format(i) for i in np.linspace(50,60,5)]

ax.set_xticks(x_ticks)

ax.set_xticklabels(x_ticklabels)

ax.set_yticks(y_ticks)

ax.set_yticklabels(y_ticklabels)

Hope it helps,

Ch.

Reply all
Reply to author
Forward
0 new messages