python - To find the pixel coodinates for a given ra-dec -
i'm new python, , presently working on labeling galaxy images. have set of 512x512 pix^2 images scaled 0.2 arcsec/pix. each 1 of images have 2 objects labeled - 1 @ centre (256pix,256pix) @ other @ offset (i've projected separation between objects ra-dec values both objects). task encircle objects in each of images. easy central objects, i'm stuck on how same thing done other object. following snippet encircling of central object, need figure out how other one:
i have ra-dec values both objects (in degrees).
have separation between objects (in kpc).
for image 512x512 px @ .2 ''/px:
this iterates through objids in list - each objid have file objid.png in folder called images_fin - loads correct image, , labels objid.
for galaxy in range(0, len(objid)):
![enter image description here][1]im=imread('images_fin/'+objid[galaxy]+'.jpeg') imshow(im) a=gca() print a.text(20, 480, "objid:", color ='w', fontsize='10') print a.text(20, 490, "w1-w2:", color ='w', fontsize='10') print a.text(20, 500, "sep1 (in kpc):", color ='w', fontsize='10') print a.text(20, 510, "sep2 (in kpc):", color ='w', fontsize='10') print a.text(52, 480, objid[galaxy], color='w', fontsize='10') print a.text(52, 490, w[galaxy], color='w', fontsize='10') print a.text(78, 500, sep1[galaxy], color='w', fontsize='10') print a.text(78, 510, sep2[galaxy], color='w', fontsize='10') print a.hlines(y=20, xmin=480, xmax=495, linewidth=1, color = 'w') print a.vlines(x=480, ymin=18, ymax=22, linewidth=1, color = 'w') print a.vlines(x=495, ymin=18, ymax=22, linewidth=1, color = 'w') print a.text(485, 18, "3\"", color='w', fontsize='10') a.xaxis.set_visible(false) a.yaxis.set_visible(false) circle=plt.circle((256,256),12,color='w',fill=false) plt.gcf().gca().add_artist(circle)
i'm pasting example how labeling should when done (this done manually)
Comments
Post a Comment