Skip to content
Snippets Groups Projects
Commit 8a0ff95f authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #3916: Added cos(dec) correction to ra for tied-array rings, to properly...

Task #3916: Added cos(dec) correction to ra for tied-array rings, to properly map the tied-array rings on the non-linear radec coordinate system.
parent 44b1c2f1
Branches
Tags
No related merge requests found
...@@ -202,11 +202,13 @@ class Parset(util.Parset.Parset): ...@@ -202,11 +202,13 @@ class Parset(util.Parset.Parset):
self.setdefault("Observation.Beam[%s].tabRingSize" % (b,),0.0) self.setdefault("Observation.Beam[%s].tabRingSize" % (b,),0.0)
dirtype = self["Observation.Beam[%s].directionType" % (b,)] dirtype = self["Observation.Beam[%s].directionType" % (b,)]
center_angle1 = float(self["Observation.Beam[%s].angle1" % (b,)])
center_angle2 = float(self["Observation.Beam[%s].angle2" % (b,)])
dm = int(self.get("OLAP.dispersionMeasure",0)) dm = int(self.get("OLAP.dispersionMeasure",0))
nrrings = int(self["Observation.Beam[%s].nrTabRings" % (b,)]) nrrings = int(self["Observation.Beam[%s].nrTabRings" % (b,)])
width = float(self["Observation.Beam[%s].tabRingSize" % (b,)]) width = float(self["Observation.Beam[%s].tabRingSize" % (b,)])
ringcoordinates = RingCoordinates( nrrings, width ) ringcoordinates = RingCoordinates( nrrings, width, (center_angle1, center_angle2), dirtype )
ringset = [ ringset = [
{ "angle1": angle1, { "angle1": angle1,
"angle2": angle2, "angle2": angle2,
......
#!/usr/bin/python #!/usr/bin/python
from math import sqrt from math import sqrt, cos, pi
class RingCoordinates: class RingCoordinates:
def __init__(self, numrings, width): def __init__(self, numrings, width, center, dirtype):
self.numrings = numrings self.numrings = numrings
self.width = width self.width = width
self.center = center
self.dirtype = dirtype
def cos_adjust(self, offset):
if dirtype != "J2000" and dirtype != "B1950":
return offset
# warp coordinates closer to the NCP
cos_dec = cos(self.center[1] + offset[1])
epsilon = 0.0001
if cos_dec > epsilon:
return (offset[0]/cos_dec, offset[1])
else:
return offset
def len_edge(self): def len_edge(self):
""" """
...@@ -120,5 +137,5 @@ class RingCoordinates: ...@@ -120,5 +137,5 @@ class RingCoordinates:
l += dl[side] l += dl[side]
m += dm[side] m += dm[side]
return coordinates return map(self.cos_adjust, coordinates)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment