PyKOA offers access to public raw science and calibration files and quick-look extracted (level 1) files acquired with the HIRES echelle-spectrograph. The quick-look extracted files have been created with the makee reduction package. They are not intended for scientific analysis. See https://koa.ipac.caltech.edu/UserGuide/HIRES/extracted.html for a description of the extraction. For Keck Observatory PIs, PyKOA offers secure access to their protected data with the KOA credentials already assigned to them.
Queries can be launched through several dedicated methods, or through the IVOA Astronomical Data Query Langage (ADQL); ADQL queries are underpinned by nexsciTAP, a NExScI Python-based server that implements the IVOA Table Access Protocol (TAP). PyKOA enables a rich variety of searches, including cone, box, polygon, or all-sky spatial searches; temporal searches; searches on program infotmation; and complex searches on multiple attributes.
This Jupyter Notebook provides examples of the methods supported by PyKOA, and examples of how Keck PIs may access their protected data.
PyKOA can be installed from PyPI:
$ pip install --upgrade pykoa
Requires Python 3.6 (or above), plus table read and write functions from Astropy. We have tested with Astropy 4.0.1. We recommend using the Anaconda Python distribution.
PyKOA supports methods for discovering and downloading public and private data archived at KOA. It writes the output metadata data to an output file, in IPAC ASCII, VOTable, CSV or TSV data formats.
This Tutorial illustrates methods for discovering and accessing public and private raw science and calibration files for HIRES:
General, complex metadata queries using the IVOA Astronomical Data Query Langage (ADQL).
Download raw science and associated calibration files, level 1 files or a subset of data, corresponding to a collection of metadata.
Queries for protected data (available to Keck PIs only).
The number of records returned by each query may differ from the number returned in this Notebook because new data are made public daily.
import sys
import io
import os
from pykoa.koa import Koa
from astropy.table import Table,Column
help(Koa)
Help on Archive in module pykoa.koa.core object:
class Archive(builtins.object)
| Archive(**kwargs)
|
| The 'Archive' class provides functions for accessing data stored in the
| Keck Observatory Archive (KOA). Queries are performed via the nexsciTAP
| server.
|
| Keck PIs can use the KOA credentials assigned to them when data were
| acquired (given at login) to search for their proprietary data.
|
| Example:
| --------
|
| import os
| import sys
|
| from pykoa.koa import Koa
|
| Koa.query_datetime ('hires', '2018-03-16 00:00:00/2018-03-18 00:00:00', outpath= './meta.xml', format='ipac')
|
| Methods defined here:
|
| __init__(self, **kwargs)
| 'init' method initializes the class with optional debugfile flag.
|
| Optional inputs:
| ----------------
| debugfile: a file path for the debug output
|
| download(self, metapath, format, outdir, **kwargs)
| 'download' method allows download of FITS files shown in the
| metadata file. The same method has the option of download the
| associated calibration files and level 1 files.
|
| *** Requirement:
|
| To download FITS files, the following two columns:
| instrume and filehand must be included in the metadata file.
|
| To download associated calibrated files, the following three
| columns: instrume, koaid, and filehand must be included in the
| metadata file.
|
|
| Required input:
| -----
| metapath (string): a full path metadata table obtained from running
| query methods
|
| format (string): metadata table's format: ipac, votable, csv, or tsv.
|
| outdir (string): the directory for depositing the returned files
|
| At least one of the following three optional parameters:
| lev1file, lev1file, and calibfile should be set to 1.:
|
|
| Optional input:
| ----------------
| cookiepath (string): cookie file path for downloading the proprietary
| KOA data;
|
| start_row (integer): default is start_row = 0;
|
| end_row (integer): default is end_row = nrows - 1 where nrows is the
| number of rows in the metadata file;
|
| lev0file (integer): 1/0;
| 1: download level0 files (i.e. raw data) in 'lev0' directory;
| 0: do not download level0 files.
| default is 1.
|
| calibfile (integer): 1/0;
| 1: download calibration files;
| 0: do not download calibration files.
| default is 0.
|
| lev1file (integer): 1/0;
| 1: download level1 files in 'lev1' directory;
| 0: do not download level1 files.
| default is 0.
|
| calibdir (integer): 1/0;
| 1: put calibration files in their own directory named 'calib';
| 0: put the calibration files in the 'lev0' directory with other
| raw, science files.
| default is 1.
|
| login(self, cookiepath, **kwargs)
| 'login' method validates a user has a valid KOA account; it takes two
| 'keyword' arguments: userid and password. If the inputs are not
| provided in the keyword, the login method prompts for inputs.
|
| Required input:
| ---------------
| cookiepath (string): a file path provided by the user to save
| returned cookie (in login method) or to serve
| as input parameter for the subsequent koa
| query and download methods.
|
| Keyword input:
| ---------------
| userid (string): a valid user id assigned by KOA;
|
| password (string): a valid password in the KOA's user table;
|
|
| Calling synopsis:
|
| koa.login (cookiepath, userid='xxxx', password='xxxxxx'), or
|
| koa.login (cookiepath): and the program will prompt for
| userid and password
|
| print_data(self)
|
| query_adql(self, query, outpath, **kwargs)
| 'query_adql' method receives a qualified ADQL query string from
| the user input.
|
| Required Inputs:
| ---------------
| query (string): an ADQL query
|
| outpath (string): the output filename of the returned metadata table
|
| Optional inputs:
| ----------------
| cookiepath (string): cookie file path for query the proprietary
| KOA data.
|
| format (string): output format: votable, ipac, csv, or tsv
| (default: ipac)
|
| maxrec (integer): maximum records to be returned
| default: -1 or not specified will return all requested records
|
| query_criteria(self, param, outpath, **kwargs)
| 'query_criteria' method allows searches of KOA by multiple
| parameters specified in a python dictionary (param).
|
| param: a dictionary containing a list of acceptable parameters:
|
| instrument (required): HIRES
|
| datetime (string): a datetime range string in the format of
| datetime1/datetime2, '/' being the separator between first
| and second datetime valaues where datetime format is
| 'yyyy-mm-dd hh:mm:ss'
|
| date (string): a date range string in the format of
| date1/date2, '/' being the separator between first
| and second date valaues where date format is 'yyyy-mm-dd'
|
| pos (string): a position string in the format of
|
| 1. circle ra dec radius;
|
| 2. polygon ra1 dec1 ra2 dec2 ra3 dec3 ra4 dec4;
|
| 3. box ra dec width height;
|
| all RA Dec in decimal degree J2000 coordinate.
|
| target (string): target name used in the project, this will be
| searched against the database -- not SIMBAD or NED.
|
| outpath (string): file path for the returned metadata table
|
| Optional parameters:
| --------------------
| cookiepath (string): cookie file path obtained via login method, only
| required for querying the proprietary KOA data.
|
| format (string): output table format -- votable, ipac, csv, or tsv;
| default: ipac
|
| maxrec (integer): maximum records to be returned
| default: -1 or not specified will return all requested records
|
| query_date(self, instrument, date, outpath, **kwargs)
| 'query_date' method searches KOA by 'date_obs' range
|
| Required Inputs:
| ---------------
| instrument (string): HIRES
|
| date (string): a date_obs string in the format of
| date1/date2 where '/' separates the two date values`
| of format 'yyyy-mm-dd'
|
| the following inputs are acceptable:
|
| date1/: will search data with date later than (>=)
| date1
|
| /date2: will search data with date earlier than (<=)
| date2
|
| date1: will search data with date equal to (=) date1
|
| outpath (string): a full output filepath of the returned metadata
| table
|
| e.g.
| instrument = 'hires',
| date = '2018-03-16/2018-03-18'
|
| e.g.
| instrument = 'hires',
| date = '2018-03-16/'
|
| e.g.
| instrument = 'hires',
| date = '/2018-03-18'
|
| e.g.
| instrument = 'hires',
| date = '2018-03-16'
|
| Optional inputs:
| ----------------
| cookiepath (string): cookie file path for querying the proprietary
| KOA data
|
| format (string): Output format: votable, ipac, csv, or tsv
| (default: ipac)
|
| maxrec (integer): maximum records to be returned
| default: -1 or not specified will return all requested records
|
| query_datetime(self, instrument, datetime, outpath, **kwargs)
| 'query_datetime' method searches KOA by 'datetime' range
|
| Required Inputs:
| ---------------
| instrument (string): HIRES
|
| datetime (string): a datetime string in the format of
| datetime1/datetime2 where '/' separates the two datetime values
| of format 'yyyy-mm-dd hh:mm:ss'
|
| the following inputs are acceptable:
|
| datetime1/: will search data with datetime later than (>=)
| datetime1
|
| /datetime2: will search data with datetime earlier than (<=)
| datetime2
|
| datetime1: will search data with datetime equal to (=) datetime1
|
| outpath (string): a full output filepath of the returned metadata
| table
|
| e.g.
| instrument = 'hires',
| datetime = '2018-03-16 06:10:55/2018-03-18 00:00:00'
|
| e.g.
| instrument = 'hires',
| datetime = '2018-03-16 06:10:55/'
|
| e.g.
| instrument = 'hires',
| datetime = '/2018-03-18 00:00:00'
|
| e.g.
| instrument = 'hires',
| datetime = '2018-03-16 06:10:55'
|
| Optional inputs:
| ----------------
| cookiepath (string): cookie file path for query the proprietary
| KOA data
|
| format (string): Output format: votable, ipac, csv, or tsv
| (default: ipac)
|
| maxrec (integer): maximum records to be returned
| default: -1 or not specified will return all requested records
|
| query_object(self, instrument, object, outpath, **kwargs)
| 'query_object' method searches KOA by 'object name'
|
| Required Inputs:
| ---------------
|
| instrument: HIRES
|
| object (string): an object name resolvable by SIMBAD, NED, and
| ExoPlanet's name_resolve;
|
| This method resolves the object name into coordiates to be used as the
| center of the circle position search with default radius of 0.5 deg.
|
| e.g.
| instrument = 'hires',
| object = 'WD 1145+017'
|
| Optional Input:
| ---------------
| cookiepath (string): cookie file path for query the proprietary
| KOA data.
|
| format (string): Output format: votable, ipac, csv, tsv (default: ipac)
|
| radius (float): search radius in deg (default = 0.5 deg)
|
| maxrec (integer): maximum records to be returned
| default: -1 or not specified will return all requested records
|
| query_position(self, instrument, pos, outpath, **kwargs)
| 'query_position' method searches KOA by 'position'
|
| Required Inputs:
| ---------------
|
| instrument (string): HIRES
|
| pos (string): a position string in the format of
|
| 1. circle ra dec radius;
|
| 2. polygon ra1 dec1 ra2 dec2 ra3 dec3 ra4 dec4;
|
| 3. box ra dec width height;
|
| All RA Dec in decimal degree J2000 coordinate.
|
| e.g.
| instrument = 'hires',
| pos = 'circle 230.0 45.0 0.5'
|
| outpath (string): a full filepath for the returned metadata table
|
| Optional Input:
| ---------------
| cookiepath (string): cookie file path for querying the proprietary
| KOA data.
|
| format (string): votable, ipac, csv, tsv (default: ipac)
|
| maxrec (integer): maximum records to be returned
| default: -1 or not specified will return all requested records
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| astropytbl = None
|
| content_type = ''
|
| debug = 0
|
| debugfname = './koa.debug'
|
| format = 'ipac'
|
| maxrec = -1
|
| msg = ''
|
| ncaliblist = 0
|
| ndnloaded = 0
|
| ndnloaded_calib = 0
|
| ndnloaded_lev1 = 0
|
| nlev1list = 0
|
| outdir = ''
|
| outpath = ''
|
| parampath = ''
|
| propflag = 1
|
| query = ''
|
| status = ''
|
| tap = None
try:
os.mkdir('./output')
except:
print(" Directory exists already", flush=True)
Koa.query_date ('hires', \
'2018-08-07', \
'./output/hires_date.tbl', overwrite=True, format='ipac' )
rec = Table.read ('./output/hires_date.tbl',format='ipac')
print (rec)
submitting request...
Result downloaded to file [./output/hires_date.tbl]
koaid ... filehand
---------------------- ... -----------------------------------------------------
HI.20180807.00030.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00030.fits
HI.20180807.00075.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00075.fits
HI.20180807.00143.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00143.fits
HI.20180807.00189.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00189.fits
HI.20180807.00234.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00234.fits
HI.20180807.00280.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00280.fits
HI.20180807.00325.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00325.fits
HI.20180807.00396.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00396.fits
HI.20180807.03511.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.03511.fits
HI.20180807.03732.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.03732.fits
... ... ...
HI.20180807.54915.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.54915.fits
HI.20180807.55025.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55025.fits
HI.20180807.55132.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55132.fits
HI.20180807.55281.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55281.fits
HI.20180807.55489.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55489.fits
HI.20180807.55597.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55597.fits
HI.20180807.55928.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55928.fits
HI.20180807.56116.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56116.fits
HI.20180807.56256.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56256.fits
HI.20180807.56361.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56361.fits
HI.20180807.56427.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56427.fits
Length = 159 rows
Koa.query_datetime ('hires', \
'2018-08-07 00:00:00/2018-08-08 00:00:00', \
'./output/Aug8.tbl', overwrite=True)
rec = Table.read ('./output/Aug8.tbl',format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/Aug8.tbl]
koaid ... filehand
---------------------- ... -----------------------------------------------------
HI.20180807.00030.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00030.fits
HI.20180807.00075.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00075.fits
HI.20180807.00143.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00143.fits
HI.20180807.00189.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00189.fits
HI.20180807.00234.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00234.fits
HI.20180807.00280.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00280.fits
HI.20180807.00325.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00325.fits
HI.20180807.00396.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00396.fits
HI.20180807.03511.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.03511.fits
HI.20180807.03732.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.03732.fits
... ... ...
HI.20180807.54915.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.54915.fits
HI.20180807.55025.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55025.fits
HI.20180807.55132.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55132.fits
HI.20180807.55281.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55281.fits
HI.20180807.55489.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55489.fits
HI.20180807.55597.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55597.fits
HI.20180807.55928.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55928.fits
HI.20180807.56116.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56116.fits
HI.20180807.56256.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56256.fits
HI.20180807.56361.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56361.fits
HI.20180807.56427.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56427.fits
Length = 159 rows
Koa.query_datetime ('hires', \
'2018-08-07 00:00:00/2018-08-08 00:00:00', \
'./output/Aug8votable.vot', overwrite=True, format='votable')
submitting request... Result downloaded to file [./output/Aug8votable.vot]
Koa.query_datetime ('hires', \
'2018-08-07 00:00:00/2018-08-08 00:00:00', \
'./output/Aug8csv.csv', overwrite=True, format='csv')
submitting request... Result downloaded to file [./output/Aug8csv.csv]
Koa.query_datetime ('hires', \
'2018-08-07 00:00:00/2018-08-08 00:00:00', \
'./output/Aug8tsv.tsv', overwrite=True, format='tsv')
submitting request... Result downloaded to file [./output/Aug8tsv.tsv]
Koa.query_position ('hires', \
'circle 77.28 -8.748 0.5', \
'./output/position_search.tbl', overwrite=True)
rec = Table.read ('./output/position_search.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/position_search.tbl]
koaid ... filehand
---------------------- ... -----------------------------------------------------
HI.20080127.31330.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31330.fits
HI.20080127.31383.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31383.fits
HI.20080127.31436.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31436.fits
HI.20080823.55082.fits ... /koadata4/HIRES/20080823/lev0/HI.20080823.55082.fits
HI.20080824.54962.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.54962.fits
HI.20080824.55010.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.55010.fits
HI.20080825.55412.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55412.fits
HI.20080825.55460.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55460.fits
HI.20081109.45601.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45601.fits
HI.20081109.45656.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45656.fits
... ... ...
HI.20191031.46586.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.46586.fits
HI.20191031.46634.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.46634.fits
HI.20191031.46682.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.46682.fits
HI.20191031.50106.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.50106.fits
HI.20191031.50156.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.50156.fits
HI.20191031.50204.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.50204.fits
HI.20200226.22914.fits ... /koadata13/HIRES/20200226/lev0/HI.20200226.22914.fits
HI.20200226.22961.fits ... /koadata13/HIRES/20200226/lev0/HI.20200226.22961.fits
HI.20200226.23010.fits ... /koadata13/HIRES/20200226/lev0/HI.20200226.23010.fits
HI.20201020.57118.fits ... /koadata13/HIRES/20201020/lev0/HI.20201020.57118.fits
HI.20201031.57349.fits ... /koadata13/HIRES/20201031/lev0/HI.20201031.57349.fits
Length = 102 rows
query = "select koaid, ra ,dec from koa_hires \
where (contains(point('J2000',ra ,dec ), \
box('J2000', 77.28659645, -8.75408078, 1, 1))=1) "
Koa.query_adql (query, \
'./output/adql_radec.tbl',overwrite=True, \
format='ipac')
rec = Table.read ('./output/adql_radec.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/adql_radec.tbl]
koaid ra dec
---------------------- -------- --------
HI.20080127.31330.fits 77.28638 -8.75269
HI.20080127.31383.fits 77.28638 -8.75269
HI.20080127.31436.fits 77.28638 -8.75269
HI.20080823.55082.fits 77.28579 -8.75217
HI.20080824.54962.fits 77.28225 -8.75436
HI.20080824.55010.fits 77.28225 -8.75444
HI.20080825.55412.fits 77.28921 -8.75442
HI.20080825.55460.fits 77.28921 -8.75442
HI.20081109.45601.fits 77.28308 -8.75694
HI.20081109.45656.fits 77.28308 -8.75694
... ... ...
HI.20191031.46586.fits 77.28608 -8.75417
HI.20191031.46634.fits 77.28608 -8.75417
HI.20191031.46682.fits 77.28608 -8.75417
HI.20191031.50106.fits 77.28783 -8.75433
HI.20191031.50156.fits 77.28783 -8.75433
HI.20191031.50204.fits 77.28783 -8.75433
HI.20200226.22914.fits 77.28775 -8.75381
HI.20200226.22961.fits 77.28775 -8.75381
HI.20200226.23010.fits 77.28775 -8.75381
HI.20201020.57118.fits 77.28554 -8.75419
HI.20201031.57349.fits 77.28521 -8.75414
Length = 102 rows
query = "select koaid, filehand, ra, dec from koa_hires \
where contains(point('icrs', ra, dec), \
polygon('icrs',209.80225,53.34894,209.80225,55.34894,211.80225,54.34894)) = 1"
Koa.query_adql (query, \
'./output/polygon.tbl',overwrite=True, \
format='ipac')
rec = Table.read ('./output/polygon.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/polygon.tbl]
koaid ... dec
---------------------- ... --------
HI.20040114.51275.fits ... 54.35381
HI.20040114.53552.fits ... 54.35381
HI.20040114.55829.fits ... 54.35381
HI.20040114.58182.fits ... 54.35383
HI.20060420.33559.fits ... 54.35292
HI.20060420.35412.fits ... 54.35292
HI.20060420.37265.fits ... 54.35292
HI.20060420.39117.fits ... 54.35292
HI.20060420.41232.fits ... 54.31703
HI.20060420.43085.fits ... 54.31703
... ... ...
HI.20110903.19681.fits ... 54.27442
HI.20110905.19585.fits ... 54.27675
HI.20110909.17581.fits ... 54.27289
HI.20110909.18064.fits ... 54.27289
HI.20110909.18415.fits ... 54.27289
HI.20110909.19067.fits ... 54.27289
HI.20110909.19719.fits ... 54.27289
HI.20110920.17641.fits ... 54.27347
HI.20110923.18047.fits ... 54.27414
HI.20110923.18126.fits ... 54.27414
HI.20110923.18478.fits ... 54.27414
Length = 28 rows
Koa.query_object ('hires', \
'hr1679', \
'./output/hr1679.tbl', overwrite=True,)
rec = Table.read ('./output/hr1679.tbl', format='ascii.ipac')
print (rec)
object name resolved: ra= 77.28659645, dec=-8.75408078
submitting request...
Result downloaded to file [./output/hr1679.tbl]
koaid ... filehand
---------------------- ... -----------------------------------------------------
HI.20080127.31330.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31330.fits
HI.20080127.31383.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31383.fits
HI.20080127.31436.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31436.fits
HI.20080823.55082.fits ... /koadata4/HIRES/20080823/lev0/HI.20080823.55082.fits
HI.20080824.54962.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.54962.fits
HI.20080824.55010.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.55010.fits
HI.20080825.55412.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55412.fits
HI.20080825.55460.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55460.fits
HI.20081109.45601.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45601.fits
HI.20081109.45656.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45656.fits
... ... ...
HI.20191031.46586.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.46586.fits
HI.20191031.46634.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.46634.fits
HI.20191031.46682.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.46682.fits
HI.20191031.50106.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.50106.fits
HI.20191031.50156.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.50156.fits
HI.20191031.50204.fits ... /koadata13/HIRES/20191031/lev0/HI.20191031.50204.fits
HI.20200226.22914.fits ... /koadata13/HIRES/20200226/lev0/HI.20200226.22914.fits
HI.20200226.22961.fits ... /koadata13/HIRES/20200226/lev0/HI.20200226.22961.fits
HI.20200226.23010.fits ... /koadata13/HIRES/20200226/lev0/HI.20200226.23010.fits
HI.20201020.57118.fits ... /koadata13/HIRES/20201020/lev0/HI.20201020.57118.fits
HI.20201031.57349.fits ... /koadata13/HIRES/20201031/lev0/HI.20201031.57349.fits
Length = 102 rows
query ="select koaid, filehand, progid, iodin, koaimtyp from koa_hires where (progid = 'C307') "
Koa.query_adql (query, \
'./output/program_info.tbl', overwrite=True, \
format='ipac')
rec = Table.read ('./output/program_info.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/program_info.tbl]
koaid ... koaimtyp
---------------------- ... --------
HI.20180331.02525.fits ... focus
HI.20180331.03342.fits ... focus
HI.20180331.03598.fits ... focus
HI.20180331.03786.fits ... focus
HI.20180331.03943.fits ... focus
HI.20180331.04060.fits ... focus
HI.20180331.04218.fits ... focus
HI.20180331.04338.fits ... focus
HI.20180331.04502.fits ... arclamp
HI.20180331.04578.fits ... arclamp
... ... ...
HI.20180801.44904.fits ... object
HI.20180801.45058.fits ... object
HI.20180801.45222.fits ... object
HI.20180801.45356.fits ... object
HI.20180801.45644.fits ... object
HI.20180801.45867.fits ... object
HI.20180801.45945.fits ... object
HI.20180801.46157.fits ... flatlamp
HI.20180801.46246.fits ... flatlamp
HI.20180801.46399.fits ... arclamp
HI.20180801.46463.fits ... arclamp
Length = 538 rows
param = dict()
param['instrument'] = 'hires'
param['datetime'] = '2008-01-01 00:00:00/2008-12-31 00:00:00'
param['pos'] = 'circle 77.28 -8.748 0.5'
Koa.query_criteria (param, \
'./output/parameters.tbl')
rec = Table.read ('./output/parameters.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/parameters.tbl]
koaid ... filehand
---------------------- ... ----------------------------------------------------
HI.20080127.31330.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31330.fits
HI.20080127.31383.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31383.fits
HI.20080127.31436.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31436.fits
HI.20080823.55082.fits ... /koadata4/HIRES/20080823/lev0/HI.20080823.55082.fits
HI.20080824.54962.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.54962.fits
HI.20080824.55010.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.55010.fits
HI.20080825.55412.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55412.fits
HI.20080825.55460.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55460.fits
HI.20081109.45601.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45601.fits
HI.20081109.45656.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45656.fits
HI.20081109.45708.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45708.fits
query = "select koaid, instrume, targname, object, koaimtyp, frameno, ra, dec, mjd, \
to_char(date_obs,'YYYY-MM-DD') as date_obs, ut, elaptime, waveblue, wavered, progid, proginst, \
progpi, progtitl, sig2nois, slitwidt, slitlen, spatscal, specres, filehand, lower(semid) as semid, \
propint, amplist, ampmode, binning, xdispers, deckname, lampqtz2, iodin, iodout, collblue, collred, \
ccdgain, ccdspeed, echangl, fil1name, fil2name, mosmode, nvidinp, precol, postpix, roqual, window, \
xdangl, equinox, datlevel, ofname from koa_hires \
where (contains(point('J2000',ra,dec), circle('J2000', 77.28659645, -8.75408078, 0.5))=1) \
order by utdatetime"
Koa.query_adql (query, \
'./output/adql_one_long_query.tbl', overwrite=True, \
format='ipac')
rec = Table.read ('./output/adql_one_long_query.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/adql_one_long_query.tbl]
koaid ... ofname
---------------------- ... --------------
HI.20080127.31330.fits ... hires0288.fits
HI.20080127.31383.fits ... hires0289.fits
HI.20080127.31436.fits ... hires0290.fits
HI.20080823.55082.fits ... hires0221.fits
HI.20080824.54962.fits ... hires0216.fits
HI.20080824.55010.fits ... hires0217.fits
HI.20080825.55412.fits ... hires0217.fits
HI.20080825.55460.fits ... hires0218.fits
HI.20081109.45601.fits ... hires0166.fits
HI.20081109.45656.fits ... hires0167.fits
... ... ...
HI.20191031.46586.fits ... j3500108.fits
HI.20191031.46634.fits ... j3500109.fits
HI.20191031.46682.fits ... j3500110.fits
HI.20191031.50106.fits ... j3500114.fits
HI.20191031.50156.fits ... j3500115.fits
HI.20191031.50204.fits ... j3500116.fits
HI.20200226.22914.fits ... j3650484.fits
HI.20200226.22961.fits ... j3650485.fits
HI.20200226.23010.fits ... j3650486.fits
HI.20201020.57118.fits ... j3900110.fits
HI.20201031.57349.fits ... j3910549.fits
Length = 102 rows
query = "select top 10 koaid, ra ,dec, utdatetime from koa_hires \
where (contains(point('J2000',ra ,dec), \
box('J2000', 77.28659645, -8.75408078, 1, 1)) =1) order by utdatetime desc "
Koa.query_adql (query, \
'./output/adql_radec.tbl',overwrite=True, \
format='ipac')
rec = Table.read ('./output/adql_radec.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/adql_radec.tbl]
koaid ra dec utdatetime
---------------------- -------- -------- --------------------------
HI.20081109.45708.fits 77.28308 -8.75694 2008-11-09 12:41:48.580000
HI.20081109.45601.fits 77.28308 -8.75694 2008-11-09 12:40:01.180000
HI.20080825.55460.fits 77.28921 -8.75442 2008-08-25 15:24:20.350000
HI.20080825.55412.fits 77.28921 -8.75442 2008-08-25 15:23:32
HI.20080824.55010.fits 77.28225 -8.75444 2008-08-24 15:16:50.900000
HI.20080824.54962.fits 77.28225 -8.75436 2008-08-24 15:16:02.900000
HI.20080823.55082.fits 77.28579 -8.75217 2008-08-23 15:18:02.530000
HI.20080127.31436.fits 77.28638 -8.75269 2008-01-27 08:43:56.970000
HI.20080127.31383.fits 77.28638 -8.75269 2008-01-27 08:43:03.820000
HI.20080127.31330.fits 77.28638 -8.75269 2008-01-27 08:42:10.320000
query = "select count(koaid) from koa_hires \
where (contains(point('J2000',ra,dec), box('J2000', 77.28659645, -8.75408078, 1, 1))=1) "
Koa.query_adql (query, \
'./output/adql_count.tbl',overwrite=True, \
format='ipac')
rec = Table.read ('./output/adql_count.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/adql_count.tbl]
count(koaid)
------------
102
param = dict()
param['instrument'] = 'hires'
param['datetime'] = '2008-01-01 00:00:00/2008-12-31 00:00:00'
param['pos'] = 'circle 77.28 -8.748 0.5'
Koa.query_criteria (param, \
'./output/parameters.tbl')
rec = Table.read ('./output/parameters.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/parameters.tbl]
koaid ... filehand
---------------------- ... ----------------------------------------------------
HI.20080127.31330.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31330.fits
HI.20080127.31383.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31383.fits
HI.20080127.31436.fits ... /koadata3/HIRES/20080127/lev0/HI.20080127.31436.fits
HI.20080823.55082.fits ... /koadata4/HIRES/20080823/lev0/HI.20080823.55082.fits
HI.20080824.54962.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.54962.fits
HI.20080824.55010.fits ... /koadata4/HIRES/20080824/lev0/HI.20080824.55010.fits
HI.20080825.55412.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55412.fits
HI.20080825.55460.fits ... /koadata4/HIRES/20080825/lev0/HI.20080825.55460.fits
HI.20081109.45601.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45601.fits
HI.20081109.45656.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45656.fits
HI.20081109.45708.fits ... /koadata4/HIRES/20081109/lev0/HI.20081109.45708.fits
Koa.download ('./output/parameters.tbl', \
'ipac', \
'./dnload_dir1', \
start_row=1, \
end_row=3)
Start downloading 3 koaid data you requested; please check your outdir: ./dnload_dir1 for progress .... A total of 3 new lev0 FITS files downloaded.
Koa.download ('./output/parameters.tbl', \
'ipac', \
'./dnload_dir1')
Start downloading 11 koaid data you requested; please check your outdir: ./dnload_dir1 for progress .... A total of 8 new lev0 FITS files downloaded.
Koa.query_datetime ('hires', \
'2004-08-24 00:00:00/2004-08-24 23:59:59', \
'./output/datetime_hires.tbl')
submitting request... Result downloaded to file [./output/datetime_hires.tbl]
Koa.download ('./output/datetime_hires.tbl', \
'ipac', \
'dnload_dir_hires_calib1', \
start_row=53, \
end_row=55, \
lev1file=1 )
Start downloading 3 koaid data you requested; please check your outdir: dnload_dir_hires_calib1 for progress .... A total of 3 new lev0 FITS files downloaded. 3 new lev1 list downloaded. 1734 new lev1 files downloaded.
Koa.download ('./output/datetime_hires.tbl', \
'ipac', \
'dnload_dir_hires_calib1', \
start_row=53, \
end_row=55, \
lev1file=1, \
calibfile=1, \
calibdir=1 )
Start downloading 3 koaid data you requested; please check your outdir: dnload_dir_hires_calib1 for progress .... A total of 0 new lev0 FITS files downloaded. 0 new lev1 list downloaded. 0 new lev1 files downloaded. 3 new calibration list downloaded. 51 new calibration FITS files downloaded.
Koa.download ('./output/datetime_hires.tbl', \
'ipac', \
'dnload_dir_hires_calib0', \
start_row=53, \
end_row=55, \
lev1file=1, \
calibfile=1, \
calibdir=0 )
Start downloading 3 koaid data you requested; please check your outdir: dnload_dir_hires_calib0 for progress .... A total of 3 new lev0 FITS files downloaded. 3 new lev1 list downloaded. 1734 new lev1 files downloaded. 3 new calibration list downloaded. 51 new calibration FITS files downloaded.
import io
import json
import pandas as pd
filepath = './dnload_dir_hires_calib1/calib/HI.20040824.18925.caliblist.json'
fp = None
jsondata = None
try:
with open (filepath) as fp:
jsondata = json.load (fp)
fp.close()
except Exception as e:
print (f'read input jsonfile error: {str(e):s}')
sys.exit()
status = ''
nrec = -1
tbldata = None
try:
status = jsondata['status']
except Exception as e:
print ('Exception extracting keyword "status"')
try:
nrec = int(jsondata['nrec'])
except Exception as e:
print ('Exception extracting keyword "nrec"')
try:
tbldata = jsondata['table']
except Exception as e:
print ('Exception extracting keyword "table"')
print (f'status= {status:s}')
print (f'nrec= {nrec:d}')
df = pd.json_normalize (tbldata)
print (df)
status= ok
nrec= 51
koaid ofname instrument targname \
0 HI.20040824.08204.fits hires2300.fits HIRES horizon lock
1 HI.20040824.08544.fits hires2301.fits HIRES horizon lock
2 HI.20040824.08591.fits hires2302.fits HIRES horizon lock
3 HI.20040824.08638.fits hires2303.fits HIRES horizon lock
4 HI.20040824.08685.fits hires2304.fits HIRES horizon lock
5 HI.20040824.08732.fits hires2305.fits HIRES horizon lock
6 HI.20040824.08779.fits hires2306.fits HIRES horizon lock
7 HI.20040824.08826.fits hires2307.fits HIRES horizon lock
8 HI.20040824.08873.fits hires2308.fits HIRES horizon lock
9 HI.20040824.08919.fits hires2309.fits HIRES horizon lock
10 HI.20040824.08965.fits hires2310.fits HIRES horizon lock
11 HI.20040824.09011.fits hires2311.fits HIRES horizon lock
12 HI.20040824.09058.fits hires2312.fits HIRES horizon lock
13 HI.20040824.09105.fits hires2313.fits HIRES horizon lock
14 HI.20040824.09152.fits hires2314.fits HIRES horizon lock
15 HI.20040824.09198.fits hires2315.fits HIRES horizon lock
16 HI.20040824.09677.fits hires2316.fits HIRES horizon lock
17 HI.20040824.09724.fits hires2317.fits HIRES horizon lock
18 HI.20040824.09770.fits hires2318.fits HIRES horizon lock
19 HI.20040824.09817.fits hires2319.fits HIRES horizon lock
20 HI.20040824.09863.fits hires2320.fits HIRES horizon lock
21 HI.20040824.09910.fits hires2321.fits HIRES horizon lock
22 HI.20040824.09956.fits hires2322.fits HIRES horizon lock
23 HI.20040824.10003.fits hires2323.fits HIRES horizon lock
24 HI.20040824.10049.fits hires2324.fits HIRES horizon lock
25 HI.20040824.10096.fits hires2325.fits HIRES horizon lock
26 HI.20040824.10142.fits hires2326.fits HIRES horizon lock
27 HI.20040824.10189.fits hires2327.fits HIRES horizon lock
28 HI.20040824.10235.fits hires2328.fits HIRES horizon lock
29 HI.20040824.10281.fits hires2329.fits HIRES horizon lock
30 HI.20040824.10327.fits hires2330.fits HIRES horizon lock
31 HI.20040824.10578.fits hires2331.fits HIRES horizon lock
32 HI.20040824.12389.fits hires2332.fits HIRES horizon lock
33 HI.20040824.13840.fits hires2333.fits HIRES horizon lock
34 HI.20040824.17057.fits hires2350.fits HIRES null
35 HI.20040824.17213.fits hires2351.fits HIRES null
36 HI.20040824.40278.fits hires2372.fits HIRES s21524-1232
37 HI.20040824.40332.fits hires2373.fits HIRES s21524-1232
38 HI.20040824.53947.fits hires2381.fits HIRES horizon lock
39 HI.20040824.54001.fits hires2382.fits HIRES horizon lock
40 HI.20040824.54115.fits hires2383.fits HIRES horizon lock
41 HI.20040824.54161.fits hires2384.fits HIRES horizon lock
42 HI.20040824.54207.fits hires2385.fits HIRES horizon lock
43 HI.20040824.54253.fits hires2386.fits HIRES horizon lock
44 HI.20040824.54301.fits hires2387.fits HIRES horizon lock
45 HI.20040824.54347.fits hires2388.fits HIRES horizon lock
46 HI.20040824.54394.fits hires2389.fits HIRES horizon lock
47 HI.20040824.54441.fits hires2390.fits HIRES horizon lock
48 HI.20040824.54488.fits hires2391.fits HIRES horizon lock
49 HI.20040824.54534.fits hires2392.fits HIRES horizon lock
50 HI.20040824.54581.fits hires2393.fits HIRES horizon lock
object koaimtyp frameno ra dec date_obs ... \
0 Quartz+BG14 flatlamp 2300 334.95817 44.97982 2004-08-24 ...
1 Quartz+BG14 flatlamp 2301 334.95817 44.97982 2004-08-24 ...
2 Quartz+BG14 flatlamp 2302 334.95817 44.97982 2004-08-24 ...
3 Quartz+BG14 flatlamp 2303 334.95817 44.97982 2004-08-24 ...
4 Quartz+BG14 flatlamp 2304 334.95817 44.97982 2004-08-24 ...
5 Quartz+BG14 flatlamp 2305 334.95817 44.97982 2004-08-24 ...
6 Quartz+BG14 flatlamp 2306 334.95817 44.97982 2004-08-24 ...
7 Quartz+BG14 flatlamp 2307 334.95817 44.97982 2004-08-24 ...
8 Quartz+BG14 flatlamp 2308 334.95817 44.97982 2004-08-24 ...
9 Quartz+BG14 flatlamp 2309 334.95817 44.97982 2004-08-24 ...
10 Quartz+BG14 flatlamp 2310 334.95817 44.97982 2004-08-24 ...
11 Quartz+BG14 flatlamp 2311 334.95817 44.97982 2004-08-24 ...
12 Quartz+BG14 flatlamp 2312 334.95817 44.97982 2004-08-24 ...
13 Quartz+BG14 flatlamp 2313 334.95817 44.97982 2004-08-24 ...
14 Quartz+BG14 flatlamp 2314 334.95817 44.97982 2004-08-24 ...
15 Quartz+BG14 flatlamp 2315 334.95817 44.97982 2004-08-24 ...
16 Bias bias 2316 334.95817 44.97982 2004-08-24 ...
17 Bias bias 2317 334.95817 44.97982 2004-08-24 ...
18 Bias bias 2318 334.95817 44.97982 2004-08-24 ...
19 Bias bias 2319 334.95817 44.97982 2004-08-24 ...
20 Bias bias 2320 334.95817 44.97982 2004-08-24 ...
21 Bias bias 2321 334.95817 44.97982 2004-08-24 ...
22 Bias bias 2322 334.95817 44.97982 2004-08-24 ...
23 Bias bias 2323 334.95817 44.97982 2004-08-24 ...
24 Bias bias 2324 334.95817 44.97982 2004-08-24 ...
25 Bias bias 2325 334.95817 44.97982 2004-08-24 ...
26 Bias bias 2326 334.95817 44.97982 2004-08-24 ...
27 Bias bias 2327 334.95817 44.97982 2004-08-24 ...
28 Bias bias 2328 334.95817 44.97982 2004-08-24 ...
29 Bias bias 2329 334.95817 44.97982 2004-08-24 ...
30 Bias bias 2330 334.95817 44.97982 2004-08-24 ...
31 dark dark 2331 334.95817 44.97982 2004-08-24 ...
32 dark dark 2332 334.95817 44.97982 2004-08-24 ...
33 dark dark 2333 334.95817 44.97982 2004-08-24 ...
34 Th-A arclamp 2350 94.43094 38.00173 2004-08-24 ...
35 Th-A arclamp 2351 94.43094 38.00173 2004-08-24 ...
36 Th-A arclamp 2372 328.09812 -12.52975 2004-08-24 ...
37 Th-A arclamp 2373 328.09812 -12.52975 2004-08-24 ...
38 Th-A arclamp 2381 344.00000 0.01039 2004-08-24 ...
39 Th-A arclamp 2382 344.00000 0.01039 2004-08-24 ...
40 Quartz flatlamp 2383 344.00000 0.01039 2004-08-24 ...
41 Quartz flatlamp 2384 344.00000 0.01039 2004-08-24 ...
42 Quartz flatlamp 2385 344.00000 0.01039 2004-08-24 ...
43 Quartz flatlamp 2386 344.00000 0.01039 2004-08-24 ...
44 Quartz flatlamp 2387 344.00000 0.01039 2004-08-24 ...
45 Quartz flatlamp 2388 344.00000 0.01039 2004-08-24 ...
46 Quartz flatlamp 2389 344.00000 0.01039 2004-08-24 ...
47 Quartz flatlamp 2390 344.00000 0.01039 2004-08-24 ...
48 Quartz flatlamp 2391 344.00000 0.01039 2004-08-24 ...
49 Quartz flatlamp 2392 344.00000 0.01039 2004-08-24 ...
50 Quartz flatlamp 2393 344.00000 0.01039 2004-08-24 ...
mosmode nvidinp precol postpix roqual slitwid window xdispers \
0 B, G, R 3 12 80 Bad 10.2136449800 null RED
1 B, G, R 3 12 80 Good 10.2136449800 null RED
2 B, G, R 3 12 80 Good 10.2136449800 null RED
3 B, G, R 3 12 80 Bad 10.2136449800 null RED
4 B, G, R 3 12 80 Bad 10.2136449800 null RED
5 B, G, R 3 12 80 Bad 10.2136449800 null RED
6 B, G, R 3 12 80 Good 10.2136449800 null RED
7 B, G, R 3 12 80 Bad 10.2136449800 null RED
8 B, G, R 3 12 80 Good 10.2136449800 null RED
9 B, G, R 3 12 80 Good 10.2136449800 null RED
10 B, G, R 3 12 80 Good 10.2136449800 null RED
11 B, G, R 3 12 80 Bad 10.2136449800 null RED
12 B, G, R 3 12 80 Bad 10.2136449800 null RED
13 B, G, R 3 12 80 Good 10.2136449800 null RED
14 B, G, R 3 12 80 Good 10.2136449800 null RED
15 B, G, R 3 12 80 Good 10.2136449800 null RED
16 B, G, R 3 12 80 Good 10.2136449800 null RED
17 B, G, R 3 12 80 Good 10.2136449800 null RED
18 B, G, R 3 12 80 Good 10.2136449800 null RED
19 B, G, R 3 12 80 Good 10.2136449800 null RED
20 B, G, R 3 12 80 Good 10.2136449800 null RED
21 B, G, R 3 12 80 Good 10.2136449800 null RED
22 B, G, R 3 12 80 Good 10.2136449800 null RED
23 B, G, R 3 12 80 Good 10.2136449800 null RED
24 B, G, R 3 12 80 Good 10.2136449800 null RED
25 B, G, R 3 12 80 Good 10.2136449800 null RED
26 B, G, R 3 12 80 Good 10.2136449800 null RED
27 B, G, R 3 12 80 Good 10.2136449800 null RED
28 B, G, R 3 12 80 Good 10.2136449800 null RED
29 B, G, R 3 12 80 Good 10.2136449800 null RED
30 B, G, R 3 12 80 Good 10.2136449800 null RED
31 B, G, R 3 12 80 Good 10.2136449800 null RED
32 B, G, R 3 12 80 Good 10.2136449800 null RED
33 B, G, R 3 12 80 Good 10.2136449800 null RED
34 B, G, R 3 12 80 Good 10.2136449800 null RED
35 B, G, R 3 12 80 Good 10.2136449800 null RED
36 B, G, R 3 12 80 Good 10.2136449800 null RED
37 B, G, R 3 12 80 Good 10.2136449800 null RED
38 B, G, R 3 12 80 Good 10.2136449800 null RED
39 B, G, R 3 12 80 Good 10.2136449800 null RED
40 B, G, R 3 12 80 Good 10.2136449800 null RED
41 B, G, R 3 12 80 Good 10.2136449800 null RED
42 B, G, R 3 12 80 Good 10.2136449800 null RED
43 B, G, R 3 12 80 Good 10.2136449800 null RED
44 B, G, R 3 12 80 Good 10.2136449800 null RED
45 B, G, R 3 12 80 Good 10.2136449800 null RED
46 B, G, R 3 12 80 Good 10.2136449800 null RED
47 B, G, R 3 12 80 Good 10.2136449800 null RED
48 B, G, R 3 12 80 Good 10.2136449800 null RED
49 B, G, R 3 12 80 Good 10.2136449800 null RED
50 B, G, R 3 12 80 Good 10.2136449800 null RED
xdangl diff_date
0 -0.1150000000 0
1 -0.1150000000 0
2 -0.1150000000 0
3 -0.1150000000 0
4 -0.1150000000 0
5 -0.1150000000 0
6 -0.1150000000 0
7 -0.1150000000 0
8 -0.1150000000 0
9 -0.1150000000 0
10 -0.1150000000 0
11 -0.1150000000 0
12 -0.1150000000 0
13 -0.1150000000 0
14 -0.1150000000 0
15 -0.1150000000 0
16 -0.1150000000 0
17 -0.1150000000 0
18 -0.1150000000 0
19 -0.1150000000 0
20 -0.1150000000 0
21 -0.1150000000 0
22 -0.1150000000 0
23 -0.1150000000 0
24 -0.1150000000 0
25 -0.1150000000 0
26 -0.1150000000 0
27 -0.1150000000 0
28 -0.1150000000 0
29 -0.1150000000 0
30 -0.1150000000 0
31 -0.1150000000 0
32 -0.1150000000 0
33 -0.1150000000 0
34 -0.1150000000 0
35 -0.1150000000 0
36 -0.1150000000 0
37 -0.1150000000 0
38 -0.1150000000 0
39 -0.1150000000 0
40 -0.1150000000 0
41 -0.1150000000 0
42 -0.1150000000 0
43 -0.1150000000 0
44 -0.1150000000 0
45 -0.1150000000 0
46 -0.1150000000 0
47 -0.1150000000 0
48 -0.1150000000 0
49 -0.1150000000 0
50 -0.1150000000 0
[51 rows x 46 columns]
The next query shows how a PI can login with their KOA credentials, assigned when the data were acquired, and access their protected data. The example is a query for public data to show the syntax. Please login with your KOA supplied credentials to access your private data. While logged in, you can access all public data as well. Koa.login creates the cookie file at login.
Koa.login ('./tapcookie.txt')
Userid: tapdemo Password: ········ Successfully login as tapdemo
Koa.query_datetime ('hires', \
'2018-08-07 00:00:00/2018-08-08 00:00:00', \
'./output/Aug8_login.tbl', overwrite=True,\
cookiepath='./tapcookie.txt' )
rec = Table.read ('output/Aug8_login.tbl', format='ascii.ipac')
print (rec)
submitting request...
Result downloaded to file [./output/Aug8_login.tbl]
koaid ... filehand
---------------------- ... -----------------------------------------------------
HI.20180807.00030.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00030.fits
HI.20180807.00075.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00075.fits
HI.20180807.00143.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00143.fits
HI.20180807.00189.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00189.fits
HI.20180807.00234.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00234.fits
HI.20180807.00280.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00280.fits
HI.20180807.00325.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00325.fits
HI.20180807.00396.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.00396.fits
HI.20180807.03511.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.03511.fits
HI.20180807.03732.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.03732.fits
... ... ...
HI.20180807.54915.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.54915.fits
HI.20180807.55025.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55025.fits
HI.20180807.55132.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55132.fits
HI.20180807.55281.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55281.fits
HI.20180807.55489.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55489.fits
HI.20180807.55597.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55597.fits
HI.20180807.55928.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.55928.fits
HI.20180807.56116.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56116.fits
HI.20180807.56256.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56256.fits
HI.20180807.56361.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56361.fits
HI.20180807.56427.fits ... /koadata13/HIRES/20180807/lev0/HI.20180807.56427.fits
Length = 159 rows
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