Locate star centroid, align 2 centroids, subtract one image from other

42 views
Skip to first unread message

E M

unread,
Sep 18, 2022, 4:04:43 PMSep 18
to astrometry
Hi, I have a project to do that requires a software tool that can do the tasks described below.  Please tell me if Astrometry.net can do this, and if so, please tell me (in as much detail as possible as I am a new user), exactly how to do it.  

I need to do the following:

1) Input two .fits image files (Image1 and Image2).  Image1 contains Star1 and Image2 contains Star2.  I need to see both images on the screen at the same time.

2) Select Star1 in Image1 and Star2 in Image2 as the two stars I would like to work with.

3) Locate the centroid of Star1 in Image1 to sub-pixel precision.  Locate the centroid of Star2 to sub-pixel precision.

4) Align Star1 in Image1 with Star2 in Image2 by their centroids such that the two centroids line up to sub-pixel precision.

4) Subtract Image1 from Image2, creating a new Image3 that shows the difference between Star1 and Star2.  Any light in common between Star1 and Star2 would be subtracted out.  Only the differences would remain in Image3.

That is it!  Thanks!

Ed

Dustin Lang

unread,
Sep 18, 2022, 5:32:42 PM (13 days ago) Sep 18
to astrometry
Hi,

Are you talking about aligning them in pixel space, or so that they're aligned the right way on the sky?

The core Astrometry.net code doesn't have a GUI, so the whole business of showing things on screen and clicking on them etc is not something the Astrometry.net code will help you with.

The source detection program (image2xy) detects stars to sub-pixel accuracy, so you could steal that part (just search for all stars, and then choose the one closest to the star location clicked).

The aligning part (assuming you're only shifting in image space, ie, a simple x,y shift) can be done via a Lanczos shift, but rather than Astrometry.net you'll probably find it easier to use, eg, scipy's https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.shift.html#scipy.ndimage.shift

cheers,
dustin

E M

unread,
Sep 18, 2022, 5:59:15 PM (13 days ago) Sep 18
to astrometry
Thanks Dustin,  I was under the misimpression that Astrometry.net had a GUI interface.  It would make things much easier for my project.  Are you aware of any commercial software such as Astrometrica, Prism, Pinpoint, etc. that use a GUI interface and could do the list of five steps that I listed in my earlier post to sub-pixel precision?

Bryan

unread,
Sep 18, 2022, 7:10:06 PM (13 days ago) Sep 18
to astrometry
The only GUI that uses the AN engine is Astrotortilla.  However, it is a GUI for input parameter entry, not for image display.

Bryan

E M

unread,
Sep 18, 2022, 7:23:07 PM (13 days ago) Sep 18
to astrometry
Sorry, what is the "AN engine"?

JP

unread,
Sep 18, 2022, 8:14:42 PM (13 days ago) Sep 18
to astrometry

If you use Windows, CCDLAB can do that vey easily for you:

 https://github.com/user29A/CCDLAB/releases

 If you require assistance with usage, feel free to ask.

Regards,

 JP

E M

unread,
Sep 18, 2022, 10:08:59 PM (13 days ago) Sep 18
to astrometry
Yes, that is what I use.  I will take a look at it.  Thanks!

Ed

E M

unread,
Sep 19, 2022, 4:13:14 AM (13 days ago) Sep 19
to astrometry
Hi JP, do you know where I can get some detailed documentation on how CCDLAB works (particularly in terms of the list of five tasks listed above)?  Thanks!

Ed


On Sunday, September 18, 2022 at 5:14:42 PM UTC-7 JP wrote:

Bryan

unread,
Sep 19, 2022, 9:07:19 AM (13 days ago) Sep 19
to astrometry
astrometry.net

On Sunday, September 18, 2022 at 5:23:07 PM UTC-6 edm....@gmail.com wrote:

JP

unread,
Sep 21, 2022, 4:11:00 PM (11 days ago) Sep 21
to astrometry
Hi Ed,

Not sure if the private reply is getting to you, so I will just reply-all here:

 

Unfortunately there is no documentation for the specific procedure, however it is possible if you know what CCDLAB can all do.

 You would load the two files into CCDLAB. You can blink between one and the other image here.

  1. You can either register the images by shifting if they are simply translational offset, or, you can cut-out a region of interest around the star you’re interested in – you would do this for each image, and save the regions separately. Then you would reload them and perform registration just on these smaller images. If you right click on the registration button, then you get an options dialog and you could set the interpolation to Lanczsos, for higher precision. The registration does compute the centroid and will shift the image to sub-pixel precision.
  2. Then save the images again after registration.
  3. Then load ONE image, and use image subtraction to subtract the OTHER image.
  4. Now you have the difference, and you could save that as a new file too.

 I could do this for you really, really quickly if you like – if you supply the images to me and tell me where the star is. I could even give you a demo over a Teams or Zoom call if you like.


Feel free to email me at joepostma @ live dot ca

References are:

https://iopscience.iop.org/article/10.1088/1538-3873/aa8800

https://link.springer.com/article/10.1007/s12036-020-09689-w

 

Cheers,

 

Joe


Reply all
Reply to author
Forward
0 new messages