Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
themeEmacs
>>> import pyvo as vo
>>> import astropy
>>> 
>>> pos = astropy.coordinates.SkyCoord(84.0, -70.0, unit='deg') # search position
>>> size = astropy.coordinates.Angle(1.0, unit='deg') # search radius
>>> 
>>> sia_service = vo.dal.SIAService('https://data.kasi.re.kr/vo/api/miris/sia_v1') # SIA API
>>> sia_results = sia_service.search(pos=pos, size=size) # search results in the format of https://pyvo.readthedocs.io/en/latest/api/pyvo.dal.SIAResults.html#pyvo.dal.SIAResults
>>> 
>>> sia_results
<Table length=11>
dataproduct_type obs_collection target_name    s_ra     s_dec     Dim  Bandpass   Format                              Url                           
                                               deg       deg                                                                                        
     object          object        object    float64   float64   int32  object    object                             object                         
---------------- -------------- ----------- --------- ---------- ----- -------- ---------- ---------------------------------------------------------
           image          MIRIS       LMC a 84.083792 -70.450578     2     PAAL image/fits https://archive.kasi.re.kr/miris/201410/MS1412446136.fits
           image          MIRIS       LMC a 84.086609 -70.454108     2     PAAL image/fits https://archive.kasi.re.kr/miris/201410/MS1413312122.fits
           image          MIRIS       LMC a 84.069085 -70.455493     2     PAAC image/fits https://archive.kasi.re.kr/miris/201410/MS1413358623.fits
           image          MIRIS       LMC a  84.08105 -70.460115     2     PAAL image/fits https://archive.kasi.re.kr/miris/201410/MS1413317934.fits
           image          MIRIS       LMC a 84.095598 -70.460426     2     PAAC image/fits https://archive.kasi.re.kr/miris/201410/MS1412451951.fits
           image          MIRIS       LMC a 84.049578 -70.461393     2     PAAL image/fits https://archive.kasi.re.kr/miris/201410/MS1412440324.fits
           image          MIRIS       LMC a 84.107628 -70.461639     2     PAAL image/fits https://archive.kasi.re.kr/miris/201410/MS1412434511.fits
           image          MIRIS       LMC a 84.095563 -70.462757     2     PAAC image/fits https://archive.kasi.re.kr/miris/201410/MS1412498451.fits
           image          MIRIS       LMC a 84.091313 -70.463528     2     PAAC image/fits https://archive.kasi.re.kr/miris/201410/MS1413364435.fits
           image          MIRIS       LMC a 84.103507 -70.463404     2        I image/fits https://archive.kasi.re.kr/miris/201410/MS1412504257.fits
           image          MIRIS       LMC a 84.117384  -70.46529     2     PAAC image/fits https://archive.kasi.re.kr/miris/201410/MS1412492638.fits

>>> sia_results[0]
('image', 'MIRIS', 'LMC a', 84.083792, -70.450578, 2, 'PAAL', 'image/fits', 'https://archive.kasi.re.kr/miris/201410/MS1412446136.fits')
>>> sia_results[0]['Url']
'https://archive.kasi.re.kr/miris/201410/MS1412446136.fits'
>>> 
>>> img_file = astropy.utils.data.download_file(sia_results[0]['Url'], cache=True)
Downloading https://archive.kasi.re.kr/miris/201410/MS1412446136.fits
|===================================================================================================================| 1.2M/1.2M (100.00%)         0s
>>> img_data = astropy.io.fits.getdata(img_file)

...