# script to get new set of quantities and generate CASA table from JPL-Horizon database # meant to run in 2 steps, retrieve the ascii data via email from JPL-Horizons # (dorequest=T and domakecastb=F), then manually save the email to the disk (copy to this directory) # then run this script second time with domakecastb=T (and dorequest=F) # Need to Juno and Pallas seperately # execution control (should do in two steps) #dorequest=True dorequest=False domakecasatb=True #domakecasatb=False #input file -- need to modify # see below now define inside for-loop #rawdata='mars-2010-2020.eml' #objects supported by CASA #ssobjs=['Venus','Mars','Jupiter','Uranus','Neptune','Io','Europa','Ganymede', # 'Callisto','Titan','Ceres','Juno','Pallas','Vesta'] ssobjs=['Saturn','Mercury','Pluto'] ### Following split juno and pallas for the rest is no longer necessary ### 2012-09-20 # without Juno and Pallas #ssobjs=['Venus','Mars','Jupiter','Uranus','Neptune','Io','Europa','Ganymede', # 'Callisto','Titan','Ceres','Vesta'] #ssobjs=['Juno','Pallas'] #ssobjs=['Vesta'] # JPL-Horizons quantities (reference: http://ssd.jpl.nasa.gov/?horizons#doc) # 1. Astrometric RA & DEC 15. Sun sub-long & sub-lat 29. Constellation ID # *2. Apparent RA & DEC 16. Sub Sun Pos. Ang & Dis 30. Delta-T (CT - UT) # 3. Rates; RA & DEC 17. N. Pole Pos. Ang & Dis *31. Obs eclip. lon & lat # *4. Apparent AZ & EL 18. Helio eclip. lon & lat 32. North pole RA & DEC # 5. Rates; AZ & EL 19. Helio range & rng rate 33. Galactic latitude # 6. Sat. X & Y, pos. ang 20. Obsrv range & rng rate 34. Local app. SOLAR time # 7. Local app. sid. time 21. One-Way Light-Time 35. Earth->Site lt-time # 8. Airmass 22. Speed wrt Sun & obsrvr >36. RA & DEC uncertainty # 9. Vis mag. & Surf Brt 23. Sun-Obsrvr-Target angl >37. POS error ellipse # 10. Illuminated fraction 24. Sun-Target-Obsrvr angl >38. POS uncertainty (RSS) # 11. Defect of illumin. 25. Targ-Obsrv-Moon/Illum% >39. Range & Rng-rate sig. # 12. Sat. angle separ/vis 26. Obsr-Primary-Targ angl >40. Doppler/delay sigmas # 13. Target angular diam. 27. Pos. Ang;radius & -vel # 14. Obs sub-lng & sub-lat 28. Orbit plane angle # current default in request.py #quantities = [2, 12, 17, 19, 20, 24] # bryans request = 1, 14,15,17,19,20,24 print "dorequest=",dorequest, " domakecasatb=",domakecasatb ret=raw_input('Proceed by hitting return') import recipes.ephemerides.request as jplreq # required parameters for new table ####### get_axis_orientation=False # no 32 get_axis_ang_orientation=True # 17 get_sub_long=True #14,15 use_apparent=False # 2->1 get_sep=False #no 12 date_incr='1d' ########################################### # changed: will the relevant columns in the casa table # with -999. in such case.... # # for Juno and Pallas no sub_long and NP ang/dist # info #get_axis_ang_orientation=False #get_sub_long=False ################################################ if dorequest: #jplreq.request_from_JPL('Titan',startdate='2011-04-21',enddate='2011-04-23',date_incr="1 d",return_address='ttsutsum@nrao.edu') #jplreq.request_from_JPL('Titan',startdate='2012-01-01',enddate='2012-08-31', # get Mars 2010-2020 #jplreq.request_from_JPL('Mars',startdate='2010-01-01',enddate='2020-12-31', date_incr=date_incr, # do for all objects supported in CASA for obj in ssobjs: print "requesting ephemerides for "+obj jplreq.request_from_JPL(objnam=obj,startdate='2010-01-01',enddate='2020-12-31', date_incr=date_incr, get_axis_orientation=get_axis_orientation, get_axis_ang_orientation=get_axis_ang_orientation, get_sub_long=get_sub_long, use_apparent=use_apparent, get_sep=get_sep, return_address='ttsutsum@nrao.edu') if domakecasatb: # uncomment below if full ssobjs list is used. # modify ssobjs list (excluded juno, pallas, since some columns are n.a. and the current reader # does not handle such entries) # #ssobjs.remove('Juno') #ssobjs.remove('Pallas') #print "removed Juno and Pallas from the ssobjs" for obj in ssobjs: #rawdata=obj.lower()+'-jpl-horizons-allcols-ephem.eml' rawdata=obj.lower()+'-jpl-horizons-ephem.eml' print "using input raw ephemeris data=", rawdata ret2=raw_input('Proceed?') if ret2=='n': print "Stop now..." break import recipes.ephemerides.JPLephem_reader as jplreader outdict=jplreader.readJPLephem(rawdata) trangestr=str(int(outdict['earliest']['m0']['value']))+'-'+str(int(outdict['latest']['m0']['value']))+'dUTC' outtbname='_'.join([outdict['NAME'],trangestr,'J2000.tab']) jplreader.ephem_dict_to_table(outdict,outtbname)