Commit 55675362 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Fix pi usage in VOEvent building

parent da1e7c0a
...@@ -7,6 +7,7 @@ buildVOEvent: Creates a complex VOEvent with tables ...@@ -7,6 +7,7 @@ buildVOEvent: Creates a complex VOEvent with tables
See the VOEvent specification for details See the VOEvent specification for details
http://www.ivoa.net/Documents/latest/VOEvent.html http://www.ivoa.net/Documents/latest/VOEvent.html
""" """
import math
from VOEventLib.VOEvent import VOEvent, Who, Author, Param, How, What, Group from VOEventLib.VOEvent import VOEvent, Who, Author, Param, How, What, Group
from VOEventLib.VOEvent import Citations, EventIVORN from VOEventLib.VOEvent import Citations, EventIVORN
...@@ -375,7 +376,7 @@ def buildVOEvent(event, serial_number, voevent_type, request=None, skymap_filena ...@@ -375,7 +376,7 @@ def buildVOEvent(event, serial_number, voevent_type, request=None, skymap_filena
max_hrss = max(hrss_values) max_hrss = max(hrss_values)
# From Min-A Cho: fluence = pi*(c**3)*(freq**2)*(hrss_max**2)*(10**3)/(4*G) # From Min-A Cho: fluence = pi*(c**3)*(freq**2)*(hrss_max**2)*(10**3)/(4*G)
# Note that hrss here actually has units of s^(-1/2) # Note that hrss here actually has units of s^(-1/2)
pi = 3.14152 pi = math.pi
c = 2.99792E10 c = 2.99792E10
G = 6.674E-8 G = 6.674E-8
fluence = pi * pow(c,3) * pow(event.central_freq,2) fluence = pi * pow(c,3) * pow(event.central_freq,2)
...@@ -403,7 +404,7 @@ def buildVOEvent(event, serial_number, voevent_type, request=None, skymap_filena ...@@ -403,7 +404,7 @@ def buildVOEvent(event, serial_number, voevent_type, request=None, skymap_filena
# Note that hrss here actually has units of s^(-1/2) # Note that hrss here actually has units of s^(-1/2)
# XXX obviously need to refactor here. # XXX obviously need to refactor here.
try: try:
pi = 3.14152 pi = math.pi
c = 2.99792E10 c = 2.99792E10
G = 6.674E-8 G = 6.674E-8
fluence = pi * pow(c,3) * pow(event.frequency,2) fluence = pi * pow(c,3) * pow(event.frequency,2)
......
...@@ -7,6 +7,8 @@ buildVOEvent: Creates a complex VOEvent with tables ...@@ -7,6 +7,8 @@ buildVOEvent: Creates a complex VOEvent with tables
See the VOEvent specification for details See the VOEvent specification for details
http://www.ivoa.net/Documents/latest/VOEvent.html http://www.ivoa.net/Documents/latest/VOEvent.html
""" """
import math
from VOEventLib.VOEvent import VOEvent, Who, Author, Param, How, What, Group from VOEventLib.VOEvent import VOEvent, Who, Author, Param, How, What, Group
from VOEventLib.VOEvent import Citations, EventIVORN from VOEventLib.VOEvent import Citations, EventIVORN
...@@ -357,7 +359,7 @@ def construct_voevent_file(superevent, voevent, request=None, ...@@ -357,7 +359,7 @@ def construct_voevent_file(superevent, voevent, request=None,
max_hrss = max(hrss_values) max_hrss = max(hrss_values)
# From Min-A Cho: fluence = pi*(c**3)*(freq**2)*(hrss_max**2)*(10**3)/(4*G) # From Min-A Cho: fluence = pi*(c**3)*(freq**2)*(hrss_max**2)*(10**3)/(4*G)
# Note that hrss here actually has units of s^(-1/2) # Note that hrss here actually has units of s^(-1/2)
pi = 3.14152 pi = math.pi
c = 2.99792E10 c = 2.99792E10
G = 6.674E-8 G = 6.674E-8
fluence = pi * pow(c,3) * pow(event.central_freq,2) fluence = pi * pow(c,3) * pow(event.central_freq,2)
...@@ -386,7 +388,7 @@ def construct_voevent_file(superevent, voevent, request=None, ...@@ -386,7 +388,7 @@ def construct_voevent_file(superevent, voevent, request=None,
# Note that hrss here actually has units of s^(-1/2) # Note that hrss here actually has units of s^(-1/2)
# XXX obviously need to refactor here. # XXX obviously need to refactor here.
try: try:
pi = 3.14152 pi = math.pi
c = 2.99792E10 c = 2.99792E10
G = 6.674E-8 G = 6.674E-8
fluence = pi * pow(c,3) * pow(event.frequency,2) fluence = pi * pow(c,3) * pow(event.frequency,2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment