According to Vizier, the _Cntr_ parameter in the 2MASS Catalog, for the star 2MASS J02592142+0018056, is 1139104663, as can be seen here.
If I want to search this value from python using astroquery I would assume that this code would suffice:
from astroquery.vizier import Vizier
id = 'J02592142+0018056'
t = Vizier(columns = ['_MASS', 'Cntr']).query_object(id, catalog = ['II/246/out'])[0]
print(t[t['_2MASS'] == id[1:]]['Cntr'][0])
But the result is the number 32767 and not 1139104663 as intended.
Why is so? Am I doing this wrong?
Are you certain this Cntr number is meant to be consistent between versions of the catalog and is not something internal?
cc @gilleslandais , maybe others from CDS?
This Cntr number is the unique source identifier in the 2MASS catalogue. I think it has to be somewhere in the Vizier query I did but even enableing all columns I'm unable to find any number that matches with that value.
The issue is that the Cntr column is dtyped as int16, and is overflow. So this is definitely a bug.
In [5]: t[0]
Out[5]:
<Table length=8>
_2MASS Cntr
str17 int16
---------------- -----
02592140+0016463 32767
02592897+0018293 32767
02591560+0017008 32767
02592142+0018056 32767
02591745+0019303 32767
02592221+0018580 32767
02592252+0019041 32767
02592226+0019525 32767
Thanks @Titanosaurus for reporting!
I'm happy that this was indeed something worth pointing out. Thank you for your work as always.
One last question: is there a way to overcome this issue now? Any advice or idea as to how I should proceed until this is fixed?
I haven't got the time to look into the details, and could be surprised if there is an easier workaround than fixing the parsing itself.
If you would like to dig into the code, a PR would be welcome!
It looks like the this is an upstream issue. The returned votable has the following specification for the Cntr column, which explains dtype=int16.
<FIELD name="Cntr" ucd="meta.id;meta.table" datatype="short" width="10"><!-- ucd="ID_NUMBER" -->
<DESCRIPTION>(pts_key) Unique source identifier in catalogue</DESCRIPTION>
</FIELD>
@gilleslandais Could you please check on your side that datatype="int" is needed instead in the returned votable?
Hi...
it is a problem specific to the 2MASS catalogue.
It has been fixed now.
Regards
Gilles Landais (CDS)
Le 17/04/2020 à 10:24, Julien Woillez a écrit :
>
It looks like the this is an upstream issue. The returned votable has
the following specification for the |Cntr| column, which explains
|dtype=int16|.|
width="10"> (pts_key) Unique |
source identifier in catalogue@gilleslandais https://github.com/gilleslandais Could you please
check on your side that |datatype="int"| is needed instead in the
returned votable?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/astropy/astroquery/issues/1682#issuecomment-615114570,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADBEEBKVQIXGADVRFHACKSTRNAG4TANCNFSM4LOWJRSA.
@Titanosaurus Fixed confirmed for
from astroquery.vizier import Vizier
id = 'J02592142+0018056'
t = Vizier(columns = ['2MASS', 'Cntr']).query_object(id, catalog = ['II/246/out'])[0]
print(t[t['_2MASS'] == id[1:]]['Cntr'][0])
@gilleslandais Thank you!
@bsipocz @keflavich We can close the issue.
Most helpful comment
Hi...
it is a problem specific to the 2MASS catalogue.
It has been fixed now.
Regards
Gilles Landais (CDS)
Le 17/04/2020 à 10:24, Julien Woillez a écrit :
>