{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", " \n", " \n", " \n", " \n", "
\n", "
\n", "

nb3. Query objects by proposal id or bibliography code

\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "The relevant columns in the ALMA TAP service are \n", "* *proposal_id*\n", "* *obs_publisher_did* \n", "* *bib_reference*\n", "* *member_ous_uid*\n", "--------- ----- -----\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We first import the required modules, and link to the TAP service." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:39.740498Z", "iopub.status.busy": "2021-11-16T10:26:39.739513Z", "iopub.status.idle": "2021-11-16T10:26:40.666782Z", "shell.execute_reply": "2021-11-16T10:26:40.665788Z" } }, "outputs": [], "source": [ "import numpy as np\n", "import pyvo\n", "import pandas as pd\n", "pd.set_option('display.max_columns', None)\n", "\n", "service = pyvo.dal.TAPService(\"https://almascience.eso.org/tap\") # for the EU ALMA TAP service\n", "\n", "# service = pyvo.dal.TAPService(\"https://almascience.nao.ac.jp/tap\") # for the EA ALMA TAP service\n", "# service = pyvo.dal.TAPService(\"https://almascience.nrao.edu/tap\") # for the NA ALMA TAP service" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "## Query a proposal ID\n", "\n", "
\n", "\n", "This function queries ALMA proposal IDs, also called project codes.\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:40.675200Z", "iopub.status.busy": "2021-11-16T10:26:40.674575Z", "iopub.status.idle": "2021-11-16T10:26:40.677518Z", "shell.execute_reply": "2021-11-16T10:26:40.676528Z" } }, "outputs": [], "source": [ "def query_proposal_id(service, proposal_id):\n", " \"\"\"Queries for an ALMA project code\n", " \n", " service pyvo TAPService instance\n", " proposal_id ALMA proposal id in the form \"2012.1.00123.S\" or in the form \"ADS/JAO.ALMA#2012.1.00123.S\"\n", " \n", " returns pandas table\n", " \"\"\"\n", "\n", " query = f\"\"\" \n", " SELECT * \n", " FROM ivoa.obscore \n", " WHERE obs_publisher_did like '%{proposal_id}%' \n", " \"\"\" \n", " \n", " return service.search(query).to_table().to_pandas()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "\n", "## Query a bibliography code\n", "\n", "
\n", "\n", "This function queries (part of) BibCodes as given out by [NASA ADS](https://ui.adsabs.harvard.edu).\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:40.684191Z", "iopub.status.busy": "2021-11-16T10:26:40.683418Z", "iopub.status.idle": "2021-11-16T10:26:40.686748Z", "shell.execute_reply": "2021-11-16T10:26:40.686054Z" } }, "outputs": [], "source": [ "def query_bib_reference(service, bibcode):\n", " \"\"\"Queries for ALMA observations that have been used in a particular observation\n", " \n", " service pyvo TAPService instance\n", " bibcode BibCode in the NASA ADS format, e.g. \"2017ApJ...834..140R. \"\"\n", " Also supports part of the BibCode, e.g. \"Natur\"\n", " \n", " returns pandas table\n", " \"\"\"\n", " \n", " query = f\"\"\" \n", " SELECT * \n", " FROM ivoa.obscore \n", " WHERE bib_reference like '%{bibcode}%' \n", " \"\"\"\n", "\n", " return service.search(query).to_table().to_pandas()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "\n", "## Query a Member OUS ID\n", "
\n", "\n", "This function queries Member Observation Unit Set (OUS) IDs. Member OUS correspond to an independent dataset." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:40.692578Z", "iopub.status.busy": "2021-11-16T10:26:40.691821Z", "iopub.status.idle": "2021-11-16T10:26:40.694953Z", "shell.execute_reply": "2021-11-16T10:26:40.694265Z" } }, "outputs": [], "source": [ "def query_member_ous(service, member_ous_id):\n", " \"\"\"Queries for an ALMA Member OUS dataset\n", " \n", " service pyvo TAPService instance\n", " member_ous_id ALMA Member OUS dataset ID in the form \"uid://A001/X123/X456\" \n", " or in the form \"uid___A001_X123_X456\"\n", " \n", " returns pandas table\n", " \"\"\" \n", " \n", " query = f\"\"\" \n", " SELECT * \n", " FROM ivoa.obscore \n", " WHERE member_ous_uid = '{member_ous_id.replace(\"___\",\"://\").replace(\"_\",\"/\")}' \n", " \"\"\"\n", " \n", " return service.search(query).to_table().to_pandas()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "## Query a publication ID and a specific source\n", "
\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:40.701453Z", "iopub.status.busy": "2021-11-16T10:26:40.700588Z", "iopub.status.idle": "2021-11-16T10:26:40.704207Z", "shell.execute_reply": "2021-11-16T10:26:40.703209Z" } }, "outputs": [], "source": [ "def query_proposal_id_and_alma_source_name(service, proposal_id, source_name):\n", " \"\"\"queries for a an ALMA project code and also for an ALMA source name\n", " \n", " service pyvo TAPService instance\n", " proposal_id ALMA proposal id in the form \"2012.1.00123.S\" or \n", " in the form \"ADS/JAO.ALMA#2012.1.00123.S\"\n", " source_name ALMA source name as given by the PI in the proposal \n", " \n", " returns pandas table\n", " \"\"\" \n", " \n", " query = f\"\"\" \n", " SELECT * \n", " FROM ivoa.obscore \n", " WHERE obs_publisher_did like '%{proposal_id}%' \n", " AND target_name like '%{source_name}%' \n", " \"\"\"\n", " \n", " return service.search(query).to_table().to_pandas()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "------------------------\n", "\n", "## Example 3a: List all observations carried on under a proposal ID" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:40.710844Z", "iopub.status.busy": "2021-11-16T10:26:40.710067Z", "iopub.status.idle": "2021-11-16T10:26:41.031593Z", "shell.execute_reply": "2021-11-16T10:26:41.030411Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
access_urlaccess_formatproposal_iddata_rightsgal_longitudegal_latitudeobs_publisher_didobs_collectionfacility_nameinstrument_nameobs_iddataproduct_typecalib_leveltarget_names_ras_decs_fovs_regions_resolutiont_mint_maxt_exptimet_resolutionem_minem_maxem_res_powerpol_stateso_ucdband_listem_resolutionauthorspub_abstractpublication_yearproposal_abstractschedblock_nameproposal_authorssensitivity_10kmscont_sensitivity_bandwidthpwvgroup_ous_uidmember_ous_uidasdm_uidobs_titletypescan_intentscience_observationspatial_scale_maxbandwidthantenna_arraysis_mosaicobs_release_datespatial_resolutionfrequency_supportfrequencyvelocity_resolutionobs_creator_namepub_titlefirst_authorqa2_passedbib_referencescience_keywordscientific_categorylastModified
0http://almascience.org/aq?member_ous_id=uid://...text/html2016.1.01308.SPublic77.437948-38.582458ADS/JAO.ALMA#2016.1.01308.SALMAJAOALMAuid://A001/X879/X314cube2J2232+1143338.15170411.7308070.015766Polygon ICRS 338.151704 11.722924 338.150195 1...0.57686957699.01986857895.462736907.20907.200.0030580.003118100396.011062/XX/YY/phot.flux.density;phys.polarization3307.023917Banerji, Manda; Jones, Gareth C.; Carniani, St...We present an unprecedented view of the morpho...2018Newly discovered hyper-luminous, dusty broad-l...ULASJ231_a_03_TM1Jones, Gareth; Wethers, Clare; Hewett, Paul; M...1.3901840.0294571.78126uid://A001/X879/X313uid://A001/X879/X314uid://A002/Xba460f/X1d9Do Hyper-Luminous Dusty Quasars at z=2.5 Live ...SBANDPASS FLUX WVRF6.9461701.875000e+09A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D...F2018-08-12T19:08:02.0000.576869[95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,...102.5918952706.661386Banerji, MandaJet-driven Galaxy-scale Gas Outflows in the Hy...Banerji, Manda Husemann, BerndT2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN...High-z Active Galactic Nuclei (AGN)Active galaxies2021-09-30T16:34:41.133
1http://almascience.org/aq?member_ous_id=uid://...text/html2016.1.01308.SPublic77.437948-38.582458ADS/JAO.ALMA#2016.1.01308.SALMAJAOALMAuid://A001/X879/X314cube2J2232+1143338.15170411.7308070.015766Polygon ICRS 338.151704 11.722924 338.150195 1...0.57686957699.01986857895.462736907.20907.200.0030900.00315099372.311222/XX/YY/phot.flux.density;phys.polarization3307.023917Banerji, Manda; Jones, Gareth C.; Carniani, St...We present an unprecedented view of the morpho...2018Newly discovered hyper-luminous, dusty broad-l...ULASJ231_a_03_TM1Jones, Gareth; Wethers, Clare; Hewett, Paul; M...1.5090010.0294571.78126uid://A001/X879/X313uid://A001/X879/X314uid://A002/Xba460f/X1d9Do Hyper-Luminous Dusty Quasars at z=2.5 Live ...SBANDPASS FLUX WVRF6.9461701.875000e+09A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D...F2018-08-12T19:08:02.0000.576869[95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,...102.5918952706.661386Banerji, MandaJet-driven Galaxy-scale Gas Outflows in the Hy...Banerji, Manda Husemann, BerndT2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN...High-z Active Galactic Nuclei (AGN)Active galaxies2021-09-30T16:34:41.133
2http://almascience.org/aq?member_ous_id=uid://...text/html2016.1.01308.SPublic77.437948-38.582458ADS/JAO.ALMA#2016.1.01308.SALMAJAOALMAuid://A001/X879/X314cube2J2232+1143338.15170411.7308070.015766Polygon ICRS 338.151704 11.722924 338.150195 1...0.57686957699.01986857895.462736907.20907.200.0027250.002772110760.976427/XX/YY/phot.flux.density;phys.polarization3307.023917Banerji, Manda; Jones, Gareth C.; Carniani, St...We present an unprecedented view of the morpho...2018Newly discovered hyper-luminous, dusty broad-l...ULASJ231_a_03_TM1Jones, Gareth; Wethers, Clare; Hewett, Paul; M...1.3150950.0294571.78126uid://A001/X879/X313uid://A001/X879/X314uid://A002/Xba460f/X1d9Do Hyper-Luminous Dusty Quasars at z=2.5 Live ...SBANDPASS FLUX WVRF6.9461701.875000e+09A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D...F2018-08-12T19:08:02.0000.576869[95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,...102.5918952706.661386Banerji, MandaJet-driven Galaxy-scale Gas Outflows in the Hy...Banerji, Manda Husemann, BerndT2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN...High-z Active Galactic Nuclei (AGN)Active galaxies2021-09-30T16:34:41.133
3http://almascience.org/aq?member_ous_id=uid://...text/html2016.1.01308.SPublic77.437948-38.582458ADS/JAO.ALMA#2016.1.01308.SALMAJAOALMAuid://A001/X879/X314cube2J2232+1143338.15170411.7308070.015766Polygon ICRS 338.151704 11.722924 338.150195 1...0.57686957699.01986857895.462736907.20907.200.0027500.002798109737.271411/XX/YY/phot.flux.density;phys.polarization3307.023917Banerji, Manda; Jones, Gareth C.; Carniani, St...We present an unprecedented view of the morpho...2018Newly discovered hyper-luminous, dusty broad-l...ULASJ231_a_03_TM1Jones, Gareth; Wethers, Clare; Hewett, Paul; M...1.3208470.0294571.78126uid://A001/X879/X313uid://A001/X879/X314uid://A002/Xba460f/X1d9Do Hyper-Luminous Dusty Quasars at z=2.5 Live ...SBANDPASS FLUX WVRF6.9461701.875000e+09A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D...F2018-08-12T19:08:02.0000.576869[95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,...102.5918952706.661386Banerji, MandaJet-driven Galaxy-scale Gas Outflows in the Hy...Banerji, Manda Husemann, BerndT2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN...High-z Active Galactic Nuclei (AGN)Active galaxies2021-09-30T16:34:41.133
4http://almascience.org/aq?member_ous_id=uid://...text/html2016.1.01308.SPublic80.570801-53.100330ADS/JAO.ALMA#2016.1.01308.SALMAJAOALMAuid://A001/X879/X314cube2ULASJ2315+0143348.9843001.7306940.015766Polygon ICRS 348.984300 1.738577 348.985778 1....0.57686157699.01986857895.4860875866.565866.560.0027500.002798109737.271411/XX/YY/phot.flux.density;phys.polarization3307.019722Banerji, Manda; Jones, Gareth C.; Carniani, St...We present an unprecedented view of the morpho...2018Newly discovered hyper-luminous, dusty broad-l...ULASJ231_a_03_TM1Jones, Gareth; Wethers, Clare; Hewett, Paul; M...0.4862190.0108371.78126uid://A001/X879/X313uid://A001/X879/X314uid://A002/Xba460f/X1d9Do Hyper-Luminous Dusty Quasars at z=2.5 Live ...STARGETT6.9460751.875000e+09A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D...F2018-08-12T19:08:02.0000.576861[95.16..97.03GHz,976.56kHz,554uJy/beam@10km/s,...102.5933702706.661386Banerji, MandaJet-driven Galaxy-scale Gas Outflows in the Hy...Banerji, Manda Husemann, BerndT2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN...High-z Active Galactic Nuclei (AGN)Active galaxies2021-09-30T16:34:41.133
\n", "
" ], "text/plain": [ " access_url access_format \\\n", "0 http://almascience.org/aq?member_ous_id=uid://... text/html \n", "1 http://almascience.org/aq?member_ous_id=uid://... text/html \n", "2 http://almascience.org/aq?member_ous_id=uid://... text/html \n", "3 http://almascience.org/aq?member_ous_id=uid://... text/html \n", "4 http://almascience.org/aq?member_ous_id=uid://... text/html \n", "\n", " proposal_id data_rights gal_longitude gal_latitude \\\n", "0 2016.1.01308.S Public 77.437948 -38.582458 \n", "1 2016.1.01308.S Public 77.437948 -38.582458 \n", "2 2016.1.01308.S Public 77.437948 -38.582458 \n", "3 2016.1.01308.S Public 77.437948 -38.582458 \n", "4 2016.1.01308.S Public 80.570801 -53.100330 \n", "\n", " obs_publisher_did obs_collection facility_name instrument_name \\\n", "0 ADS/JAO.ALMA#2016.1.01308.S ALMA JAO ALMA \n", "1 ADS/JAO.ALMA#2016.1.01308.S ALMA JAO ALMA \n", "2 ADS/JAO.ALMA#2016.1.01308.S ALMA JAO ALMA \n", "3 ADS/JAO.ALMA#2016.1.01308.S ALMA JAO ALMA \n", "4 ADS/JAO.ALMA#2016.1.01308.S ALMA JAO ALMA \n", "\n", " obs_id dataproduct_type calib_level target_name \\\n", "0 uid://A001/X879/X314 cube 2 J2232+1143 \n", "1 uid://A001/X879/X314 cube 2 J2232+1143 \n", "2 uid://A001/X879/X314 cube 2 J2232+1143 \n", "3 uid://A001/X879/X314 cube 2 J2232+1143 \n", "4 uid://A001/X879/X314 cube 2 ULASJ2315+0143 \n", "\n", " s_ra s_dec s_fov \\\n", "0 338.151704 11.730807 0.015766 \n", "1 338.151704 11.730807 0.015766 \n", "2 338.151704 11.730807 0.015766 \n", "3 338.151704 11.730807 0.015766 \n", "4 348.984300 1.730694 0.015766 \n", "\n", " s_region s_resolution \\\n", "0 Polygon ICRS 338.151704 11.722924 338.150195 1... 0.576869 \n", "1 Polygon ICRS 338.151704 11.722924 338.150195 1... 0.576869 \n", "2 Polygon ICRS 338.151704 11.722924 338.150195 1... 0.576869 \n", "3 Polygon ICRS 338.151704 11.722924 338.150195 1... 0.576869 \n", "4 Polygon ICRS 348.984300 1.738577 348.985778 1.... 0.576861 \n", "\n", " t_min t_max t_exptime t_resolution em_min em_max \\\n", "0 57699.019868 57895.462736 907.20 907.20 0.003058 0.003118 \n", "1 57699.019868 57895.462736 907.20 907.20 0.003090 0.003150 \n", "2 57699.019868 57895.462736 907.20 907.20 0.002725 0.002772 \n", "3 57699.019868 57895.462736 907.20 907.20 0.002750 0.002798 \n", "4 57699.019868 57895.486087 5866.56 5866.56 0.002750 0.002798 \n", "\n", " em_res_power pol_states o_ucd band_list \\\n", "0 100396.011062 /XX/YY/ phot.flux.density;phys.polarization 3 \n", "1 99372.311222 /XX/YY/ phot.flux.density;phys.polarization 3 \n", "2 110760.976427 /XX/YY/ phot.flux.density;phys.polarization 3 \n", "3 109737.271411 /XX/YY/ phot.flux.density;phys.polarization 3 \n", "4 109737.271411 /XX/YY/ phot.flux.density;phys.polarization 3 \n", "\n", " em_resolution authors \\\n", "0 307.023917 Banerji, Manda; Jones, Gareth C.; Carniani, St... \n", "1 307.023917 Banerji, Manda; Jones, Gareth C.; Carniani, St... \n", "2 307.023917 Banerji, Manda; Jones, Gareth C.; Carniani, St... \n", "3 307.023917 Banerji, Manda; Jones, Gareth C.; Carniani, St... \n", "4 307.019722 Banerji, Manda; Jones, Gareth C.; Carniani, St... \n", "\n", " pub_abstract publication_year \\\n", "0 We present an unprecedented view of the morpho... 2018 \n", "1 We present an unprecedented view of the morpho... 2018 \n", "2 We present an unprecedented view of the morpho... 2018 \n", "3 We present an unprecedented view of the morpho... 2018 \n", "4 We present an unprecedented view of the morpho... 2018 \n", "\n", " proposal_abstract schedblock_name \\\n", "0 Newly discovered hyper-luminous, dusty broad-l... ULASJ231_a_03_TM1 \n", "1 Newly discovered hyper-luminous, dusty broad-l... ULASJ231_a_03_TM1 \n", "2 Newly discovered hyper-luminous, dusty broad-l... ULASJ231_a_03_TM1 \n", "3 Newly discovered hyper-luminous, dusty broad-l... ULASJ231_a_03_TM1 \n", "4 Newly discovered hyper-luminous, dusty broad-l... ULASJ231_a_03_TM1 \n", "\n", " proposal_authors sensitivity_10kms \\\n", "0 Jones, Gareth; Wethers, Clare; Hewett, Paul; M... 1.390184 \n", "1 Jones, Gareth; Wethers, Clare; Hewett, Paul; M... 1.509001 \n", "2 Jones, Gareth; Wethers, Clare; Hewett, Paul; M... 1.315095 \n", "3 Jones, Gareth; Wethers, Clare; Hewett, Paul; M... 1.320847 \n", "4 Jones, Gareth; Wethers, Clare; Hewett, Paul; M... 0.486219 \n", "\n", " cont_sensitivity_bandwidth pwv group_ous_uid \\\n", "0 0.029457 1.78126 uid://A001/X879/X313 \n", "1 0.029457 1.78126 uid://A001/X879/X313 \n", "2 0.029457 1.78126 uid://A001/X879/X313 \n", "3 0.029457 1.78126 uid://A001/X879/X313 \n", "4 0.010837 1.78126 uid://A001/X879/X313 \n", "\n", " member_ous_uid asdm_uid \\\n", "0 uid://A001/X879/X314 uid://A002/Xba460f/X1d9 \n", "1 uid://A001/X879/X314 uid://A002/Xba460f/X1d9 \n", "2 uid://A001/X879/X314 uid://A002/Xba460f/X1d9 \n", "3 uid://A001/X879/X314 uid://A002/Xba460f/X1d9 \n", "4 uid://A001/X879/X314 uid://A002/Xba460f/X1d9 \n", "\n", " obs_title type scan_intent \\\n", "0 Do Hyper-Luminous Dusty Quasars at z=2.5 Live ... S BANDPASS FLUX WVR \n", "1 Do Hyper-Luminous Dusty Quasars at z=2.5 Live ... S BANDPASS FLUX WVR \n", "2 Do Hyper-Luminous Dusty Quasars at z=2.5 Live ... S BANDPASS FLUX WVR \n", "3 Do Hyper-Luminous Dusty Quasars at z=2.5 Live ... S BANDPASS FLUX WVR \n", "4 Do Hyper-Luminous Dusty Quasars at z=2.5 Live ... S TARGET \n", "\n", " science_observation spatial_scale_max bandwidth \\\n", "0 F 6.946170 1.875000e+09 \n", "1 F 6.946170 1.875000e+09 \n", "2 F 6.946170 1.875000e+09 \n", "3 F 6.946170 1.875000e+09 \n", "4 T 6.946075 1.875000e+09 \n", "\n", " antenna_arrays is_mosaic \\\n", "0 A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D... F \n", "1 A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D... F \n", "2 A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D... F \n", "3 A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D... F \n", "4 A001:DA59 A002:DA49 A004:DA41 A006:DV15 A009:D... F \n", "\n", " obs_release_date spatial_resolution \\\n", "0 2018-08-12T19:08:02.000 0.576869 \n", "1 2018-08-12T19:08:02.000 0.576869 \n", "2 2018-08-12T19:08:02.000 0.576869 \n", "3 2018-08-12T19:08:02.000 0.576869 \n", "4 2018-08-12T19:08:02.000 0.576861 \n", "\n", " frequency_support frequency \\\n", "0 [95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,... 102.591895 \n", "1 [95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,... 102.591895 \n", "2 [95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,... 102.591895 \n", "3 [95.16..97.03GHz,976.56kHz,1.5mJy/beam@10km/s,... 102.591895 \n", "4 [95.16..97.03GHz,976.56kHz,554uJy/beam@10km/s,... 102.593370 \n", "\n", " velocity_resolution obs_creator_name \\\n", "0 2706.661386 Banerji, Manda \n", "1 2706.661386 Banerji, Manda \n", "2 2706.661386 Banerji, Manda \n", "3 2706.661386 Banerji, Manda \n", "4 2706.661386 Banerji, Manda \n", "\n", " pub_title \\\n", "0 Jet-driven Galaxy-scale Gas Outflows in the Hy... \n", "1 Jet-driven Galaxy-scale Gas Outflows in the Hy... \n", "2 Jet-driven Galaxy-scale Gas Outflows in the Hy... \n", "3 Jet-driven Galaxy-scale Gas Outflows in the Hy... \n", "4 Jet-driven Galaxy-scale Gas Outflows in the Hy... \n", "\n", " first_author qa2_passed \\\n", "0 Banerji, Manda Husemann, Bernd T \n", "1 Banerji, Manda Husemann, Bernd T \n", "2 Banerji, Manda Husemann, Bernd T \n", "3 Banerji, Manda Husemann, Bernd T \n", "4 Banerji, Manda Husemann, Bernd T \n", "\n", " bib_reference \\\n", "0 2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN... \n", "1 2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN... \n", "2 2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN... \n", "3 2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN... \n", "4 2018MNRAS.479.1154B 2019ApJ...879...75H 2021MN... \n", "\n", " science_keyword scientific_category \\\n", "0 High-z Active Galactic Nuclei (AGN) Active galaxies \n", "1 High-z Active Galactic Nuclei (AGN) Active galaxies \n", "2 High-z Active Galactic Nuclei (AGN) Active galaxies \n", "3 High-z Active Galactic Nuclei (AGN) Active galaxies \n", "4 High-z Active Galactic Nuclei (AGN) Active galaxies \n", "\n", " lastModified \n", "0 2021-09-30T16:34:41.133 \n", "1 2021-09-30T16:34:41.133 \n", "2 2021-09-30T16:34:41.133 \n", "3 2021-09-30T16:34:41.133 \n", "4 2021-09-30T16:34:41.133 " ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "output = query_proposal_id(service, '2016.1.01308.S')\n", "output.head(5) ### showing only 5 rows" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Which were the science targets in these observations?" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:41.040986Z", "iopub.status.busy": "2021-11-16T10:26:41.039955Z", "iopub.status.idle": "2021-11-16T10:26:41.045081Z", "shell.execute_reply": "2021-11-16T10:26:41.044044Z" } }, "outputs": [ { "data": { "text/plain": [ "array(['ULASJ1234+0907', 'ULASJ2315+0143'], dtype=object)" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.unique(output[output['science_observation']=='T']['target_name'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Which were the calibrators used in these observations?" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:41.052525Z", "iopub.status.busy": "2021-11-16T10:26:41.051741Z", "iopub.status.idle": "2021-11-16T10:26:41.056032Z", "shell.execute_reply": "2021-11-16T10:26:41.055192Z" } }, "outputs": [ { "data": { "text/plain": [ "array(['Ganymede', 'J1229+0203', 'J1238+0723', 'J1239+0730', 'J2232+1143',\n", " 'J2320+0513', 'J2326+0112', 'Neptune'], dtype=object)" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.unique(output[output['science_observation']=='F']['target_name'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---------------------------------------------------\n", "\n", "## Example 3b: Search for one specific source (J1229+0203, calibrator) in a list of proposal IDs\n", "Query the ASDM UIDs associated with a specific source observed multiple times within different observation sets." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2021-11-16T10:26:41.067600Z", "iopub.status.busy": "2021-11-16T10:26:41.066895Z", "iopub.status.idle": "2021-11-16T10:26:42.113566Z", "shell.execute_reply": "2021-11-16T10:26:42.113019Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "source J1229+0203 NOT found in ADS/JAO.ALMA#2015.1.00129.S\n", "source J1229+0203 found in ADS/JAO.ALMA#2015.1.00329.S\n", "Is a science observation? ['F' 'F' 'F' 'F']\n", "source J1229+0203 found in ADS/JAO.ALMA#2015.1.00587.S\n", "Is a science observation? ['F' 'F' 'F' 'F' 'F' 'F' 'F' 'F']\n", "source J1229+0203 found in ADS/JAO.ALMA#2015.1.01012.S\n", "Is a science observation? ['F' 'F' 'F' 'F']\n", "source J1229+0203 found in ADS/JAO.ALMA#2016.1.00972.S\n", "Is a science observation? ['F' 'F' 'F' 'F' 'F' 'F' 'F' 'F' 'F' 'F' 'F' 'F']\n", "source J1229+0203 found in ADS/JAO.ALMA#2016.1.01308.S\n", "Is a science observation? ['F' 'F' 'F' 'F' 'F' 'F' 'F' 'F']\n", "List of member_ous_uid that contain the particular source name and that are part of the proposal id list:\n", "['uid://A001/X2fe/Xbd5', 'uid://A001/X2fe/X80', 'uid://A001/X2fe/X82', 'uid://A001/X5a3/X83', 'uid://A001/X87d/X6d4', 'uid://A001/X899/X7e', 'uid://A001/X899/X82', 'uid://A001/X879/X318', 'uid://A001/X879/X31c']\n" ] } ], "source": [ "source_name = 'J1229+0203'\n", "\n", "# List of data sets where this source might be included\n", "proposal_id_list =['ADS/JAO.ALMA#2015.1.00129.S', 'ADS/JAO.ALMA#2015.1.00329.S', 'ADS/JAO.ALMA#2015.1.00587.S', 'ADS/JAO.ALMA#2015.1.01012.S', 'ADS/JAO.ALMA#2016.1.00972.S', 'ADS/JAO.ALMA#2016.1.01308.S']\n", "\n", "uids = []\n", "for proposal_id in proposal_id_list:\n", " output = query_proposal_id_and_alma_source_name(service, proposal_id, source_name)\n", " if len(output) > 0:\n", " print(f\"source {source_name} found in {proposal_id}\")\n", " print(f\"Is a science observation? {output['science_observation'].values}\")\n", " uids += list(np.unique(output['member_ous_uid'])) \n", " else:\n", " print(f\"source {source_name} NOT found in {proposal_id}\") \n", " \n", "print(\"List of member_ous_uid that contain the particular source name and that are part of the proposal id list:\")\n", "print(uids) \n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.6.10" } }, "nbformat": 4, "nbformat_minor": 4 }