Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'SCRIPT_NUMBER_ID' column disappeared in Simbad.query_region() after v0.4.8 update #3209

Open
vsquicciarini opened this issue Feb 12, 2025 · 2 comments
Labels

Comments

@vsquicciarini
Copy link

vsquicciarini commented Feb 12, 2025

Hello there,
it appears that the v0.4.8 of astroquery deleted the column 'SCRIPT_NUMBER_ID' when using the function Simbad.query_region(). The column, introduced here (#2047) was crucial to connect the unequivocally inputs and outputs of a query, by assigning each row a number corresponding to the i-th input region.

Apparently the column was renamed as 'object_number_id' in Simbad.query_objects() (#2954). However, no such column exists for Simbad.query_region().

Would it be possible to restore this column (even with a different name)?

Thank you in advance for your the consideration. :)

@vsquicciarini vsquicciarini changed the title 'SCRIPT_NUMBER_ID' column disappeared in Simbad.query_region() after v0.48 update 'SCRIPT_NUMBER_ID' column disappeared in Simbad.query_region() after v0.4.8 update Feb 12, 2025
@keflavich
Copy link
Contributor

keflavich commented Feb 12, 2025

@ManonMarchand I expect you'll have something to say on this?

(@vsquicciarini you should expect to wait ~a week to hear back on this at least, as the relevant folks are on holiday right now)

@ManonMarchand
Copy link
Member

ManonMarchand commented Feb 13, 2025

Indeed, there is now a single script even with multiple radii.

The behaviour could be mimicked just as in query_objects. What would be sensible, keep the historical name script_number_id or something closer to reality like center_number or center_number_id?

Edit: Might not be possible actually, cannot use an upload like in query_objects. Thinking about how to make it work, but a workaround is to cross match the output with the entry. Something using astropy's search_around_sky maybe. In that case, that'd be a documentation tip to explain how to interpret the results of query region:

from astropy.coordinates import SkyCoord
from astropy.table import Table, hstack
import astropy.units as u
from astroquery.simbad import Simbad
# let's do a query for two centers
simbad = Simbad()
centers = Table({"ra": [0, 1], "dec": [0, 1], "cone_number": [0, 1]})
coo_centers = SkyCoord(centers["ra"], centers["dec"], unit="deg")
regions = simbad.query_region(coo_centers, radius="0.1d")
coo_result = SkyCoord(regions["ra"], regions["dec"], unit="deg")
# here, we do the cross match
idx1, idx2, _, _ = coo_centers.search_around_sky(coo_result, 0.1*u.deg)
hstack([regions[idx1], centers[["cone_number"]][idx2]])
<Table length=51>
          main_id                     ra         ... cone_number
                                     deg         ...
           object                  float64       ...    int32
---------------------------- ------------------- ... -----------
                    PB  5669       0.04984129467 ...           0
              QSO B2357-003A     359.99988315297 ...           0
    SDSS J000351.87+010511.4            0.966156 ...           1
    SDSS J000421.84+005743.6       1.09105216744 ...           1
            SDSS-II SN 14480 0.01745833333333333 ...           0
Gaia DR3 2738341959609844992  0.9648817681758335 ...           1
            UCAC4 450-138351  359.91676860000007 ...           0
                    Z 382-15       0.03259767004 ...           0
    SDSS J000342.95+010109.2  0.9290047483600001 ...           1
                         ...                 ... ...         ...
     2MASX J00034546+0102404  0.9394874682400001 ...           1
               SDSSCGB 49921  1.0616666666666668 ...           1
            IRAS F23572-0021   359.9485833333334 ...           0
            SDSS-II SN 15730  359.92387916666667 ...           0
    SDSS J235951.01+000453.9  359.96257883642255 ...           0
Gaia DR2 2738345636100534016  0.9106980628416665 ...           1
  [LVO2003] J000355.2+005519  0.9800000000000001 ...           1
            UCAC4 455-000077  0.9549125032562502 ...           1
            UCAC4 455-000082  1.0003119072266666 ...           1
               MCG+00-01-014       0.01849340605 ...           0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants