Coder Social home page Coder Social logo

Comments (3)

ManonMarchand avatar ManonMarchand commented on July 23, 2024 1

No worries. Here is a link for ADQL : https://cds.unistra.fr/help/documentation/simbad-more/adql-simbad/ (even if the graph on top is a tiny bit outdated)

And if you're still stuck with adql queries for SIMBAD, the team behind [email protected] will be happy to help.

from astroquery.

ManonMarchand avatar ManonMarchand commented on July 23, 2024

Yes, this should raise an error since you used lower case letters for the flux filters (should be fixed by #2954). The b and v ones don't exist, so you get an empty result the r one is distinct from the R one so you get an error that corresponds to an other filter.

This can be confusing, and I would advise to use a custom TAP query for a better control on the output you get. For your use case, it would look like this:

from astroquery.simbad import Simbad
query = """
SELECT main_id, filter, flux, flux_err, flux.bibcode as flux_bibcode, otype, sp_type
FROM basic
JOIN flux ON oidref = oid
WHERE main_id = 'UCAC4 440-052370'
"""
result = Simbad.query_tap(query)
print(result)
<Table length=10>
    main_id      filter    flux   flux_err     flux_bibcode    otype  sp_type
     object      object  float32  float32         object       object  object
---------------- ------ --------- -------- ------------------- ------ -------
UCAC4 440-052370      i    14.201     0.06 2012yCat.1322....0Z      *        
UCAC4 440-052370      r    14.429     0.02 2012yCat.1322....0Z      *        
UCAC4 440-052370      g    15.131     0.04 2012yCat.1322....0Z      *        
UCAC4 440-052370      V    14.717     0.01 2012yCat.1322....0Z      *        
UCAC4 440-052370      B    15.632     0.01 2012yCat.1322....0Z      *        
UCAC4 440-052370      R    14.604     0.13 2012yCat.1322....0Z      *        
UCAC4 440-052370      G 14.479252  0.00277 2022yCat.1355....0G      *        
UCAC4 440-052370      K      12.5    0.026 2003yCat.2246....0C      *        
UCAC4 440-052370      H    12.574    0.026 2003yCat.2246....0C      *        
UCAC4 440-052370      J    13.068    0.023 2003yCat.2246....0C      *        

Where select allows to chose the columns you want (a list of available columns can be read with Simbad.list_columns()). Since the chosen columns are in the basic and flux tables (see the output of the column list) we have to join them together (you can see how to to the join with Simbad.list_linked_tables("flux") for example).
We selected the object in the last line with WHERE. This prints all the fluxes known in SIMBAD for this star but you could restrict to some filters with AND filter IN ('B', 'V', 'R') at the end of the string.

Note that I also added the reference to the paper in which the flux is measured with an alias "flux_bibcode" here.

Hope it helps

PS: If you want to know more about SIMBAD filters, you can do

>>> Simbad.query_tap("select * from filter")
<Table length=17>
   description    filtername  unit 
      object        object   object
----------------- ---------- ------
      Magnitude U          U    mag
      Magnitude B          B    mag
      Magnitude V          V    mag
      Magnitude R          R    mag
      Magnitude I          I    mag
      Magnitude J          J    mag
      Magnitude H          H    mag
      Magnitude K          K    mag
 Magnitude SDSS u          u    mag
 Magnitude SDSS g          g    mag
 Magnitude SDSS r          r    mag
 Magnitude SDSS i          i    mag
 Magnitude SDSS z          z    mag
 Magnitude Gaia G          G    mag
JWST NIRCam F150W      F150W    mag
JWST NIRCam F200W      F200W    mag
JWST NIRCan F444W      F444W    mag

from astroquery.

FCapomax avatar FCapomax commented on July 23, 2024

(first time using github issue tracker, sorry for the opening-closing):

Thank you, it helped a lot!
It is slightly more complicated to query this way (didn't really now ADQL) but it gives the right results.

from astroquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.