Skip to content

Commit 9e2ab6c

Browse files
authored
Merge pull request #3195 from cds-astro/docs-membership-note-of-cautiousness
fix: turn detailed membership on by default
2 parents 5019431 + feef234 commit 9e2ab6c

File tree

4 files changed

+90
-21
lines changed

4 files changed

+90
-21
lines changed

CHANGES.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
New Tools and Services
55
----------------------
66

7+
API changes
8+
-----------
9+
10+
simbad
11+
^^^^^^
12+
13+
- The detailed hierarchy is now returned by default in ``query_hierarchy``
14+
(it was hidden by default in the previous versions) [#3195]
715

816
Service fixes and enhancements
917
------------------------------
@@ -19,7 +27,6 @@ xmatch
1927
- the API is more flexible: you can now ommit the ``vizier:`` before the catalog name
2028
when crossmatching with a vizier table [#3194]
2129

22-
2330
Infrastructure, Utility and Other Changes and Additions
2431
-------------------------------------------------------
2532

astroquery/simbad/core.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ def query_catalog(self, catalog, *, criteria=None, get_query_payload=False,
868868
get_query_payload=get_query_payload)
869869

870870
def query_hierarchy(self, name, hierarchy, *,
871-
detailed_hierarchy=False,
871+
detailed_hierarchy=True,
872872
criteria=None, get_query_payload=False):
873873
"""Query either the parents or the children of the object.
874874
@@ -906,6 +906,7 @@ def query_hierarchy(self, name, hierarchy, *,
906906
--------
907907
>>> from astroquery.simbad import Simbad
908908
>>> parent = Simbad.query_hierarchy("2MASS J18511048-0615470",
909+
... detailed_hierarchy=False,
909910
... hierarchy="parents") # doctest: +REMOTE_DATA
910911
>>> parent[["main_id", "ra", "dec"]] # doctest: +REMOTE_DATA
911912
<Table length=1>

astroquery/simbad/tests/test_simbad.py

+1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ def test_query_hierarchy():
390390
assert detailed in adql
391391
adql = simbad_instance.query_hierarchy("test", hierarchy="children",
392392
criteria="test=test",
393+
detailed_hierarchy=False,
393394
get_query_payload=True)["QUERY"]
394395
assert "h_link.parent = name.oidref" in adql
395396
assert "test=test" in adql

docs/simbad/simbad.rst

+79-19
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,38 @@ associated with an object.
155155
NAME North Star
156156
WEB 2438
157157

158-
Query to get all parents (or children, or siblings) of an object
159-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158+
Query hierarchy: to get all parents (or children, or siblings) of an object
159+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160+
161+
SIMBAD also records hierarchy links between objects. For example, two galaxies in a pair
162+
of galaxies are siblings, a cluster of stars is composed of stars: its children. This
163+
information can be accessed with the `~astroquery.simbad.SimbadClass.query_hierarchy`
164+
method.
165+
166+
Whenever available, membership probabilities are recorded in SIMBAD as given by
167+
the authors, though rounded to an integer. When authors do not give a value but
168+
assessments, they are translated in SIMBAD as follows:
169+
170+
+-------------------+------------------------+
171+
| assessment | membership certainty |
172+
+===================+========================+
173+
| member | 100 |
174+
+-------------------+------------------------+
175+
| likely member | 75 |
176+
+-------------------+------------------------+
177+
| possible member | 50 |
178+
+-------------------+------------------------+
179+
| likely not member | 25 |
180+
+-------------------+------------------------+
181+
| non member | 0 |
182+
+-------------------+------------------------+
183+
184+
For gravitational lens systems, double stars, and blends (superposition of two
185+
non-physically linked objects), the SIMBAD team does not assign a probability
186+
value (this will be a ``None``).
187+
188+
You can find more details in the `hierarchy documentation
189+
<https://simbad.cds.unistra.fr/guide/dataHierarchy.htx>`_ of SIMBAD's webpages.
160190

161191
Let's find the galaxies composing the galaxy pair ``Mrk 116``:
162192

@@ -165,14 +195,14 @@ Let's find the galaxies composing the galaxy pair ``Mrk 116``:
165195
>>> from astroquery.simbad import Simbad
166196
>>> galaxies = Simbad.query_hierarchy("Mrk 116",
167197
... hierarchy="children", criteria="otype='G..'")
168-
>>> galaxies[["main_id", "ra", "dec"]]
198+
>>> galaxies[["main_id", "ra", "dec", "membership_certainty"]]
169199
<Table length=2>
170-
main_id ra dec
171-
deg deg
172-
object float64 float64
173-
--------- --------------- --------------
174-
Mrk 116A 143.50821525019 55.24105273196
175-
Mrk 116B 143.509956 55.239762
200+
main_id ra dec membership_certainty
201+
deg deg percent
202+
object float64 float64 int16
203+
--------- --------------- -------------- --------------------
204+
Mrk 116A 143.50821525019 55.24105273196 --
205+
Mrk 116B 143.509956 55.239762 --
176206

177207
Alternatively, if we know one member of a group, we can find the others by asking for
178208
``siblings``:
@@ -182,14 +212,14 @@ Alternatively, if we know one member of a group, we can find the others by askin
182212
>>> from astroquery.simbad import Simbad
183213
>>> galaxies = Simbad.query_hierarchy("Mrk 116A",
184214
... hierarchy="siblings", criteria="otype='G..'")
185-
>>> galaxies[["main_id", "ra", "dec"]]
215+
>>> galaxies[["main_id", "ra", "dec", "membership_certainty"]]
186216
<Table length=2>
187-
main_id ra dec
188-
deg deg
189-
object float64 float64
190-
--------- --------------- --------------
191-
Mrk 116A 143.50821525019 55.24105273196
192-
Mrk 116B 143.509956 55.239762
217+
main_id ra dec membership_certainty
218+
deg deg percent
219+
object float64 float64 int16
220+
--------- --------------- -------------- --------------------
221+
Mrk 116A 143.50821525019 55.24105273196 --
222+
Mrk 116B 143.509956 55.239762 --
193223

194224
Note that if we had not added the criteria on the object type, we would also get
195225
some stars that are part of these galaxies in the result.
@@ -200,7 +230,8 @@ And the other way around, let's find which cluster of stars contains
200230
.. doctest-remote-data::
201231

202232
>>> from astroquery.simbad import Simbad
203-
>>> cluster = Simbad.query_hierarchy("2MASS J18511048-0615470", hierarchy="parents")
233+
>>> cluster = Simbad.query_hierarchy("2MASS J18511048-0615470",
234+
... hierarchy="parents", detailed_hierarchy=False)
204235
>>> cluster[["main_id", "ra", "dec"]]
205236
<Table length=1>
206237
main_id ra dec
@@ -209,7 +240,7 @@ And the other way around, let's find which cluster of stars contains
209240
--------- ------- -------
210241
NGC 6705 282.766 -6.272
211242

212-
If needed, we can get a more detailed report with the two extra columns:
243+
By default, we get a more detailed report with the two extra columns:
213244
- ``hierarchy_bibcode`` : the paper in which the hierarchy is established,
214245
- ``membership_certainty``: if present in the paper, a certainty index (100 meaning
215246
100% sure).
@@ -240,11 +271,40 @@ If needed, we can get a more detailed report with the two extra columns:
240271
NGC 6705 282.766 -6.272 2021MNRAS.503.3279S 99
241272
NGC 6705 282.766 -6.272 2022MNRAS.509.1664J 100
242273

243-
Here, we see that the Simbad team found 13 papers mentioning the fact that
274+
Here, we see that the SIMBAD team found 13 papers mentioning the fact that
244275
``2MASS J18511048-0615470`` is a member of ``NGC 6705`` and that the authors of these
245276
articles gave high confidence indices for this membership (``membership_certainty`` is
246277
close to 100 for all bibcodes).
247278

279+
A note of caution on hierarchy
280+
""""""""""""""""""""""""""""""
281+
282+
In some tricky cases, low membership values represent extremely important information.
283+
Let's for example look at the star ``V* V787 Cep``:
284+
285+
.. doctest-remote-data::
286+
287+
>>> from astroquery.simbad import Simbad
288+
>>> parents = Simbad.query_hierarchy("V* V787 Cep",
289+
... hierarchy="parents",
290+
... detailed_hierarchy=True)
291+
>>> parents[["main_id", "ra", "dec", "hierarchy_bibcode", "membership_certainty"]]
292+
<Table length=4>
293+
main_id ra dec hierarchy_bibcode membership_certainty
294+
deg deg percent
295+
object float64 float64 object int16
296+
--------- ------------------ ------- ------------------- --------------------
297+
NGC 188 11.797999999999998 85.244 2003AJ....126.2922P 46
298+
NGC 188 11.797999999999998 85.244 2004PASP..116.1012S 46
299+
NGC 188 11.797999999999998 85.244 2018A&A...616A..10G 100
300+
NGC 188 11.797999999999998 85.244 2021MNRAS.503.3279S 1
301+
302+
Here, we see that the link between ``V* V787 Cep`` and the open cluster ``NGC 188`` is
303+
opened for debate: the only way to build an opinion is to read the four articles.
304+
This information would be hidden if we did not print the detailed hierarchy report.
305+
306+
These somewhat contradictory results are an inherent part of SIMBAD, which simply
307+
translates the literature into a database.
248308

249309
Query a region
250310
^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)