Reputation: 1
I have been trying to figure out a way to change point sources/stars into NaNs, with each star covering a different amount of pixels. I have 9 of these images (dithered) that all needs to go through this process (also, I can't use cv2). I have the x and y pixel coordinates of each star, generated by Source Extractor.
I tried turning all pixels above a certain value in NaNs, which didn't work since the background sometimes exceeded the value of dim stars in other regions. This is my code, where dse is the Source Extractor output for each image:
# get the x and y pixel coordinates of each source extractor output
xcoord = []
ycoord=[]
E=[]
for k in dse:
x = k['X_IMAGE']
y = k['Y_IMAGE']
e = k['FWHM_IMAGE']
xcoord.append(x)
ycoord.append(y)
E.append(e)
# plot each source detected by SExtractor and check them manually
n = 0
plt.imshow(dcals[n], cmap = 'gray', vmin=0, vmax=255)
plt.plot(xcoord[n], ycoord[n], ".", markersize=1)
plt.show()
# adjust each markersize to fit the size of each star
msize=[]
for i in range(8):
markersize = (E[i]/0.608)*2
msize.append(markersize)
# check each image manually
i=0
plt.imshow(dcals[i], cmap = 'gray', vmin=0, vmax=255)
plt.scatter(xcoord[i], ycoord[i], s=msize[i], c = 'blue', marker = '.')
plt.show()
Upvotes: 0
Views: 43