# Matching Catalogs

**URL:** <https://community.openastronomy.org/t/matching-catalogs/917>\
**Category:** Astropy\
**Tags:** astropy, question\
**Created:** [February 22, 2024, 11:16pm UTC](https://community.openastronomy.org/t/matching-catalogs/917 "2024-02-22T23:16:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![B612](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/b612/32/515_2.png) [@B612](https://community.openastronomy.org/u/B612)\
**Post date:** [February 22, 2024, 11:16pm UTC](https://community.openastronomy.org/t/matching-catalogs/917/1 "2024-02-22T23:16:08Z")

</div>

Hi. I am new in the forum.

I have a star unic identifier/designation in the Gaia catalogue. How can I find, if exits, its corresponding identifier in the Hipparcos catalogue using AstroPy?

For example, for the Gaia identifier designation=“DR3 4345775217221821312”, I would like to get the Hipparcos identifier HIP=79672. These two unique identifiers correspond to the same star, present in both catalogues.

---

<div class="post-metadata">

**Author:** ![dhomeier](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/dhomeier/32/65_2.png) [@dhomeier](https://community.openastronomy.org/u/dhomeier)\
**Post date:** [February 26, 2024, 11:55pm UTC](https://community.openastronomy.org/t/matching-catalogs/917/2 "2024-02-26T23:55:21Z")

</div>

Welcome to Astropy Discourse!

This sounds like a case for astroquery. If a cross-identification exists on Simbad, you could use its [name query](https://astroquery.readthedocs.io/en/latest/simbad/simbad.html#query-to-get-all-names-identifiers-for-an-object) to get all known catalogue IDs:

```python
from astroquery.simbad import Simbad
tab = Simbad.query_objectids('Gaia DR3 4345775217221821312')
print([id for id in tab['ID'] if id.startswith('HIP')])

```

Otherwise you might try a cone search based on the result tables and coordinates you could directly access from Gaia using its [Gaia TAP+ module](https://astroquery.readthedocs.io/en/latest/gaia/gaia.html).

---

<div class="post-metadata">

**Author:** ![B612](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/b612/32/515_2.png) [@B612](https://community.openastronomy.org/u/B612)\
**Post date:** [March 7, 2024, 6:50pm UTC](https://community.openastronomy.org/t/matching-catalogs/917/3 "2024-03-07T18:50:43Z")

</div>

Hi, Derek. Thank you for the answer.  
Could you give me a link where I can better understand how the match is done by the `astroquery` below?

> [@dhomeier](#):
>
> ```auto
> from astroquery.simbad import Simbad
> tab = Simbad.query_objectids('Gaia DR3 4345775217221821312')
> print([id for id in tab['ID'] if id.startswith('HIP')])
> 
> ```

Explaining my curiosity better:  
I know that Hipparcos’ mean epoch is 1991.25 and Gaia’s is 2016.0. The reference/equinox is 2000.0 for both catalogs. My curiosity is how `astropy` matches the coordinates of the catalogues, which have different mean epochs.

---

<div class="post-metadata">

**Author:** ![dhomeier](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/dhomeier/32/65_2.png) [@dhomeier](https://community.openastronomy.org/u/dhomeier)\
**Post date:** [March 7, 2024, 8:07pm UTC](https://community.openastronomy.org/t/matching-catalogs/917/4 "2024-03-07T20:07:12Z")

</div>

Hi, in the above example `astroquery` is not doing any coordinate match itself, as it simply returns the list of identifiers stored for that Gaia source in Simbad (basically what you’d also get by manually opening [Gaia DR3 4345775217221821312](https://simbad.cds.unistra.fr/simbad/sim-id?Ident=Gaia+DR3+4345775217221821312&NbIdent=1)).  
For searches by region as described e.g. on  
[SIMBAD Queries (astroquery.simbad) — astroquery v0.4.6](https://astroquery.readthedocs.io/en/stable/simbad/simbad.html#query-a-region)  
you are passing an astropy `SkyCoord`, which includes the information on equinox and epoch for translating to a different epoch when e.g. using the `SkyCoord.separation` method.  
Coming from the Gaia identifier you could probably also use the cross-match function vs. the Hipparcos catalogue:  
[Gaia TAP+ (astroquery.gaia) — astroquery v0.4.6](https://astroquery.readthedocs.io/en/stable/gaia/gaia.html#cross-match)  
but maybe someone more familiar with astroquery (or studying the docs) could give more advice on that.
