Skip to content
Snippets Groups Projects
Commit c9b6774e authored by Francesco Pannarale's avatar Francesco Pannarale
Browse files

Correcting radians to degree conversion of right ascension and declination in...

Correcting radians to degree conversion of right ascension and declination in prepare_condor_many_plots.py

git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@108 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent 3f88eca1
No related branches found
No related tags found
No related merge requests found
......@@ -84,18 +84,16 @@ def GetRADec(jobDirName, PWD):
job_index = int(job_index) + 1 # adding +1 because command 'tail' (used below) requires non-zero index
longitude = subprocess.Popen(["lwtprint "+str(m1)+"_"+str(m2)+".xml -t sim_inspiralgroup:sim_inspiral -c longitude | tail -n"+str(job_index)+" | head -n1"], stdout=subprocess.PIPE, shell=True).communicate()[0].rstrip()
latitude = subprocess.Popen(["lwtprint "+str(m1)+"_"+str(m2)+".xml -t sim_inspiralgroup:sim_inspiral -c latitude | tail -n"+str(job_index)+"| head -n1"], stdout=subprocess.PIPE, shell=True).communicate()[0].rstrip()
longitude = subprocess.Popen(["lwtprint "+str(m1)+"_"+str(m2)+".xml -t sim_inspiralgroup:sim_inspiral -c longitude | head -n"+str(job_index)+" | tail -n1"], stdout=subprocess.PIPE, shell=True).communicate()[0].rstrip()
latitude = subprocess.Popen(["lwtprint "+str(m1)+"_"+str(m2)+".xml -t sim_inspiralgroup:sim_inspiral -c latitude | head -n"+str(job_index)+"| tail -n1"], stdout=subprocess.PIPE, shell=True).communicate()[0].rstrip()
#Converting from radians to degrees
if longitude < 0:
ra = 360. - float(longitude)*180./math.pi
longitude_deg = float(longitude)*180./math.pi
if longitude_deg > 180:
ra = longitude_deg - 360.
else:
ra = float(longitude)*180./math.pi
if latitude < 0:
dec = 360. - float(latitude)*180./math.pi
else:
dec = float(latitude)*180./math.pi
ra = longitude_deg
dec = float(latitude)*180./math.pi
return (ra, dec)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment