{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"[Open this tutorial in Google Colab](https://colab.research.google.com/github/konkolyseismolab/seismolab/blob/master/docs/source/query_gaia.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Query Gaia catalog\n",
"\n",
"The *Gaia* module combines Gaia data with the Bailer-Jones distance catalog, galactic extinction maps and magnitudes from the Simbad catalog. Simply passing the Gaia ID of one or more targets, the code automatically queries\n",
"\n",
"- the Gaia parallax,\n",
"- the Gaia G, BP and RP brightness,\n",
"- the Johnson B, V and 2MASS JHK brightness,\n",
"\n",
"and delivers\n",
"\n",
"- the extinction corrected apparent brightness,\n",
"- the extinction corrected absolute brightness,\n",
"- extinction values in each band,\n",
"\n",
"with the associated upper and lower errorbars.\n",
"\n",
"__Note:__\n",
"Both Gaia DR2 and DR3 catalogs can be used. However, there is a subtle difference between them. In case of DR3, the distance are queried from the [Bailer-Jones catalog](https://ui.adsabs.harvard.edu/abs/2021AJ....161..147B/abstract). If DR2 is used, the distances are estimated from the Gaia parallaxes in a probabilistic way as defined by [Bailer-Jones+ (2018, AJ, 156, 58)](https://ui.adsabs.harvard.edu/abs/2018AJ....156...58B/abstract)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## __How to use__"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from seismolab.gaia import query_gaia"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"After importing the relevant module, we can pass a list of __Gaia DR3 IDs__ to perform the query and all the calculations."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using Combined19 map from mwdust\n",
"Querying Gaia DR3 and BJ catalogs...\n",
"Downloading Simbad data for all stars...\n",
"Calculating distances, absolute magnitudes...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a67b9316fac64b3aa52983bf8caa02ea",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/2 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"targets = [1022096392749670016,3107142829863485952]\n",
"\n",
"result_table = query_gaia(targets)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The result is an Astropy Table."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
Table length=2\n",
"
\n",
"| Source | ra | dec | parallax | sig_parallax | Gmag | sig_Gmag | BPmag | sig_BPmag | RPmag | sig_RPmag | Bmag | sig_Bmag | Vmag | sig_Vmag | Jmag | sig_Jmag | Hmag | sig_Hmag | Kmag | sig_Kmag | dist | distep | distem | lon_deg | lat_deg | aG | aGep | aGem | MG | MGep | MGem | mG | mGep | mGem | aBP | aBPep | aBPem | MBP | MBPep | MBPem | mBP | mBPep | mBPem | aRP | aRPep | aRPem | MRP | MRPep | MRPem | mRP | mRPep | mRPem | aB | aBep | aBem | MB | MBep | MBem | mB | mBep | mBem | aV | aVep | aVem | MV | MVep | MVem | mV | mVep | mVem | aJ | aJep | aJem | MJ | MJep | MJem | mJ | mJep | mJem | aH | aHep | aHem | MH | MHep | MHem | mH | mHep | mHem | aK | aKep | aKem | MK | MKep | MKem | mK | mKep | mKem |
\n",
" | deg | deg | mas | mas | mag | | mag | | mag | | mag | | mag | | mag | | mag | | mag | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
"| str21 | float64 | float64 | float64 | float32 | float32 | float64 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 |
\n",
"| 1022096392749670016 | 145.93959651092428 | 55.952388737534136 | 19.266700572347492 | 0.01887033 | 7.7452164 | 0.007181938969436053 | 8.088248 | 0.024051615865364074 | 7.2756886 | 0.02388009262163658 | 8.54 | -99.000 | 7.75 | -99.000 | 6.573 | 0.029 | 6.223 | 0.034 | 6.184 | 0.017 | 51.831443786621094 | 0.0460662841796875 | 0.050594329833984375 | 158.92257837077454 | 45.90248575416284 | 0.0 | 0.0 | 0.0 | 4.172249913215637 | 0.00930267223054404 | 0.009111341320815036 | 7.745216369628906 | 0.007181938969435642 | 0.007181938969435642 | 0.0 | 0.0 | 0.0 | 4.515281796455383 | 0.026172349126472483 | 0.02598101821674348 | 8.088248252868652 | 0.024051615865364084 | 0.024051615865364084 | 0.0 | 0.0 | 0.0 | 3.702722191810608 | 0.026000825882745104 | 0.0258094949730161 | 7.275688648223877 | 0.023880092621636706 | 0.023880092621636706 | 0.0 | 0.0 | 0.0 | 4.967033505439758 | 0.022120733261107972 | 0.021929402351378968 | 8.539999961853027 | 0.019999999999999574 | 0.019999999999999574 | 0.0 | 0.0 | 0.0 | 4.177033543586731 | 0.022120733261107972 | 0.021929402351378968 | 7.75 | 0.019999999999999574 | 0.019999999999999574 | 0.0 | 0.0 | 0.0 | 3.0000334978103638 | 0.03112053871154785 | 0.030929207801818848 | 6.572999954223633 | 0.028999805450439453 | 0.028999805450439453 | 0.0 | 0.0 | 0.0 | 2.6500335931777954 | 0.03612065315246582 | 0.035929322242736816 | 6.2230000495910645 | 0.03399991989135742 | 0.03399991989135742 | 0.0 | 0.0 | 0.0 | 2.61103355884552 | 0.01912093162536621 | 0.018929600715637207 | 6.184000015258789 | 0.017000198364257812 | 0.017000198364257812 |
\n",
"| 3107142829863485952 | 101.76822041702867 | -1.2075151625364267 | 0.432227248321794 | 0.030997224 | 12.621653 | 0.0006344411880043353 | 12.802992 | 0.0020885144822050884 | 12.291391 | 0.0017593474516210648 | 13.01 | 0.020 | 12.72 | 0.020 | 11.903 | 0.023 | 11.838 | 0.023 | 11.8 | 0.024 | 2190.859619140625 | 197.47900390625 | 151.5408935546875 | 213.5092718420073 | -1.5216790901099373 | 1.0972506348348021 | 0.2813463101744822 | 0.01746006095976571 | -0.17867081801656326 | 0.17374130314264136 | 0.46938729127948164 | 11.524401968314612 | 0.018094502147770086 | 0.2819807513624877 | 1.3107321146267983 | 0.3360851498919084 | 0.020857096725901858 | -0.21081303389254558 | 0.1785924122029794 | 0.5255802042911046 | 11.492259752438631 | 0.022945611208106342 | 0.33817366437411245 | 0.7576583159506094 | 0.19427135861061418 | 0.012056279543791626 | -0.16933972960112342 | 0.1694624279902861 | 0.383437245979227 | 11.533733056730055 | 0.013815626995413055 | 0.1960307060622366 | 1.5085403078773538 | 0.3868051982805827 | 0.024004730459570967 | -0.20161286532669465 | 0.19965198921811478 | 0.5942121959612479 | 11.501459921004482 | 0.04400518822324351 | 0.4068056560442539 | 1.1924453025900386 | 0.305755198782921 | 0.01897485133607879 | -0.17551782189240583 | 0.19462211009462393 | 0.5131621964635862 | 11.527554964438771 | 0.03897530909974911 | 0.325755656546594 | 0.3091529886603355 | 0.07926999527513978 | 0.0049194139028371775 | -0.10922589706182606 | 0.1835659783864827 | 0.2896762986808987 | 11.593846889269352 | 0.027919177391606098 | 0.10226975876391009 | 0.18290999329090118 | 0.04689999720454216 | 0.00291056530898276 | -0.047982482075692445 | 0.18155712979262617 | 0.2573063006103027 | 11.655090304255486 | 0.025910328797751347 | 0.06989976069331227 | 0.11801399567127227 | 0.030259998196363436 | 0.001877904184431095 | -0.021086591267586385 | 0.1815248730259853 | 0.2416667059600357 | 11.68198619506359 | 0.025878072031112254 | 0.054260166043041735 |
\n",
"
"
],
"text/plain": [
"\n",
" Source ra ... mKem \n",
" deg ... \n",
" str21 float64 ... float64 \n",
"------------------- ------------------ ... --------------------\n",
"1022096392749670016 145.93959651092428 ... 0.017000198364257812\n",
"3107142829863485952 101.76822041702867 ... 0.054260166043041735"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result_table"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The columns are named according to the followings:\n",
"\n",
"- __Source:__ Gaia DR3 (or DR2) ID \n",
"- __ra, dec:__ equatorial coordinates in deg\n",
"- __parallax, sig_parallax:__ parallax and its error in mas\n",
"- __\\mag:__ observed magnitude in given filter\n",
"- __sig_\\mag:__ observed magnitude error in given filter\n",
"- __dist:__ distance in pc\n",
"- __distep:__ upper distance errorbar in pc\n",
"- __distem:__ lower distance errorbar in pc\n",
"- __lon_deg, lat_deg:__ galactic coordinates in deg\n",
"- __a\\:__ extinction in given filter\n",
"- __a\\ep:__ upper extinction errorbar in given filter\n",
"- __a\\em:__ lower extinction errorbar in given filter\n",
"- __M\\:__ extinction corrected absolute magnitude in given filter\n",
"- __M\\ep:__ upper absolute magnitude errorbar in given filter\n",
"- __M\\em:__ lower absolute magnitude errorbar in given filter\n",
"- __m\\:__ extinction corrected apparent magnitude in given filter\n",
"- __m\\ep:__ upper apparent magnitude errorbar in given filter\n",
"- __m\\em:__ lower apparent magnitude errorbar in given filter"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Using photodistances\n",
"\n",
"The [Bailer-Jones catalog](https://ui.adsabs.harvard.edu/abs/2021AJ....161..147B/abstract) contains two kinds of distances. By default, the geometric ones are returned, but there is an option to use the __photodistances__ instead."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using Combined19 map from mwdust\n",
"Querying Gaia DR3 and BJ catalogs...\n",
"Downloading Simbad data for all stars...\n",
"Calculating distances, absolute magnitudes...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2a2dff7707f1479db603ac94bdff4806",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/2 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"result_table = query_gaia(targets,use_photodist=True)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Table length=2\n",
"
\n",
"| Source | ra | dec | parallax | sig_parallax | Gmag | sig_Gmag | BPmag | sig_BPmag | RPmag | sig_RPmag | Bmag | sig_Bmag | Vmag | sig_Vmag | Jmag | sig_Jmag | Hmag | sig_Hmag | Kmag | sig_Kmag | dist | distep | distem | lon_deg | lat_deg | aG | aGep | aGem | MG | MGep | MGem | mG | mGep | mGem | aBP | aBPep | aBPem | MBP | MBPep | MBPem | mBP | mBPep | mBPem | aRP | aRPep | aRPem | MRP | MRPep | MRPem | mRP | mRPep | mRPem | aB | aBep | aBem | MB | MBep | MBem | mB | mBep | mBem | aV | aVep | aVem | MV | MVep | MVem | mV | mVep | mVem | aJ | aJep | aJem | MJ | MJep | MJem | mJ | mJep | mJem | aH | aHep | aHem | MH | MHep | MHem | mH | mHep | mHem | aK | aKep | aKem | MK | MKep | MKem | mK | mKep | mKem |
\n",
" | deg | deg | mas | mas | mag | | mag | | mag | | mag | | mag | | mag | | mag | | mag | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
"| str21 | float64 | float64 | float64 | float32 | float32 | float64 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 |
\n",
"| 1022096392749670016 | 145.93959651092428 | 55.952388737534136 | 19.266700572347492 | 0.01887033 | 7.7452164 | 0.007181938969436053 | 8.088248 | 0.024051615865364074 | 7.2756886 | 0.02388009262163658 | 8.54 | -99.000 | 7.75 | -99.000 | 6.573 | 0.029 | 6.223 | 0.034 | 6.184 | 0.017 | 51.826133728027344 | 0.040660858154296875 | 0.044971466064453125 | 158.92257837077454 | 45.90248575416284 | 0.0 | 0.0 | 0.0 | 4.172472238540649 | 0.009067233883681247 | 0.008884843670668552 | 7.745216369628906 | 0.007181938969435642 | 0.007181938969435642 | 0.0 | 0.0 | 0.0 | 4.5155041217803955 | 0.02593691077960969 | 0.025754520566596995 | 8.088248252868652 | 0.024051615865364084 | 0.024051615865364084 | 0.0 | 0.0 | 0.0 | 3.70294451713562 | 0.02576538753588231 | 0.025582997322869616 | 7.275688648223877 | 0.023880092621636706 | 0.023880092621636706 | 0.0 | 0.0 | 0.0 | 4.9672558307647705 | 0.02188529491424518 | 0.021702904701232484 | 8.539999961853027 | 0.019999999999999574 | 0.019999999999999574 | 0.0 | 0.0 | 0.0 | 4.177255868911743 | 0.02188529491424518 | 0.021702904701232484 | 7.75 | 0.019999999999999574 | 0.019999999999999574 | 0.0 | 0.0 | 0.0 | 3.000255823135376 | 0.03088510036468506 | 0.030702710151672363 | 6.572999954223633 | 0.028999805450439453 | 0.028999805450439453 | 0.0 | 0.0 | 0.0 | 2.6502559185028076 | 0.03588521480560303 | 0.03570282459259033 | 6.2230000495910645 | 0.03399991989135742 | 0.03399991989135742 | 0.0 | 0.0 | 0.0 | 2.6112558841705322 | 0.018885493278503418 | 0.018703103065490723 | 6.184000015258789 | 0.017000198364257812 | 0.017000198364257812 |
\n",
"| 3107142829863485952 | 101.76822041702867 | -1.2075151625364267 | 0.432227248321794 | 0.030997224 | 12.621653 | 0.0006344411880043353 | 12.802992 | 0.0020885144822050884 | 12.291391 | 0.0017593474516210648 | 13.01 | 0.020 | 12.72 | 0.020 | 11.903 | 0.023 | 11.838 | 0.023 | 11.8 | 0.024 | 2193.359375 | 145.941162109375 | 138.426025390625 | 213.5092718420073 | -1.5216790901099373 | 1.0972506348348021 | 0.2147918691552715 | 0.01373223426890191 | -0.181146794960533 | 0.15592651470556262 | 0.3553076827950612 | 11.524401968314612 | 0.014366675456907174 | 0.2154263103432772 | 1.3107321146267983 | 0.25658185279147117 | 0.01640398272773691 | -0.2132890108365153 | 0.16005233645859995 | 0.3985517397254572 | 11.492259752438631 | 0.018492497209942726 | 0.25867036727367676 | 0.7576583159506094 | 0.14831510750373622 | 0.009482192272307954 | -0.17181570654509315 | 0.15280137897258683 | 0.28995582740713743 | 11.533733056730055 | 0.01124153972392783 | 0.15007445495535698 | 1.5085403078773538 | 0.2953037183467466 | 0.018879577968958783 | -0.20408884227066437 | 0.180439874981289 | 0.45518554856220206 | 11.501459921004482 | 0.03888003573262999 | 0.31530417611041806 | 1.1924453025900386 | 0.23342666413430613 | 0.014923607905210634 | -0.17799379883637556 | 0.1764839049175393 | 0.39330849434976045 | 11.527554964438771 | 0.034924065668882065 | 0.2534271218979782 | 0.3091529886603355 | 0.06051812246095384 | 0.0038690898236336535 | -0.11170187400579579 | 0.1684286925610614 | 0.22339925840150343 | 11.593846889269352 | 0.026868853312402408 | 0.08351788594972298 | 0.18290999329090118 | 0.03580547424522185 | 0.002289142332892874 | -0.05045845901966217 | 0.16684874507032177 | 0.19868661018577072 | 11.655090304255486 | 0.02528890582166099 | 0.058805237733992044 | 0.11801399567127227 | 0.02310178359617085 | 0.0014769604902630795 | -0.023562568211556112 | 0.16703696758560227 | 0.18698332389463346 | 11.68198619506359 | 0.025477128336943267 | 0.047101951442849455 |
\n",
"
"
],
"text/plain": [
"\n",
" Source ra ... mKem \n",
" deg ... \n",
" str21 float64 ... float64 \n",
"------------------- ------------------ ... --------------------\n",
"1022096392749670016 145.93959651092428 ... 0.017000198364257812\n",
"3107142829863485952 101.76822041702867 ... 0.047101951442849455"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result_table"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Querying DR2 catalog\n",
"\n",
"If DR2 catalog is queried, then __Gaia DR2 IDs__ must be passed."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using Combined19 map from mwdust\n",
"Querying Gaia DR2 catalog...\n",
"Downloading Simbad data for all stars...\n",
"Calculating distances, absolute magnitudes...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1763b9a8622948ebb4f0d45a53e83ae9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/2 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"result_table_dr2 = query_gaia(targets,gaiaDR=2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The result is an Astropy Table with distance probabilistically estimated from parallaxes."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Table length=2\n",
"
\n",
"| Source | ra | dec | parallax | sig_parallax | Gmag | sig_Gmag | BPmag | sig_BPmag | RPmag | sig_RPmag | Bmag | sig_Bmag | Vmag | sig_Vmag | Jmag | sig_Jmag | Hmag | sig_Hmag | Kmag | sig_Kmag | dist | distep | distem | lon_deg | lat_deg | aG | aGep | aGem | MG | MGep | MGem | mG | mGep | mGem | aBP | aBPep | aBPem | MBP | MBPep | MBPem | mBP | mBPep | mBPem | aRP | aRPep | aRPem | MRP | MRPep | MRPem | mRP | mRPep | mRPem | aB | aBep | aBem | MB | MBep | MBem | mB | mBep | mBem | aV | aVep | aVem | MV | MVep | MVem | mV | mVep | mVem | aJ | aJep | aJem | MJ | MJep | MJem | mJ | mJep | mJem | aH | aHep | aHem | MH | MHep | MHem | mH | mHep | mHem | aK | aKep | aKem | MK | MKep | MKem | mK | mKep | mKem |
\n",
" | deg | deg | mas | mas | mag | | mag | | mag | | mag | | mag | | mag | | mag | | mag | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
"| str21 | float64 | float64 | float64 | float64 | float32 | float64 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 |
\n",
"| 1022096392749670016 | 145.93959226288555 | 55.95239269960827 | 19.277532306604552 | 0.03343194611367065 | 7.7937016 | 0.012570032498626791 | 8.1552515 | 0.038804118205489575 | 7.367436 | 0.03560460850334358 | 8.54 | -99.000 | 7.75 | -99.000 | 6.573 | 0.029 | 6.223 | 0.034 | 6.184 | 0.017 | 51.87414874148742 | 0.0891440914409074 | 0.08908409084090607 | 158.9225742720827 | 45.902482118266626 | 0.0 | 0.0 | 0.0 | 4.2188973476900475 | 0.013046969776703499 | 0.013010926166682424 | 7.793674517138414 | 0.012492582713060862 | 0.012492948098652867 | 0.0 | 0.0 | 0.0 | 4.580228054832856 | 0.03885830393406131 | 0.03852396343961306 | 8.155167746899021 | 0.038565028081066544 | 0.03856615603882929 | 0.0 | 0.0 | 0.0 | 3.79242611742484 | 0.035703094077422115 | 0.035385582689146045 | 7.367359081995247 | 0.03538523203840338 | 0.03538626699284464 | 0.0 | 0.0 | 0.0 | 4.965118069467221 | 0.020282138388814985 | 0.02018711115041416 | 8.539956793191774 | 0.019876770747291772 | 0.019877352107114277 | 0.0 | 0.0 | 0.0 | 4.175118107614193 | 0.020282138388814985 | 0.02018711115041416 | 7.749956831338746 | 0.01987677074729266 | 0.01987735210711339 | 0.0 | 0.0 | 0.0 | 2.998025292249327 | 0.0291551561762855 | 0.028906115384708997 | 6.572937359666616 | 0.028821316754251036 | 0.02882215972596658 | 0.0 | 0.0 | 0.0 | 2.648006946167431 | 0.03411431133917109 | 0.03382855899612647 | 6.222926662862945 | 0.033790512106756765 | 0.03379150041850654 | 0.0 | 0.0 | 0.0 | 2.609154383087451 | 0.017350237770220378 | 0.017266900610069413 | 6.18396332189473 | 0.016895256053377494 | 0.016895750209253713 |
\n",
"| 3107142829863485952 | 101.76822078135328 | -1.207515192087555 | 0.2784408581785764 | 0.07150647466161306 | 12.631575 | 0.0009382113738554969 | 12.801229 | 0.0038396854144956893 | 12.298964 | 0.002020975902707495 | 13.01 | 0.020 | 12.72 | 0.020 | 11.903 | 0.023 | 11.838 | 0.023 | 11.8 | 0.024 | 3832.632796327963 | 1205.1134011340114 | 781.2820460204603 | 213.50927203436055 | -1.521678779347881 | 1.7696987325866222 | 0.4122728676707361 | 0.2407382729227452 | -2.0556418277891266 | 0.7348429400105714 | 1.005430029894729 | 10.861819577586186 | 0.2396506499506046 | 0.4117372038317537 | 2.1140119571358085 | 0.49248482569953156 | 0.2875763982466415 | -2.2304442769199397 | 0.7812866080966312 | 1.0848303808647772 | 10.687120093832506 | 0.28631905727537976 | 0.49173506812071466 | 1.221987865765398 | 0.2846769522977459 | 0.1662312589821069 | -1.8407000304353147 | 0.660724716880748 | 0.8775676772207697 | 11.07694807645693 | 0.16551958658712707 | 0.28428683795836207 | 2.4330465493950886 | 0.5668078185428684 | 0.3309757833108171 | -2.341223028975283 | 0.8260060572224985 | 1.1580442280453713 | 10.57684229168457 | 0.3304529423714726 | 0.5664240439997599 | 1.923233282968368 | 0.44804061062430733 | 0.2616241117450673 | -2.1210607288462935 | 0.7566343652693712 | 1.0398941209468324 | 10.796809821669349 | 0.2612950590289671 | 0.4473505455900977 | 0.4986168472711183 | 0.11615886574826562 | 0.06782858373119044 | -1.5138191409378114 | 0.5639251848339407 | 0.7078604952534233 | 11.404163447704212 | 0.07020757389433818 | 0.11018300235435596 | 0.2950060569826599 | 0.0687252529783482 | 0.04013069984852824 | -1.3751904042616552 | 0.5365573045018889 | 0.6604500211164646 | 11.541188201068914 | 0.0460037103824984 | 0.06204263123418663 | 0.19033866277815115 | 0.044341709064495 | 0.025892430222099444 | -1.3084410644785818 | 0.5224782172061465 | 0.636526800950777 | 11.607118544052254 | 0.03606880692052172 | 0.04095751794617364 |
\n",
"
"
],
"text/plain": [
"\n",
" Source ra ... mKem \n",
" deg ... \n",
" str21 float64 ... float64 \n",
"------------------- ------------------ ... --------------------\n",
"1022096392749670016 145.93959226288555 ... 0.016895750209253713\n",
"3107142829863485952 101.76822078135328 ... 0.04095751794617364"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result_table_dr2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Extinction correction\n",
"\n",
"The extinction correction is done using the [mwdust](https://github.com/jobovy/mwdust) galactic dust maps. Given the coordinates and the distance of a target, `mwdust` returns the $E(B-V)$ color excess. From this, the $A_{\\lambda}$ extinction coefficient can be calculated using the extinction vector $R_{\\lambda}$:\n",
"$$ A_{\\lambda} = R_{\\lambda} \\times E(B-V) ,$$\n",
"where $\\lambda$ denotes the passband.\n",
"\n",
"The values of the extinction vector are from [Green+ (2019)](https://ui.adsabs.harvard.edu/abs/2019ApJ...887...93G/abstract), whose results are based on [Schlafly+ (2016)](https://ui.adsabs.harvard.edu/abs/2016ApJ...821...78S/abstract). Since not all filters are available, [Huber+ (2017)](https://ui.adsabs.harvard.edu/abs/2017ApJ...844..102H/abstract) interpolated [Cardelli+ (1989)](https://ui.adsabs.harvard.edu/abs/1989ApJ...345..245C/abstract) extinction law to get extinction in e.g., the Gaia passbands, too.\n",
"\n",
"| Passband | $R_{\\lambda}$ |\n",
"| --- | --- |\n",
"| Johnson-Cousins B | 3.8681 |\n",
"| Johnson-Cousins V | 3.0576 |\n",
"| Tycho B$_{\\rm T}$ | 3.9958 |\n",
"| Tycho V$_{\\rm T}$ | 3.1870 |\n",
"| SDSS u | 4.5890 |\n",
"| SDSS g | 3.6134 |\n",
"| SDSS r | 2.6198 |\n",
"| SDSS i | 1.9872 |\n",
"| SDSS z | 1.4617 |\n",
"| 2MASS J | 0.7927 |\n",
"| 2MASS H | 0.4690 |\n",
"| 2MASS K | 0.3026 |\n",
"| Gaia G | 2.8135 |\n",
"| Gaia BP | 3.3609 |\n",
"| Gaia RP | 1.9427 |"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Selecting the dust map\n",
"\n",
"There are several dust maps implemented in `mwdust` (see [here](https://github.com/jobovy/mwdust?tab=readme-ov-file#dust-data)). By default the _Combined19_ map is used, however any other available map can also be selected. E.g. changing the map to Green19 can be done by passing the name of the map to `dustmodel`.\n",
"\n",
"__Note:__ the desired dust map _might_ be downloaded beforehand.\n",
"\n",
"__Note:__ if the distance of the star is too large and the color excess falls outside the reliable range of the given dust map, no warning is given!"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using Green19 map from mwdust\n",
"Querying Gaia DR3 and BJ catalogs...\n",
"Downloading Simbad data for all stars...\n",
"Calculating distances, absolute magnitudes...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c7d609ea273d4eb1bcbd1922ec61d7ad",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/2 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"result_table = query_gaia(targets,dustmodel='Green19')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Table length=2\n",
"
\n",
"| Source | ra | dec | parallax | sig_parallax | Gmag | sig_Gmag | BPmag | sig_BPmag | RPmag | sig_RPmag | Bmag | sig_Bmag | Vmag | sig_Vmag | Jmag | sig_Jmag | Hmag | sig_Hmag | Kmag | sig_Kmag | dist | distep | distem | lon_deg | lat_deg | aG | aGep | aGem | MG | MGep | MGem | mG | mGep | mGem | aBP | aBPep | aBPem | MBP | MBPep | MBPem | mBP | mBPep | mBPem | aRP | aRPep | aRPem | MRP | MRPep | MRPem | mRP | mRPep | mRPem | aB | aBep | aBem | MB | MBep | MBem | mB | mBep | mBem | aV | aVep | aVem | MV | MVep | MVem | mV | mVep | mVem | aJ | aJep | aJem | MJ | MJep | MJem | mJ | mJep | mJem | aH | aHep | aHem | MH | MHep | MHem | mH | mHep | mHem | aK | aKep | aKem | MK | MKep | MKem | mK | mKep | mKem |
\n",
" | deg | deg | mas | mas | mag | | mag | | mag | | mag | | mag | | mag | | mag | | mag | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
"| str21 | float64 | float64 | float64 | float32 | float32 | float64 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 |
\n",
"| 1022096392749670016 | 145.93959651092428 | 55.952388737534136 | 19.266700572347492 | 0.01887033 | 7.7452164 | 0.007181938969436053 | 8.088248 | 0.024051615865364074 | 7.2756886 | 0.02388009262163658 | 8.54 | -99.000 | 7.75 | -99.000 | 6.573 | 0.029 | 6.223 | 0.034 | 6.184 | 0.017 | 51.831443786621094 | 0.0460662841796875 | 0.050594329833984375 | 158.92257837077454 | 45.90248575416284 | 0.0 | 0.0 | 0.0 | 4.172249913215637 | 0.00930267223054404 | 0.009111341320815036 | 7.745216369628906 | 0.007181938969435642 | 0.007181938969435642 | 0.0 | 0.0 | 0.0 | 4.515281796455383 | 0.026172349126472483 | 0.02598101821674348 | 8.088248252868652 | 0.024051615865364084 | 0.024051615865364084 | 0.0 | 0.0 | 0.0 | 3.702722191810608 | 0.026000825882745104 | 0.0258094949730161 | 7.275688648223877 | 0.023880092621636706 | 0.023880092621636706 | 0.0 | 0.0 | 0.0 | 4.967033505439758 | 0.022120733261107972 | 0.021929402351378968 | 8.539999961853027 | 0.019999999999999574 | 0.019999999999999574 | 0.0 | 0.0 | 0.0 | 4.177033543586731 | 0.022120733261107972 | 0.021929402351378968 | 7.75 | 0.019999999999999574 | 0.019999999999999574 | 0.0 | 0.0 | 0.0 | 3.0000334978103638 | 0.03112053871154785 | 0.030929207801818848 | 6.572999954223633 | 0.028999805450439453 | 0.028999805450439453 | 0.0 | 0.0 | 0.0 | 2.6500335931777954 | 0.03612065315246582 | 0.035929322242736816 | 6.2230000495910645 | 0.03399991989135742 | 0.03399991989135742 | 0.0 | 0.0 | 0.0 | 2.61103355884552 | 0.01912093162536621 | 0.018929600715637207 | 6.184000015258789 | 0.017000198364257812 | 0.017000198364257812 |
\n",
"| 3107142829863485952 | 101.76822041702867 | -1.2075151625364267 | 0.432227248321794 | 0.030997224 | 12.621653 | 0.0006344411880043353 | 12.802992 | 0.0020885144822050884 | 12.291391 | 0.0017593474516210648 | 13.01 | 0.020 | 12.72 | 0.020 | 11.903 | 0.023 | 11.838 | 0.023 | 11.8 | 0.024 | 2190.859619140625 | 197.47900390625 | 151.5408935546875 | 213.5092718420073 | -1.5216790901099373 | 1.0972506348348021 | 0.2813463101744822 | 0.01746006095976571 | -0.17867081801656326 | 0.17374130314264136 | 0.46938729127948164 | 11.524401968314612 | 0.018094502147770086 | 0.2819807513624877 | 1.3107321146267983 | 0.3360851498919084 | 0.020857096725901858 | -0.21081303389254558 | 0.1785924122029794 | 0.5255802042911046 | 11.492259752438631 | 0.022945611208106342 | 0.33817366437411245 | 0.7576583159506094 | 0.19427135861061418 | 0.012056279543791626 | -0.16933972960112342 | 0.1694624279902861 | 0.383437245979227 | 11.533733056730055 | 0.013815626995413055 | 0.1960307060622366 | 1.5085403078773538 | 0.3868051982805827 | 0.024004730459570967 | -0.20161286532669465 | 0.19965198921811478 | 0.5942121959612479 | 11.501459921004482 | 0.04400518822324351 | 0.4068056560442539 | 1.1924453025900386 | 0.305755198782921 | 0.01897485133607879 | -0.17551782189240583 | 0.19462211009462393 | 0.5131621964635862 | 11.527554964438771 | 0.03897530909974911 | 0.325755656546594 | 0.3091529886603355 | 0.07926999527513978 | 0.0049194139028371775 | -0.10922589706182606 | 0.1835659783864827 | 0.2896762986808987 | 11.593846889269352 | 0.027919177391606098 | 0.10226975876391009 | 0.18290999329090118 | 0.04689999720454216 | 0.00291056530898276 | -0.047982482075692445 | 0.18155712979262617 | 0.2573063006103027 | 11.655090304255486 | 0.025910328797751347 | 0.06989976069331227 | 0.11801399567127227 | 0.030259998196363436 | 0.001877904184431095 | -0.021086591267586385 | 0.1815248730259853 | 0.2416667059600357 | 11.68198619506359 | 0.025878072031112254 | 0.054260166043041735 |
\n",
"
"
],
"text/plain": [
"\n",
" Source ra ... mKem \n",
" deg ... \n",
" str21 float64 ... float64 \n",
"------------------- ------------------ ... --------------------\n",
"1022096392749670016 145.93959651092428 ... 0.017000198364257812\n",
"3107142829863485952 101.76822041702867 ... 0.054260166043041735"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result_table"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Setting the parallax offset in Gaia DR2\n",
"\n",
"A parallax offset can be given if the Gaia DR2 catalog is used. There are four predefined options, which can be selected:\n",
"\n",
"- __Stassun__ : +0.08 mas (Stassun et al. 2018)\n",
"- __Riess__ : +0.046 mas (Riess et al. 2018)\n",
"- __BJ__ : +0.029 mas (Bailer-Jones et al. 2018)\n",
"- __Zinn__ : +0.0528 mas (Zinn et al 2019)\n",
" \n",
"or simply an offset in _mas_ can be passed."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using Combined19 map from mwdust\n",
"Querying Gaia DR2 catalog...\n",
"Downloading Simbad data for all stars...\n",
"Calculating distances, absolute magnitudes...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1b1eac67dbdb4975bc3a6d7f18fd81e0",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/2 [00:00, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"result_table = query_gaia(targets,gaiaDR=2,plx_offset='Stassun')"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Table length=2\n",
"
\n",
"| Source | ra | dec | parallax | sig_parallax | Gmag | sig_Gmag | BPmag | sig_BPmag | RPmag | sig_RPmag | Bmag | sig_Bmag | Vmag | sig_Vmag | Jmag | sig_Jmag | Hmag | sig_Hmag | Kmag | sig_Kmag | dist | distep | distem | lon_deg | lat_deg | aG | aGep | aGem | MG | MGep | MGem | mG | mGep | mGem | aBP | aBPep | aBPem | MBP | MBPep | MBPem | mBP | mBPep | mBPem | aRP | aRPep | aRPem | MRP | MRPep | MRPem | mRP | mRPep | mRPem | aB | aBep | aBem | MB | MBep | MBem | mB | mBep | mBem | aV | aVep | aVem | MV | MVep | MVem | mV | mVep | mVem | aJ | aJep | aJem | MJ | MJep | MJem | mJ | mJep | mJem | aH | aHep | aHem | MH | MHep | MHem | mH | mHep | mHem | aK | aKep | aKem | MK | MKep | MKem | mK | mKep | mKem |
\n",
" | deg | deg | mas | mas | mag | | mag | | mag | | mag | | mag | | mag | | mag | | mag | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
"| str21 | float64 | float64 | float64 | float64 | float32 | float64 | float32 | float64 | float32 | float64 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 |
\n",
"| 1022096392749670016 | 145.93959226288555 | 55.95239269960827 | 19.277532306604552 | 0.03343194611367065 | 7.7937016 | 0.012570032498626791 | 8.1552515 | 0.038804118205489575 | 7.367436 | 0.03560460850334358 | 8.54 | -99.000 | 7.75 | -99.000 | 6.573 | 0.029 | 6.223 | 0.034 | 6.184 | 0.017 | 51.65976659766598 | 0.08840408404083888 | 0.08836088360883565 | 158.9225742720827 | 45.902482118266626 | 0.0 | 0.0 | 0.0 | 4.227894182210269 | 0.013030806596175282 | 0.013012296249788946 | 7.793674517138414 | 0.012492582713060862 | 0.012492948098652867 | 0.0 | 0.0 | 0.0 | 4.589225743008126 | 0.03885348450892767 | 0.038518885345538934 | 8.155167746899021 | 0.038565028081066544 | 0.03856615603882929 | 0.0 | 0.0 | 0.0 | 3.8014235319409115 | 0.0356994466157885 | 0.035379920733777936 | 7.367359081995247 | 0.03538523203840338 | 0.03538626699284464 | 0.0 | 0.0 | 0.0 | 4.974106774584016 | 0.020284509688115904 | 0.02017683465475084 | 8.539956793191774 | 0.019876770747291772 | 0.019877352107114277 | 0.0 | 0.0 | 0.0 | 4.184106812730989 | 0.020284509688115904 | 0.020176834654749953 | 7.749956831338746 | 0.01987677074729266 | 0.01987735210711339 | 0.0 | 0.0 | 0.0 | 3.0070175491396705 | 0.029152333025087795 | 0.028905708755822435 | 6.572937359666616 | 0.028821316754251036 | 0.02882215972596658 | 0.0 | 0.0 | 0.0 | 2.657003097080757 | 0.03411146917043251 | 0.033822337191342644 | 6.222926662862945 | 0.033790512106756765 | 0.03379150041850654 | 0.0 | 0.0 | 0.0 | 2.618143657011534 | 0.017349068044365534 | 0.017264308333109213 | 6.18396332189473 | 0.016895256053377494 | 0.016895750209253713 |
\n",
"| 3107142829863485952 | 101.76822078135328 | -1.207515192087555 | 0.2784408581785764 | 0.07150647466161306 | 12.631575 | 0.0009382113738554969 | 12.801229 | 0.0038396854144956893 | 12.298964 | 0.002020975902707495 | 13.01 | 0.020 | 12.72 | 0.020 | 11.903 | 0.023 | 11.838 | 0.023 | 11.8 | 0.024 | 3002.1165711657113 | 774.5859362593628 | 522.2633730337302 | 213.50927203436055 | -1.521678779347881 | 1.5100084833778324 | 0.25507143021589407 | 0.12459642264064508 | -1.2656104946923428 | 0.5395534174390507 | 0.7529658084015112 | 11.121501819021775 | 0.12454852596685662 | 0.2545465746165796 | 1.8037962792522915 | 0.3046982197992494 | 0.1488379476283419 | -1.3899511901198425 | 0.5640108325645211 | 0.8018706177346147 | 10.997197477331621 | 0.14910453299335913 | 0.30397998389938685 | 1.0426701505252982 | 0.17612839230080168 | 0.08603459661301027 | -1.1310405663542102 | 0.501124140111731 | 0.6737948142508945 | 11.256183914643884 | 0.08614492686314534 | 0.1756999121809386 | 2.0760148958630262 | 0.3506815322340038 | 0.17129971931985621 | -1.4539404226702475 | 0.5876219169390448 | 0.846843200061425 | 10.933519197228057 | 0.1787145637530454 | 0.3499675195094909 | 1.6410129697907134 | 0.2772007772241196 | 0.13540609062370623 | -1.3088457606127673 | 0.5518162109318188 | 0.7734214697422517 | 11.078628340896056 | 0.14390704523226105 | 0.27653484999551914 | 0.4254484989284154 | 0.07186698505303862 | 0.03510533984930536 | -0.9102087710381221 | 0.4520845836516781 | 0.569190509840144 | 11.474485679809568 | 0.051401608033915025 | 0.0713974068981944 | 0.2517160918347759 | 0.04252001512536285 | 0.02077003202891914 | -0.801418271485054 | 0.43770573970390164 | 0.540009223337885 | 11.582862594722375 | 0.03807573774171402 | 0.04519717967328418 | 0.1624078665014993 | 0.027434022552099785 | 0.01340087780799773 | -0.7499423187758572 | 0.4302515050169671 | 0.5254692066140176 | 11.634510862371974 | 0.03170678733197008 | 0.03456370625147187 |
\n",
"
"
],
"text/plain": [
"\n",
" Source ra ... mKem \n",
" deg ... \n",
" str21 float64 ... float64 \n",
"------------------- ------------------ ... --------------------\n",
"1022096392749670016 145.93959226288555 ... 0.016895750209253713\n",
"3107142829863485952 101.76822078135328 ... 0.03456370625147187"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result_table"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "seismolab",
"language": "python",
"name": "seismolab"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 4
}