How to match stars from .axy file to tycho Astrometry's tycho2-cut.fits?

87 views
Skip to first unread message

andreas....@gmail.com

unread,
Aug 5, 2023, 12:39:03 PM8/5/23
to astrometry
Hi,

what is an elegant way to match the stars from the .axy file to the stars to the tycho2-cut.fits file?

Currently I check like this:
with the x and y pixel values from the .axy file I convert the position to ra/dec with the .wcs file of the same image.
This ra/dec I run through the full tycho2-cut.fits file and use the star with the closest distance to my .axy star.

This is very and unneccesary computing time consuming.
How could I improve this? Is there a way to get the index position in tycho2-cut.fits so I can directly go there and extract the data I need from these stars?

Maybe it is very easy and I just don't think about it yet :). But it would really boost my code, so please tell me how you would do that.

Best regards,

Andreas

Dustin Lang

unread,
Aug 5, 2023, 9:35:27 PM8/5/23
to andreas....@gmail.com, astrometry
Hi,

Well, the .corr file lists the stars we think matched between your image (axy) and the reference catalog...  if you use the 4100-series index files, those come from Tycho-2 (http://data.astrometry.net/4100/).  If you include the solve-field --tag-all flag, it will carry additional columns of data from the index files to the corr files (eg, for Tycho-2 I think it's just mags).

If you want to just speed up the process you're doing, you could create a "kd-tree" file from the tycho2-cut.fits file --
startree -o tycho2-cut.kd.fits -i tycho2-cut.fits
and then, after you convert the x,y to RA,Dec via WCS (which you can do in a batch via the "wcs-xy2rd" program), you can use
query-starkd -T -R <radius> -r <RA> -d <DEC> tycho2-cut.kd.fits
for a search radius "radius" (in degrees).

(Or you could do one query-starkd call at the center of the image and with the image radius, (and write to a RA,Dec list with the "-o rd.fits" flag) and that will give you all the stars near your image, then you can do the process you described with just the stars that are nearby.)

cheers,
dustin


--
You received this message because you are subscribed to the Google Groups "astrometry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astrometry+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astrometry/fc14ed48-5260-424d-8e8f-616ed3ab05c9n%40googlegroups.com.

Andreas Hornig

unread,
Aug 12, 2023, 1:55:53 AM8/12/23
to Dustin Lang, astrometry
Hi Dustin,

On Sun, Aug 6, 2023 at 3:35 AM Dustin Lang <dstn...@gmail.com> wrote:
Hi,

Well, the .corr file lists the stars we think matched between your image (axy) and the reference catalog...  if you use the 4100-series index files, those come from Tycho-2 (http://data.astrometry.net/4100/).  If you include the solve-field --tag-all flag, it will carry additional columns of data from the index files to the corr files (eg, for Tycho-2 I think it's just mags).

Yes, that I already do. You told me this a while ago here on the list. That was a great feature. So far I matched the stars from your different outputs to the tycho catalogue (I use 4100). But having stars until as low as magnitude 8.5 are quite some stars and it takes long to match them classically. So I asked for a quicker way :). 
 

If you want to just speed up the process you're doing, you could create a "kd-tree" file from the tycho2-cut.fits file --
startree -o tycho2-cut.kd.fits -i tycho2-cut.fits
and then, after you convert the x,y to RA,Dec via WCS (which you can do in a batch via the "wcs-xy2rd" program), you can use
query-starkd -T -R <radius> -r <RA> -d <DEC> tycho2-cut.kd.fits
for a search radius "radius" (in degrees).

I only knew kdtrees by name so far, so that was a good kicker to try to implement it myself :). I need to have this search for my python script on windows. I made my own function for it and it's really fast now :D. What was 2 minutes before is now 2 seconds. I think there are still a few situations when the star coordinates I am looking for cannot be found by the way kdtree searches for them (or how I understand it and implemented it :D) but with another condition like maximum distance to the found star it is still fast and delivers even more results.
Thank you, that was a good idea :)
 

(Or you could do one query-starkd call at the center of the image and with the image radius, (and write to a RA,Dec list with the "-o rd.fits" flag) and that will give you all the stars near your image, then you can do the process you described with just the stars that are nearby.)

I will think about how I could use it. My new kdtree graph has "all" the tycho stars in it up to 9.5 and the file I store is still okay (60mb) and it's fast to walk through. This function is now not the "slowest" in my programme anymore :D. 

Maybe adding the index positions of the original database for the 4100 indexes into the astrometry outputs would make it even faster.
 

cheers,
dustin

Thank you, this really helped. 

Andreas
Reply all
Reply to author
Forward
0 new messages