• Wiki
  • View Tickets
  • Search

VODesktop2008beta-doc/VOdesktopUsage/ScienceE2EJets: conesearch_hst.py

File conesearch_hst.py, 1.1 kB (added by eglez, 10 months ago)
Line 
1 #!/usr/bin/python
2
3 import os, time
4 from optparse import OptionParser
5 from astrogrid import acr, sesame
6 from astrogrid import SiapSearch
7
8 # Read command line arguments
9 parser = OptionParser()
10 parser.add_option("-b", "--broadcast", action='store_true', default=False)
11 (options, args) = parser.parse_args()
12
13 # If we are going to send the tables to TOPCAT then start the plastic hub
14 if options.broadcast:
15         acr.startplastic()
16         time.sleep(2)
17
18 # Define list of objects
19 objects=['HH111', 'HH30', 'HH211', 'HH47', 'M16', 'Trifid', 'HH524',
20          'Sigma Orionis', 'DG Tau', 'HL Tau', 'M16', 'IRAS 04302+2247']
21
22 # Define the name resolver service
23 s = sesame()
24
25 # Define the endpoint of the search service
26 siap = SiapSearch('ivo://cadc.nrc.ca/siap/hst')
27
28 # Create output directory if it does not exist
29 if not os.path.isdir('hst'):
30         os.mkdir('hst')
31
32 # Loop for each object
33 for obj in objects:
34         coords, ra, dec = s.resolve(obj)
35         ofile = 'hst/%s.vot' % obj.replace(' ','_').replace('+','p')
36         if not os.access(ofile, os.F_OK):
37                 res = siap.execute(ra, dec, 30.0/3600.0, 0.01)
38                 open(ofile,'w').write(res)
39         if options.broadcast:
40                 acr.plastic.broadcast(ofile, 'TOPCAT')
41
42        

Download in other formats:

  • Original Format
  • Login
  • Settings
  • Help/Guide
  • About Trac

Copyright by the contributing authors. All material on this collaboration platform is the property of the contributing authors