The NASA Exoplanet Science Institute (NExScI) (visit https://nexsci.caltech.edu) has developed a Python-based server to implement an API that complies with the Virtual Observatory (VO) Table Access Protocol(TAP) version 1.1 (September 2019) (http://ivoa.net/documents/TAP/20190927/index.html), a standard recommended by the International Virtual Observatory alliance (IVOA) (http://ivoa.net).
The TAP API enables a rich variety of searches against tabular data, includung cone, box or all-sky searches, temporal searches, combinations of spatial searches and temporal searches, searches against instrumental attributes and program attributes.
This tutorial supports demonstrates how to use the TAP+ client to perform synchronous TAP-based queries for public raw science and calibration data acquired with the NIRC2 infrared imager; these data are hosted at the Keck Observatory Archive (KOA; https://koa.ipac.caltech.edu).
TAP+ was developed at the ESAC Space Data Centre (ESDC: http://www.cosmos.esa.int/web/esdc/) and can be installed from PyPI as part of the astroquery package:
$ pip install --upgrade astroquery
The tutorial requires Python 3.6 (or above), plus the table read and write functions from Astropy. We have tested with Astropy 4.0.1, but any version should work. We recommend using the Ananconda Python distribution.
import numpy as np
from astroquery.utils.tap.core import TapPlus
koa = TapPlus(url="https://koa.ipac.caltech.edu/TAP")
Created TAP+ (v20200428.1) - Connection: Host: koa.ipac.caltech.edu Use HTTPS: True Port: 443 SSL Port: 443
sql = "select koaid, filehand from koa_nirc2 where koaid like '%20140906%' "
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
INFO: Query finished. [astroquery.utils.tap.core] koaid filehand ---------------------- ----------------------------------------------------- N2.20140906.11394.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11394.fits N2.20140906.11451.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11451.fits N2.20140906.11508.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11508.fits N2.20140906.11564.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11564.fits N2.20140906.11621.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11621.fits N2.20140906.11677.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11677.fits N2.20140906.11734.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11734.fits N2.20140906.11790.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11790.fits N2.20140906.11847.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11847.fits N2.20140906.11903.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11903.fits ... ... N2.20140906.36000.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36000.fits N2.20140906.36033.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36033.fits N2.20140906.36059.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36059.fits N2.20140906.36330.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36330.fits N2.20140906.36402.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36402.fits N2.20140906.36474.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36474.fits N2.20140906.36556.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36556.fits N2.20140906.36630.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36630.fits N2.20140906.36799.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36799.fits N2.20140906.36871.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36871.fits N2.20140906.36944.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36944.fits Length = 356 rows
job = koa.launch_job_async(sql, dump_to_file=True, output_file='KoaTapDate1.tbl', \
output_format='ipac')
job = koa.launch_job_async(sql, dump_to_file=True, output_file='KoaTapDate2.vot', \
output_format='votable')
job = koa.launch_job_async(sql, dump_to_file=True, output_file='KoaTapDate3.csv', \
output_format='csv')
job = koa.launch_job_async(sql, dump_to_file=True, output_file='KoaTapDate4.tsv', \
output_format='tsv')
Saving results to: KoaTapDate1.tbl Saving results to: KoaTapDate2.vot Saving results to: KoaTapDate3.csv Saving results to: KoaTapDate4.tsv
sql = "select * from koa_nirc2 where koaid like '%20140906%'"
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
print(job)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='table_ascii.tbl', \
output_format='ipac')
INFO: Query finished. [astroquery.utils.tap.core] koaid propint airmass aoaoamed ... y z spt_ind months ... ---------------------- ------- ------- -------- ... --------- -------- --------- N2.20140906.11394.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11451.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11508.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11564.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11621.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11677.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11734.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11790.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11847.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 N2.20140906.11903.fits 18 1.41291 17 ... 0.599661 0.707107 233211302 ... ... ... ... ... ... ... ... N2.20140906.36033.fits 18 1.33107 243 ... -0.680536 0.641297 203030211 N2.20140906.36059.fits 18 1.33268 244 ... -0.680547 0.641282 203030211 N2.20140906.36330.fits 18 1.50117 26 ... -0.719692 0.645624 203032303 N2.20140906.36402.fits 18 1.50779 23 ... -0.719664 0.645646 203032303 N2.20140906.36474.fits 18 1.51454 132 ... -0.719682 0.645624 203032303 N2.20140906.36556.fits 18 1.52242 56 ... -0.719689 0.645626 203032303 N2.20140906.36630.fits 18 1.52953 66 ... -0.719667 0.645644 203032303 N2.20140906.36799.fits 18 1.5462 109 ... -0.719687 0.645628 203032303 N2.20140906.36871.fits 18 1.55344 126 ... -0.719669 0.645643 203032303 N2.20140906.36944.fits 18 1.56099 127 ... -0.719681 0.645628 203032303 Length = 356 rows <Table length=356> name dtype unit description n_bad ---------- ------- ------------ --------------------------------------------------------------------------- ----- koaid object Unique identifier for each file 0 propint int32 months 0 airmass float64 0 aoaoamed int32 0 aocomode object AO coma offloading mode 0 aodelay int32 0 aodmstat object AO deformable mirror loop stat 0 aodrdten float64 0 aodrena float64 0 aodtstat object AO downlink tip/tilt loop stat 0 aofcc0lg object AO FC C0 LGSAO 0 aofcc0n2 float64 356 aofccoos float64 356 aofclbct object AO FC LBWFS control 0 aofclbfo float64 m 0 aofclgct object AO FC LGS control 0 aofclgfo float64 m 0 aofcngct object AO FC NGS control 0 aofcngfo float64 m 0 aofcsalt int32 m 0 aofmx float64 mm 0 aofmy float64 mm 0 aofomode object AO focus offloading mode 0 aolbfwhm float64 0 aolpmove object AO LSP MOVE ENABLE 0 aoopsmod int32 0 aoopsmode int32 356 aostat object AO control status 0 aostst object AO state 0 aotsdar object AO TSS_USE_DAR 0 aotsx float64 mm 0 aotsy float64 mm 0 aotsz float64 mm 0 aottmode object AO tip/tilt offloading mode 0 aowfc0 float64 0 argonpwr int32 0 axestat object axes control status 0 az float64 degrees 0 bitpix int32 0 bscale float64 0 bzero float64 0 calocal float64 arcsec 0 camdist float64 mm 0 camname object camera slider's named position 0 camraw int32 counts 0 camstat object camera slider's current state 0 cd1_1 float64 0 cd1_2 float64 0 cd2_1 float64 0 cd2_2 float64 0 celocal float64 arcsec 0 cenwave float64 microns 0 coadds int32 0 crpix1 float64 0 crpix2 float64 0 crval1 float64 0 crval2 float64 0 ctype1 object WCS Type of the horizontal coordinate 0 ctype2 object WCS Type of the vertical coordinate 0 currinst object current instrument 0 date_obs object universal date of observation 0 datlevel int32 0 dcsstat object drive and control status 0 ddec float64 arcsec / s 0 cdec object degrees telescope declination 0 decoff float64 arcsec 0 detbias int32 0 detgain float64 0 detmode object Detector mode 0 detrn float64 0 dispers object Dispersion level 0 dispscal float64 356 dmgain float64 0 dmmrfn object Name of DM reconstructor file 0 domeposn float64 degrees 0 domestat object dome status 0 dqa_date object Date of DQA run 0 dqa_vers object DQA version number 0 dra float64 s 0 dtclp object OPEN/CLOSE TT CLMP ctrl loop 0 dtgain float64 0 dtrack object differential tracking enabled 0 effitime float64 356 effwave float64 microns 0 el float64 degrees 0 elaptime float64 seconds 0 equinox float64 yr 0 expstart object current instrument 0 expstop object Exposure stop str (UT) 0 filename object Original File name 0 filter object composite filter name (both wheel) 0 flimagin object Flat lamp control 1 0 flspectr object Flat lamp control 2 0 focalstn object focal station 0 frameno int32 0 frames int32 356 fwiangl float64 degrees 0 fwiname object inner filter wheel's named position 0 fwinum int32 0 fwiraw int32 counts 0 fwistat object inner filter wheel's current state 0 fwoangl float64 0 fwoname object degrees outer filter wheel's named position 0 fwonum int32 0 fworaw int32 counts 0 fwostat object outer filter wheel's current state 0 gain int32 0 grsdist float64 mm 0 grsname object grism slider's named position 0 grsraw int32 counts 0 grsstat object grism slider's current state 0 guidfwhm float64 arcseconds 356 guidtime object UT of logger GUIDFWHM value 0 guidwave float64 microns 0 ha float64 0 imagemd float64 DN 0 imagemn float64 DN 0 imagesd float64 DN 0 imagetyp object ImageType 0 instangl float64 degrees 0 instflip object porg to instrument y flip 0 instrume object Instrument name 0 inststat int32 0 isao object Adaptive optics 0 itime float64 seconds 0 koaimtyp object Image type - calibration or science frame 0 kryptpwr int32 0 lamppwr int32 0 lgrmswf float64 0 lsamppwr float64 watts 0 lsprop object Laser Propagating 0 lst object local apparent sidereal time 0 ltm1_1 float64 0 ltm2_2 float64 0 maxwave float64 microns 0 minwave float64 microns 0 mjd_obs float64 days 0 mlskycts float64 356 multisam object Number of multiple reads 0 mzp object Adopted magnitude zero pointeger 0 mzpalt object Alternate magnitude zero pointeger 0 mzpaltsr object Source of the alternate zero pointeger 0 mzpsrc object Source of the adopted zero pointeger 0 naxis int32 0 naxis1 int32 0 naxis2 int32 0 neonpwr int32 0 nlinear int32 DN 0 npixsat int32 DN 0 oa object Observing assistant 0 obamname object Named position control for AFM 0 obasname object Name position control for AFS 0 obfm1xra int32 counts 356 obfm1yra int32 counts 356 obfm2xra int32 counts 356 obfm2yra int32 counts 356 obfmdren float64 0 obfmname object Named position ontrol for FSM 0 obfmxim float64 mm 0 obfmxpu float64 0 obfmyim float64 mm 0 obfmypu float64 0 obfsname object Named position control for FSS 0 obimname object Named position control for ISM 0 object object Object name 0 oblbname object Named position control for LBS 0 obrt float64 degrees 0 obrtname object Named position control for ROT 0 obsdname object Named position control for SOD 0 observer object Observer 0 obsfname object Named position control for SFP 0 obsfx float64 mm 0 obsfy float64 mm 0 obsfz float64 mm 0 obsi float64 mm 0 obsnname object Named position control for SND 0 obswname object Named position control for SFW 0 obswsta object White light power status 0 obtsname object Named position control for TSS 0 obtsx float64 mm 0 obtsy float64 mm 0 obtsz float64 mm 0 obwcname object Named position control for WCS 0 obwf float64 mm 0 obwfname object Named position control for FCS 0 obwfstst object State of FCS as string 0 obwlname object Named position control for WLS 0 obwnname object Named position control for WND 0 obwpname object Named position control for WPS 0 ofname object Original filename 0 outdir object Original directory 0 parang float64 degrees 0 parantel float64 degrees 0 pixscal1 float64 0 pixscal2 float64 0 platescl float64 356 pmrangl object pupil drive's angular position 0 pmsangl float64 degrees 0 pmsname object pupil wheel's named position 0 pmsraw int32 counts 0 pmsstat object pupil Wheels current state 0 poname object pointegering origin name 0 poname1 object pointegering origin name 1 0 poname2 object pointegering origin name 2 0 poname3 object pointegering origin name 3 0 poxpos float64 mm 356 poxpos1 float64 mm 356 poxpos2 float64 mm 356 poxpos3 float64 mm 356 poypos float64 mm 356 poypos1 float64 mm 356 poypos2 float64 mm 356 poypos3 float64 mm 356 progid object WMKO ID for observing program 0 proginst object Program institution 0 progpi object Program principal investigator 0 progtitl object Program title - concatination of PROGTL1, PROGTL2, PROGTL3 from FITS header 0 psidist float64 mm 0 psiname object Inner preslit's named position 0 psiraw int32 counts 0 psistat object Inner preslit current state 0 psodist float64 mm 0 psoname object Outer preslit's named position 0 psoraw int32 counts 0 psostat object Outer preslit current state 0 q1offset int32 0 q2offset int32 0 q3offset int32 0 q4offset int32 0 cra object 0 radecsys object The system of the coordinates 0 raoff float64 arcsec 0 rootname object File prefix 0 rotcalan float64 degrees 0 rotdest float64 degrees 0 rotmode object rotator tracking mode 0 rotpdest float64 degrees 0 rotposn float64 degrees 0 rotpposn float64 degrees 0 rotrefan float64 degrees 0 sampmode int32 0 samprate int32 0 secfocus float64 mm 0 secthetx float64 arcsec 0 secthety float64 arcsec 0 semester object Semester 0 shrdist float64 mm 0 shrname object Shutter's named position 0 shrraw int32 counts 0 shrstat object Shutter State 0 sig2nois float64 0 simple object Tape is in Fits format 0 slitlen float64 arcseconds 356 slitmm float64 mm 0 slitname object Selected Slit Name 0 slittilt float64 0 slitwidt float64 arcseconds 356 slmdist float64 mm 0 slmname object slit mask's named position 0 slmraw int32 counts 0 slmstat object slit mask's current state 0 slsdist float64 mm 0 slsname object slit slide's named position 0 slsraw int32 counts 0 slsstat object slit sliter's current state 0 spatscal float64 arcsec / pix 356 specres float64 356 stapdqmn float64 0 targname object target name 0 targwave float64 microns 0 telescop object telescope name 0 telfocus float64 mm 0 tubetemp float64 degC 0 ut object copy of UTC 0 utc object coordinated universal time 0 utclp object OPEN/CLOSE TT CLMP ctrl loop 0 utgain float64 0 wat0_001 object coordinate system 0 wat1_001 object coordinate system 0 wat2_001 object coordinate system 0 waveblue float64 Microns 0 wavecntr float64 Microns 0 wavered float64 Microns 0 wcdmstat object Status of DM loop 0 wcdtstat object Status of down tt loop 0 wcsdim int32 0 wcutstat object Status of utt loop 0 wscnorfn object Name of origin vec file 0 wsfrrt int32 Hz 0 wsgain int32 356 wssmgn int32 0 wssmprg int32 0 wssmrep int32 0 wxdomhum float64 % 0 wxdomtmp float64 degreesC 0 wxdwpt float64 degreesC 0 wxouthum float64 % 0 wxouttmp float64 degreesC 0 wxpress float64 mbit 0 wxtime object UT of logged weather keyword values 0 wxwndir float64 356 wxwndsp float64 mph 356 xenonpwr int32 0 ra float64 0 dec float64 0 utdatetime object Combined DATE_OBS and UT as a timestamp 0 filehand object Path to the file in the archive 0 semid object SEMESTER and PROGID 0 x float64 0 y float64 0 z float64 0 spt_ind int32 0 Jobid: tap_zvpn59ex Phase: COMPLETED Owner: None Output file: async_20210701200731.vot Results: None Saving results to: table_ascii.tbl
sql = "select koaid, filehand from koa_nirc2 \
where koaid like '%20140906%' "
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='columns.tbl', \
output_format='ipac')
INFO: Query finished. [astroquery.utils.tap.core] koaid filehand ---------------------- ----------------------------------------------------- N2.20140906.11394.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11394.fits N2.20140906.11451.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11451.fits N2.20140906.11508.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11508.fits N2.20140906.11564.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11564.fits N2.20140906.11621.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11621.fits N2.20140906.11677.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11677.fits N2.20140906.11734.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11734.fits N2.20140906.11790.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11790.fits N2.20140906.11847.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11847.fits N2.20140906.11903.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11903.fits ... ... N2.20140906.36000.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36000.fits N2.20140906.36033.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36033.fits N2.20140906.36059.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36059.fits N2.20140906.36330.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36330.fits N2.20140906.36402.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36402.fits N2.20140906.36474.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36474.fits N2.20140906.36556.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36556.fits N2.20140906.36630.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36630.fits N2.20140906.36799.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36799.fits N2.20140906.36871.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36871.fits N2.20140906.36944.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.36944.fits Length = 356 rows Saving results to: columns.tbl
sql = "select top 20 koaid, filehand, frameno from koa_nirc2 where koaid like '%20140906%' "
job = koa.launch_job_async(sql, dump_to_file=True, output_file='KoaTapTestFiniteRecords.tbl', output_format='ipac')
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='top20.tbl', \
output_format='ipac')
Saving results to: KoaTapTestFiniteRecords.tbl INFO: Query finished. [astroquery.utils.tap.core] koaid ... frameno ---------------------- ... ------- N2.20140906.19352.fits ... 107 N2.20140906.19361.fits ... 108 N2.20140906.19375.fits ... 109 N2.20140906.19384.fits ... 110 N2.20140906.19394.fits ... 111 N2.20140906.19760.fits ... 142 N2.20140906.24877.fits ... 215 N2.20140906.24930.fits ... 216 N2.20140906.24979.fits ... 217 N2.20140906.25053.fits ... 218 N2.20140906.28767.fits ... 267 N2.20140906.29166.fits ... 271 N2.20140906.29235.fits ... 272 N2.20140906.29288.fits ... 273 N2.20140906.29377.fits ... 274 N2.20140906.29610.fits ... 275 N2.20140906.29659.fits ... 276 N2.20140906.29708.fits ... 277 N2.20140906.36871.fits ... 355 N2.20140906.36944.fits ... 356 Saving results to: top20.tbl
sql="select koaid, filehand from koa_nirc2 \
where (utdatetime >= to_date('2014-09-06 03:00:0', \
'yyyy-mm-dd HH24:MI:SS') and \
utdatetime <= to_date('2014-09-06 05:00:00', 'yyyy-mm-dd HH24:MI:SS'))"
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='datetime_range.tbl', \
output_format='ipac')
INFO: Query finished. [astroquery.utils.tap.core] koaid filehand ---------------------- ----------------------------------------------------- N2.20140906.11394.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11394.fits N2.20140906.11451.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11451.fits N2.20140906.11508.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11508.fits N2.20140906.11564.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11564.fits N2.20140906.11621.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11621.fits N2.20140906.11677.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11677.fits N2.20140906.11734.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11734.fits N2.20140906.11790.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11790.fits N2.20140906.11847.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11847.fits N2.20140906.11903.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.11903.fits ... ... N2.20140906.13076.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13076.fits N2.20140906.13132.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13132.fits N2.20140906.13189.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13189.fits N2.20140906.13249.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13249.fits N2.20140906.13305.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13305.fits N2.20140906.13362.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13362.fits N2.20140906.13418.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13418.fits N2.20140906.13475.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13475.fits N2.20140906.13531.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13531.fits N2.20140906.13588.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13588.fits N2.20140906.13644.fits /koadata10/NIRC2/20140906/lev0/N2.20140906.13644.fits Length = 43 rows Saving results to: datetime_range.tbl
sql= ("select koaid, filehand, progid, ha, az \
from koa_nirc2 where (progid = 'N153N2') ")
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='progID.tbl', \
output_format='ipac')
INFO: Query finished. [astroquery.utils.tap.core] koaid ... az ... degrees ---------------------- ... --------- N2.20081009.37236.fits ... 298.01464 N2.20081009.37250.fits ... 297.99602 N2.20081009.37264.fits ... 297.97716 N2.20081009.37278.fits ... 297.95829 N2.20081009.37292.fits ... 297.93938 N2.20081009.37305.fits ... 297.92123 N2.20081009.37319.fits ... 297.90345 N2.20081009.37332.fits ... 297.88539 N2.20081009.37346.fits ... 297.86745 N2.20081009.37360.fits ... 297.84932 ... ... ... N2.20140906.36033.fits ... -51.51143 N2.20140906.36059.fits ... -51.54799 N2.20140906.36330.fits ... -53.26467 N2.20140906.36402.fits ... -53.30977 N2.20140906.36474.fits ... -53.35836 N2.20140906.36556.fits ... -53.40971 N2.20140906.36630.fits ... -53.45242 N2.20140906.36799.fits ... -53.551 N2.20140906.36871.fits ... -53.58857 N2.20140906.36944.fits ... -53.62888 Length = 1923 rows Saving results to: progID.tbl
sql=("select koaid, filehand,ra, dec from koa_nirc2 where \
contains(point('icrs', ra, dec), \
circle('icrs', 238.0 27.6, 0.5)) = 1")
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='Spatial_cone.txt', \
output_format='ipac')
INFO: Query finished. [astroquery.utils.tap.core] koaid ... dec ---------------------- ... -------- N2.20140906.18417.fits ... 27.60311 N2.20140906.18437.fits ... 27.60297 N2.20140906.18450.fits ... 27.60324 N2.20140906.18462.fits ... 27.60297 N2.20140906.18476.fits ... 27.60324 N2.20140906.18593.fits ... 27.60311 N2.20140906.18603.fits ... 27.60311 N2.20140906.18614.fits ... 27.60311 N2.20140906.18624.fits ... 27.60311 N2.20140906.18635.fits ... 27.60311 ... ... ... N2.20140906.20047.fits ... 27.60318 N2.20140906.20063.fits ... 27.60304 N2.20140906.20074.fits ... 27.60304 N2.20140906.20084.fits ... 27.60304 N2.20140906.20095.fits ... 27.60304 N2.20140906.20106.fits ... 27.60304 N2.20140906.20127.fits ... 27.60318 N2.20140906.20138.fits ... 27.60318 N2.20140906.20149.fits ... 27.60318 N2.20140906.20159.fits ... 27.60318 N2.20140906.20170.fits ... 27.60318 Length = 130 rows Saving results to: Spatial_cone.txt
sql=("select koaid, filehand, ra, dec from koa_nirc2 where \
contains(point('icrs', ra, dec), \
box('icrs', 238.0 27.6, 0.5, 0.5)) = 1")
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='SpatBox.txt', output_format='ipac')
INFO: Query finished. [astroquery.utils.tap.core] koaid ... dec ---------------------- ... -------- N2.20140906.18417.fits ... 27.60311 N2.20140906.18437.fits ... 27.60297 N2.20140906.18450.fits ... 27.60324 N2.20140906.18462.fits ... 27.60297 N2.20140906.18476.fits ... 27.60324 N2.20140906.18593.fits ... 27.60311 N2.20140906.18603.fits ... 27.60311 N2.20140906.18614.fits ... 27.60311 N2.20140906.18624.fits ... 27.60311 N2.20140906.18635.fits ... 27.60311 ... ... ... N2.20140906.20047.fits ... 27.60318 N2.20140906.20063.fits ... 27.60304 N2.20140906.20074.fits ... 27.60304 N2.20140906.20084.fits ... 27.60304 N2.20140906.20095.fits ... 27.60304 N2.20140906.20106.fits ... 27.60304 N2.20140906.20127.fits ... 27.60318 N2.20140906.20138.fits ... 27.60318 N2.20140906.20149.fits ... 27.60318 N2.20140906.20159.fits ... 27.60318 N2.20140906.20170.fits ... 27.60318 Length = 130 rows Saving results to: SpatBox.txt
sql=("select koaid, filehand, ra, dec from koa_nirc2 where \
contains(point('icrs', ra, dec), \
polygon('icrs',237.5 27.1 238.5 27.1 238.5 28.1 237.5 28.1)) = 1")
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
job = koa.launch_job_async(sql, dump_to_file=True, output_file='SpatPoly.txt', \
output_format='ipac')
INFO: Query finished. [astroquery.utils.tap.core] koaid ... dec ---------------------- ... -------- N2.20140906.18417.fits ... 27.60311 N2.20140906.18437.fits ... 27.60297 N2.20140906.18450.fits ... 27.60324 N2.20140906.18462.fits ... 27.60297 N2.20140906.18476.fits ... 27.60324 N2.20140906.18593.fits ... 27.60311 N2.20140906.18603.fits ... 27.60311 N2.20140906.18614.fits ... 27.60311 N2.20140906.18624.fits ... 27.60311 N2.20140906.18635.fits ... 27.60311 ... ... ... N2.20140906.20047.fits ... 27.60318 N2.20140906.20063.fits ... 27.60304 N2.20140906.20074.fits ... 27.60304 N2.20140906.20084.fits ... 27.60304 N2.20140906.20095.fits ... 27.60304 N2.20140906.20106.fits ... 27.60304 N2.20140906.20127.fits ... 27.60318 N2.20140906.20138.fits ... 27.60318 N2.20140906.20149.fits ... 27.60318 N2.20140906.20159.fits ... 27.60318 N2.20140906.20170.fits ... 27.60318 Length = 130 rows Saving results to: SpatPoly.txt
sql=("select count(*) from koa_nirc2 where \
date_obs=to_date('2014-09-06', 'YYYY-MM-DD')")
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
INFO: Query finished. [astroquery.utils.tap.core] count(*) -------- 356
sql="select count(*) as total from koa_nirc2"
job = koa.launch_job_async(sql)
r = job.get_results()
print(r)
INFO: Query finished. [astroquery.utils.tap.core] total ------ 927153
Visit KOA at https://koa.ipac.caltech.edu.
The Keck Observatory Archive (KOA) is a collaboration between the NASA Exoplanet Science Institute (NExScI) and the W. M. Keck Observatory (WMKO). NExScI is sponsored by NASA's Exoplanet Exploration Program, and operated by the California Institute of Technology in coordination with the Jet Propulsion Laboratory (JPL).
Need help? Submit your questions to the KOA Help Desk at https://koa.ipac.caltech.edu/cgi-bin/Helpdesk/nph-genTicketForm?projname=KOA