diff --git a/RTCP/Run/src/LOFAR/Parset.py b/RTCP/Run/src/LOFAR/Parset.py index 8a3ac9e36ff3d5bbc639d4069cc3033639f6f527..de3445852ba486a9ccbd94b957b2c15a79ceaa42 100644 --- a/RTCP/Run/src/LOFAR/Parset.py +++ b/RTCP/Run/src/LOFAR/Parset.py @@ -202,11 +202,13 @@ class Parset(util.Parset.Parset): self.setdefault("Observation.Beam[%s].tabRingSize" % (b,),0.0) 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)) nrrings = int(self["Observation.Beam[%s].nrTabRings" % (b,)]) width = float(self["Observation.Beam[%s].tabRingSize" % (b,)]) - ringcoordinates = RingCoordinates( nrrings, width ) + ringcoordinates = RingCoordinates( nrrings, width, (center_angle1, center_angle2), dirtype ) ringset = [ { "angle1": angle1, "angle2": angle2, diff --git a/RTCP/Run/src/LOFAR/RingCoordinates.py b/RTCP/Run/src/LOFAR/RingCoordinates.py index fc82d772aeae918391742c7ecfa355b0b4ec8d6a..02e52a3c2d1ffa9898b6f72f826d47ff1cac33dc 100644 --- a/RTCP/Run/src/LOFAR/RingCoordinates.py +++ b/RTCP/Run/src/LOFAR/RingCoordinates.py @@ -1,11 +1,28 @@ #!/usr/bin/python -from math import sqrt +from math import sqrt, cos, pi class RingCoordinates: - def __init__(self, numrings, width): + def __init__(self, numrings, width, center, dirtype): self.numrings = numrings 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): """ @@ -120,5 +137,5 @@ class RingCoordinates: l += dl[side] m += dm[side] - return coordinates + return map(self.cos_adjust, coordinates)