def flushPrint (tMin, tMax, poldata): print 'Start/end times:', util.jdToFull (tMin), ';', util.jdToFull (tMax) print 'Duration:', (tMax - tMin) * 24 * 60, 'min' pols = sorted (poldata.iterkeys (), key=lambda p: abs (p)) for pol in pols: pname = util.polarizationName (pol) mreal, mimag, amp, uamp, phdeg, uphdeg, count = poldata[pol] print '%s: real %f, imag %f, amp %f (+- %f), ph %f deg (+- %f) (%d items)' % \ (pname, mreal, mimag, amp, uamp, phdeg, uphdeg, count)
def flushPrint(tMin, tMax, poldata): print 'Start/end times:', util.jdToFull(tMin), ';', util.jdToFull(tMax) print 'Duration:', (tMax - tMin) * 24 * 60, 'min' pols = sorted(poldata.iterkeys(), key=lambda p: abs(p)) for pol in pols: pname = util.polarizationName(pol) mreal, mimag, amp, uamp, phdeg, uphdeg, count = poldata[pol] print '%s: real %f, imag %f, amp %f (+- %f), ph %f deg (+- %f) (%d items)' % \ (pname, mreal, mimag, amp, uamp, phdeg, uphdeg, count)
def toText(self, stream): print >> stream, 'interval %.18e' % self.interval print >> stream, 'nfeeds', self.nfeeds print >> stream, 'nants', self.nants print >> stream, 'havetau', int(self.havetau) q = self.nfeeds + int(self.havetau) for i, time in enumerate(self.times): print >> stream, 'solution', util.jdToFull(time) d = self.data[i] for ant in xrange(self.nants): ofs = ant * q for k in xrange(self.nfeeds): g = d[ofs + k] if abs(g) > 0: print >>stream, '%2d g%d %+.18e %+.18e' % \ (ant + 1, k + 1, g.real, g.imag) if self.havetau: print >>stream, '%2d tau %+.18e %+.18e' % \ (ant + 1, d[ofs+self.nfeeds].real, d[ofs+self.nfeeds].imag) return self
def toText (self, stream): print >>stream, 'interval %.18e' % self.interval print >>stream, 'nfeeds', self.nfeeds print >>stream, 'nants', self.nants print >>stream, 'havetau', int (self.havetau) q = self.nfeeds + int (self.havetau) for i, time in enumerate (self.times): print >>stream, 'solution', util.jdToFull (time) d = self.data[i] for ant in xrange (self.nants): ofs = ant * q for k in xrange (self.nfeeds): g = d[ofs + k] if abs (g) > 0: print >>stream, '%2d g%d %+.18e %+.18e' % \ (ant + 1, k + 1, g.real, g.imag) if self.havetau: print >>stream, '%2d tau %+.18e %+.18e' % \ (ant + 1, d[ofs+self.nfeeds].real, d[ofs+self.nfeeds].imag) return self
def plot (self): import omega as om p = om.RectPlot () dt = (np.asarray (self.times) - self.times[0]) * 24. print 'Base time is', util.jdToFull (self.times[0]) for pol, amps in self.amps.iteritems (): us = self.ampus[pol] p.addXYErr (dt, amps, us, util.polarizationName (pol), lines=False) #p.setBounds (ymin=0) p.setLabels ('Relative Time (hr)', 'Flux Density (Jy)') return p
def plot(self): import omega as om p = om.RectPlot() dt = (np.asarray(self.times) - self.times[0]) * 24. print 'Base time is', util.jdToFull(self.times[0]) for pol, amps in self.amps.iteritems(): us = self.ampus[pol] p.addXYErr(dt, amps, us, util.polarizationName(pol), lines=False) #p.setBounds (ymin=0) p.setLabels('Relative Time (hr)', 'Flux Density (Jy)') return p