Page History
...
The catalogs API can be used to do this same query with a single curl command. Here is a sample command that cross-matches the PS1 catalog with a list of positions in the file sn2005.csv:
Code Block | ||||
---|---|---|---|---|
| ||||
curl -F radius=0.000833 -F 'file=@sn2005.csv' -X POST https://catalogs.mast.stsci.edu/api/v0.1/panstarrs/mean/crossmatch/upload.csv > sn2005.ps1.csv |
...
Code Block | ||
---|---|---|
| ||
ra,dec,name 37.68021,-2.93883,SN 2005A 268.70342,71.54292,SN 2005B 168.87258,60.75153,SN 2005C |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
import requests r = 0.000833 # radius in degrees filename = 'sn2005.csv' url = 'https://catalogs.mast.stsci.edu/api/v0.1/panstarrs/mean/crossmatch/upload.csv' r = requests.post(url, params=dict(radius=r), files=dict(file=open(filename,'rb'))) print(r.text, end='') # print output without trailing newline |
...