Build: #135 was successful

Job: Build and Package RHEL6 was successful

Stages & jobs

  1. Default Stage

Build log

The build generated 2,052 lines of output.The output is too long and has been truncated to the last 1,000 lines. Download or view full build log.

29-Aug-2019 15:55:08 +                        casalog.post("Exclude selection error: " + errmsg, "ERROR")
29-Aug-2019 15:55:08 +                        return
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                telescope, names, ids, xpos, ypos, stations = getPlotantsAntennaInfo(vis,
29-Aug-2019 15:55:08 +                        logpos, exclude, checkbaselines)
29-Aug-2019 15:55:08 +                if not names:
29-Aug-2019 15:55:08 +                        casalog.post("No antennas selected.  Exiting plotants.", "ERROR")
29-Aug-2019 15:55:08 +                        return
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                if not title:
29-Aug-2019 15:55:08 +                        msname = os.path.basename(vis)
29-Aug-2019 15:55:08 +                        title = "Antenna Positions for "
29-Aug-2019 15:55:08 +                        if len(msname) > 55:
29-Aug-2019 15:55:08 +                                title += '\n'
29-Aug-2019 15:55:08 +                        title += msname
29-Aug-2019 15:55:08 +                pl.title(title, {'fontsize':12})
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                if logpos:
29-Aug-2019 15:55:08 +                        plotAntennasLog(telescope, names, ids, xpos, ypos, antindex, stations)
29-Aug-2019 15:55:08 +                else:
29-Aug-2019 15:55:08 +                        plotAntennas(telescope, names, ids, xpos, ypos, antindex, stations, showgui)
29-Aug-2019 15:55:08 +                if figfile:
29-Aug-2019 15:55:08 +                        pl.savefig(figfile)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        except Exception as instance:
29-Aug-2019 15:55:08 +                casalog.post("Error: " + str(instance), "ERROR")
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +def getPlotantsAntennaInfo(msname, log, exclude, checkbaselines):
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        tb = table( )
29-Aug-2019 15:55:08 +        me = measures( )
29-Aug-2019 15:55:08 +        qa = quanta( )
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        telescope, arrayPos = getPlotantsObservatoryInfo(msname)
29-Aug-2019 15:55:08 +        arrayWgs84 = me.measure(arrayPos, 'WGS84')
29-Aug-2019 15:55:08 +        arrayLon, arrayLat, arrayAlt = [arrayWgs84[i]['value']
29-Aug-2019 15:55:08 +                for i in ['m0','m1','m2']]
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # Open the ANTENNA subtable to get the names of the antennas in this MS and
29-Aug-2019 15:55:08 +        # their positions.  Note that the entries in the ANTENNA subtable are pretty
29-Aug-2019 15:55:08 +        # much in random order, so antNames translates between their index and name
29-Aug-2019 15:55:08 +        # (e.g., index 11 = STD155).  We'll need these indices for later, since the
29-Aug-2019 15:55:08 +        # main data table refers to the antennas by their indices, not names.
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        anttabname = msname + '/ANTENNA'
29-Aug-2019 15:55:08 +        tb.open(anttabname)
29-Aug-2019 15:55:08 +        # Get antenna names from antenna table
29-Aug-2019 15:55:08 +        antNames = np.array(tb.getcol("NAME")).tolist()
29-Aug-2019 15:55:08 +        stationNames = np.array(tb.getcol("STATION")).tolist()
29-Aug-2019 15:55:08 +        if telescope == 'VLBA':  # names = ant@station
29-Aug-2019 15:55:08 +                antNames = ['@'.join(antsta) for antsta in zip(antNames,stationNames)]
29-Aug-2019 15:55:08 +        # Get antenna positions from antenna table
29-Aug-2019 15:55:08 +        antPositions = np.array([me.position('ITRF', qa.quantity(x, 'm'),
29-Aug-2019 15:55:08 +                qa.quantity(y, 'm'), qa.quantity(z, 'm'))
29-Aug-2019 15:55:08 +                for (x, y, z) in tb.getcol('POSITION').transpose()])
29-Aug-2019 15:55:08 +        tb.close()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        allAntIds = range(len(antNames))
29-Aug-2019 15:55:08 +        if checkbaselines:
29-Aug-2019 15:55:08 +                # Get antenna ids from main table; this will add to runtime
29-Aug-2019 15:55:08 +                tb.open(msname)
29-Aug-2019 15:55:08 +                ants1 = tb.getcol('ANTENNA1')
29-Aug-2019 15:55:08 +                ants2 = tb.getcol('ANTENNA2')
29-Aug-2019 15:55:08 +                tb.close()
29-Aug-2019 15:55:08 +                antIdsUsed = list(set(np.append(ants1, ants2)))
29-Aug-2019 15:55:08 +        else:
29-Aug-2019 15:55:08 +                # use them all!
29-Aug-2019 15:55:08 +                antIdsUsed = allAntIds
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # handle exclude -- remove from antIdsUsed
29-Aug-2019 15:55:08 +        for antId in exclude:
29-Aug-2019 15:55:08 +                try:
29-Aug-2019 15:55:08 +                        antNameId = antNames[antId] + " (id " + str(antId) + ")"
29-Aug-2019 15:55:08 +                        antIdsUsed.remove(antId)
29-Aug-2019 15:55:08 +                        casalog.post("Exclude antenna " + antNameId)
29-Aug-2019 15:55:08 +                except ValueError:
29-Aug-2019 15:55:08 +                        casalog.post("Cannot exclude antenna " + antNameId + ": not in main table", "WARN")
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # apply antIdsUsed mask
29-Aug-2019 15:55:08 +        antNames = [antNames[i] for i in antIdsUsed]
29-Aug-2019 15:55:08 +        antPositions = [antPositions[i] for i in antIdsUsed]
29-Aug-2019 15:55:08 +        stationNames = [stationNames[i] for i in antIdsUsed]
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        nAnts = len(antIdsUsed)
29-Aug-2019 15:55:08 +        print("Number of points being plotted:", nAnts)
29-Aug-2019 15:55:08 +        casalog.post("Number of points being plotted: " + str(nAnts))
29-Aug-2019 15:55:08 +        if nAnts == 0: # excluded all antennas
29-Aug-2019 15:55:08 +                return telescope, antNames, [], [], []
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # Get the names, indices, and lat/lon/alt coords of "good" antennas.
29-Aug-2019 15:55:08 +        antWgs84s = np.array([me.measure(pos, 'WGS84') for pos in antPositions])
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # Convert from lat, lon, alt to X, Y, Z (unless VLBA)
29-Aug-2019 15:55:08 +        # where X is east, Y is north, Z is up,
29-Aug-2019 15:55:08 +        # and 0, 0, 0 is the center
29-Aug-2019 15:55:08 +        # Note: this conversion is NOT exact, since it doesn't take into account
29-Aug-2019 15:55:08 +        # Earth's ellipticity!  But it's close enough.
29-Aug-2019 15:55:08 +        if telescope == 'VLBA' and not log:
29-Aug-2019 15:55:08 +                antLons, antLats = [[pos[i] for pos in antWgs84s] for i in ['m0','m1']]
29-Aug-2019 15:55:08 +                antXs = [qa.convert(lon, 'deg')['value'] for lon in antLons]
29-Aug-2019 15:55:08 +                antYs = [qa.convert(lat, 'deg')['value'] for lat in antLats]
29-Aug-2019 15:55:08 +        else:
29-Aug-2019 15:55:08 +                antLons, antLats = [np.array( [pos[i]['value']
29-Aug-2019 15:55:08 +                        for pos in antWgs84s]) for i in ['m0','m1']]
29-Aug-2019 15:55:08 +                radE = 6370000.
29-Aug-2019 15:55:08 +                antXs = (antLons - arrayLon) * radE * np.cos(arrayLat)
29-Aug-2019 15:55:08 +                antYs = (antLats - arrayLat) * radE
29-Aug-2019 15:55:08 +        return telescope, antNames, antIdsUsed, antXs, antYs, stationNames
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +def getPlotantsObservatoryInfo(msname):
29-Aug-2019 15:55:08 +        metadata = msmetadata()
29-Aug-2019 15:55:08 +        metadata.open(msname)
29-Aug-2019 15:55:08 +        telescope = metadata.observatorynames()[0]
29-Aug-2019 15:55:08 +        arrayPos = metadata.observatoryposition()
29-Aug-2019 15:55:08 +        metadata.close()
29-Aug-2019 15:55:08 +        return telescope, arrayPos
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +def getAntennaLabelProps(telescope, station, log=False):
29-Aug-2019 15:55:08 +        # CAS-7120 make plots more readable (rotate labels)
29-Aug-2019 15:55:08 +        vAlign = 'center'
29-Aug-2019 15:55:08 +        hAlign = 'left'
29-Aug-2019 15:55:08 +        rotAngle = 0
29-Aug-2019 15:55:08 +        if station and "VLA" in telescope:
29-Aug-2019 15:55:08 +                # these have non-standard format:
29-Aug-2019 15:55:08 +                # strip off VLA: or VLA:_ prefix if any
29-Aug-2019 15:55:08 +                if 'VLA:' in station:
29-Aug-2019 15:55:08 +                        station = station[4:]
29-Aug-2019 15:55:08 +                if station[0] == '_':
29-Aug-2019 15:55:08 +                        station = station[1:]
29-Aug-2019 15:55:08 +                if station in ['W01', 'E01', 'W1', 'E1']:
29-Aug-2019 15:55:08 +                        vAlign = 'top'
29-Aug-2019 15:55:08 +                        hAlign = 'center'
29-Aug-2019 15:55:08 +                else:
29-Aug-2019 15:55:08 +                        vAlign = 'bottom'
29-Aug-2019 15:55:08 +                        if 'W' in station or 'MAS' in station:
29-Aug-2019 15:55:08 +                                hAlign = 'right'
29-Aug-2019 15:55:08 +                                rotAngle = -35
29-Aug-2019 15:55:08 +                        elif 'E' in station or ('N' in station and not log):
29-Aug-2019 15:55:08 +                                rotAngle = 35
29-Aug-2019 15:55:08 +        return vAlign, hAlign, rotAngle
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +def plotAntennasLog(telescope, names, ids, xpos, ypos, antindex, stations):
29-Aug-2019 15:55:08 +        fig = pl.figure(1)
29-Aug-2019 15:55:08 +        # Set up subplot.
29-Aug-2019 15:55:08 +        ax = fig.add_subplot(1, 1, 1, polar=True, projection='polar')
29-Aug-2019 15:55:08 +        ax.set_theta_zero_location('N')
29-Aug-2019 15:55:08 +        ax.set_theta_direction(-1)
29-Aug-2019 15:55:08 +        # Do not show azimuth labels.
29-Aug-2019 15:55:08 +        ax.set_xticklabels([])
29-Aug-2019 15:55:08 +        ax.set_yticklabels([])
29-Aug-2019 15:55:08 +        # Do not show grid.
29-Aug-2019 15:55:08 +        ax.grid(False)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # code from pipeline summary.py
29-Aug-2019 15:55:08 +        # PlotAntsChart draw_polarlog_ant_map_in_subplot
29-Aug-2019 15:55:08 +        if 'VLA' in telescope:
29-Aug-2019 15:55:08 +                # For (E)VLA, set a fixed local center position that has been
29-Aug-2019 15:55:08 +                # tuned to work well for its array configurations (CAS-7479).
29-Aug-2019 15:55:08 +                xcenter, ycenter = -32, 0
29-Aug-2019 15:55:08 +                rmin_min, rmin_max = 12.5, 350
29-Aug-2019 15:55:08 +        else:
29-Aug-2019 15:55:08 +                # For non-(E)VLA, take the median of antenna offsets as the
29-Aug-2019 15:55:08 +                # center for the plot.
29-Aug-2019 15:55:08 +                xcenter = np.median(xpos)
29-Aug-2019 15:55:08 +                ycenter = np.median(ypos)
29-Aug-2019 15:55:08 +                rmin_min, rmin_max = 3, 350
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # Derive radial offset w.r.t. center position.
29-Aug-2019 15:55:08 +        r = ((xpos-xcenter)**2 + (ypos-ycenter)**2)**0.5
29-Aug-2019 15:55:08 +        # Set rmin, clamp between a min and max value, ignore station
29-Aug-2019 15:55:08 +        # at r=0 if one is there.
29-Aug-2019 15:55:08 +        rmin = min(rmin_max, max(rmin_min, 0.8*np.min(r[r > 0])))
29-Aug-2019 15:55:08 +        # Update r to move any points below rmin to r=rmin.
29-Aug-2019 15:55:08 +        r[r <= rmin] = rmin
29-Aug-2019 15:55:08 +        rmin = np.log(rmin)
29-Aug-2019 15:55:08 +        # Set rmax.
29-Aug-2019 15:55:08 +        rmax = np.log(1.5*np.max(r))
29-Aug-2019 15:55:08 +        # Derive angle of offset w.r.t. center position.
29-Aug-2019 15:55:08 +        theta = np.arctan2(xpos-xcenter, ypos-ycenter)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # Draw circles at specific distances from the center.
29-Aug-2019 15:55:08 +        angles = np.arange(0, 2.01*np.pi, 0.01*np.pi)
29-Aug-2019 15:55:08 +        show_circle = True
29-Aug-2019 15:55:08 +        circles = [30, 100, 300, 1000, 3000, 10000]
29-Aug-2019 15:55:08 +        if telescope == "VLBA":
29-Aug-2019 15:55:08 +                circles = [1e5, 3e5, 1e6, 3e6, 1e7]
29-Aug-2019 15:55:08 +        for cr in circles:
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                # Only draw circles outside rmin.
29-Aug-2019 15:55:08 +                if cr > np.min(r) and show_circle:
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                        # Draw the circle.
29-Aug-2019 15:55:08 +                        radius = np.ones(len(angles))*np.log(cr)
29-Aug-2019 15:55:08 +                        ax.plot(angles, radius, 'k:')
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                        # Draw tick marks on the circle at 1 km intervals.
29-Aug-2019 15:55:08 +                        inc = 0.1*10000/cr
29-Aug-2019 15:55:08 +                        if telescope == "VLBA":
29-Aug-2019 15:55:08 +                                inc = 0.1*1e8/cr
29-Aug-2019 15:55:08 +                        if cr > 100:
29-Aug-2019 15:55:08 +                                for angle in np.arange(inc/2., 2*np.pi+0.05, inc):
29-Aug-2019 15:55:08 +                                        ax.plot([angle, angle],
29-Aug-2019 15:55:08 +                                                           [np.log(0.95*cr), np.log(1.05*cr)], 'k-')
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                        # Add text label to circle to denote distance from center.
29-Aug-2019 15:55:08 +                        va = 'top'
29-Aug-2019 15:55:08 +                        circle_label_angle = -20.0 * np.pi / 180.
29-Aug-2019 15:55:08 +                        if cr >= 1000:
29-Aug-2019 15:55:08 +                                if np.log(cr) < rmax:
29-Aug-2019 15:55:08 +                                        ax.text(circle_label_angle, np.log(cr),
29-Aug-2019 15:55:08 +                                                           '%d km' % (cr/1000), size=8, va=va)
29-Aug-2019 15:55:08 +                                        ax.text(circle_label_angle + np.pi, np.log(cr),
29-Aug-2019 15:55:08 +                                                           '%d km' % (cr / 1000), size=8, va=va)
29-Aug-2019 15:55:08 +                        else:
29-Aug-2019 15:55:08 +                                ax.text(circle_label_angle, np.log(cr), '%dm' % (cr),
29-Aug-2019 15:55:08 +                                        size=8, va=va)
29-Aug-2019 15:55:08 +                                ax.text(circle_label_angle + np.pi, np.log(cr),
29-Aug-2019 15:55:08 +                                                '%dm' % (cr), size=8, va=va)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +                # Find out if most recently drawn circle was outside all antennas,
29-Aug-2019 15:55:08 +                # if so, no more circles will be drawn.
29-Aug-2019 15:55:08 +                if np.log(cr) > rmax:
29-Aug-2019 15:55:08 +                        show_circle = False
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # plot points and antenna names/ids
29-Aug-2019 15:55:08 +        for i, (name, station) in enumerate(zip(names, stations)):
29-Aug-2019 15:55:08 +                if station and 'OUT' not in station:
29-Aug-2019 15:55:08 +                        ax.plot(theta[i], np.log(r[i]), 'ko', ms=5, mfc='r')
29-Aug-2019 15:55:08 +                        if antindex:
29-Aug-2019 15:55:08 +                                name += ' (' + str(ids[i]) + ')'
29-Aug-2019 15:55:08 +                        # set alignment and rotation angle (for VLA)
29-Aug-2019 15:55:08 +                        valign, halign, angle = getAntennaLabelProps(telescope, station, log=True)
29-Aug-2019 15:55:08 +                        # adjust so text is not on the circle:
29-Aug-2019 15:55:08 +                        yoffset = 0
29-Aug-2019 15:55:08 +                        if halign is 'center':
29-Aug-2019 15:55:08 +                                yoffset = 0.1
29-Aug-2019 15:55:08 +                        ax.text(theta[i], np.log(r[i])+yoffset, ' '+name, size=8, va=valign, ha=halign,
29-Aug-2019 15:55:08 +                                rotation=angle, weight='semibold')
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # Set minimum and maximum radius.
29-Aug-2019 15:55:08 +        ax.set_rmax(rmax)
29-Aug-2019 15:55:08 +        ax.set_rmin(rmin)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # Make room for 2-line title
29-Aug-2019 15:55:08 +        pl.subplots_adjust(top=0.88)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +def plotAntennas(telescope, names, ids, xpos, ypos, antindex, stations, showplot):
29-Aug-2019 15:55:08 +        fig = pl.figure(1)
29-Aug-2019 15:55:08 +        ax = fig.add_subplot(111)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        if telescope == 'VLBA':
29-Aug-2019 15:55:08 +                labelx = 'Longitude (deg)'
29-Aug-2019 15:55:08 +                labely = 'Latitude (deg)'
29-Aug-2019 15:55:08 +        else:
29-Aug-2019 15:55:08 +                # use m or km units
29-Aug-2019 15:55:08 +                units = ' (m)'
29-Aug-2019 15:55:08 +                if np.median(xpos) > 1e6 or np.median(ypos) > 1e6:
29-Aug-2019 15:55:08 +                        xpos /= 1e3
29-Aug-2019 15:55:08 +                        ypos /= 1e3
29-Aug-2019 15:55:08 +                        units = ' (km)'
29-Aug-2019 15:55:08 +                labelx = 'X' + units
29-Aug-2019 15:55:08 +                labely = 'Y' + units
29-Aug-2019 15:55:08 +        if "VLA" in telescope:
29-Aug-2019 15:55:08 +                spacer = ' '
29-Aug-2019 15:55:08 +        else:
29-Aug-2019 15:55:08 +                spacer = '  '
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # plot points and antenna names/ids
29-Aug-2019 15:55:08 +        for i, (x, y, name, station) in enumerate(zip(xpos, ypos, names, stations)):
29-Aug-2019 15:55:08 +                if station and 'OUT' not in station:
29-Aug-2019 15:55:08 +                        ax.plot(x, y, 'ro')
29-Aug-2019 15:55:08 +                        if antindex:
29-Aug-2019 15:55:08 +                                name += ' (' + str(ids[i]) + ')'
29-Aug-2019 15:55:08 +                        # set alignment and rotation angle (for VLA)
29-Aug-2019 15:55:08 +                        valign, halign, angle = getAntennaLabelProps(telescope, station)
29-Aug-2019 15:55:08 +                        # adjust so text is not on the circle:
29-Aug-2019 15:55:08 +                        if halign is 'center':
29-Aug-2019 15:55:08 +                                y -= 10
29-Aug-2019 15:55:08 +                        ax.text(x, y, ' '+name, size=8, va=valign, ha=halign, rotation=angle,
29-Aug-2019 15:55:08 +                                weight='semibold')
29-Aug-2019 15:55:08 +                        if showplot:
29-Aug-2019 15:55:08 +                                fig.show()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        pl.xlabel(labelx)
29-Aug-2019 15:55:08 +        pl.ylabel(labely)
29-Aug-2019 15:55:08 +        pl.margins(0.1, 0.1)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 diff --git a/src/tasks/task_plotweather.py b/src/tasks/task_plotweather.py
29-Aug-2019 15:55:08 new file mode 100644
29-Aug-2019 15:55:08 index 0000000..1d85266
29-Aug-2019 15:55:08 --- /dev/null
29-Aug-2019 15:55:08 +++ b/src/tasks/task_plotweather.py
29-Aug-2019 15:55:08 @@ -0,0 +1,385 @@
29-Aug-2019 15:55:08 +###############################################
29-Aug-2019 15:55:08 +## To plot stuff in weather tables, saved to MSname+.plotWX.png
29-Aug-2019 15:55:08 +## and estimate zenith opacity per spw, returned as a list named myTau
29-Aug-2019 15:55:08 +##
29-Aug-2019 15:55:08 +##
29-Aug-2019 15:55:08 +## J. Marvil 2.6.12
29-Aug-2019 15:55:08 +## revised 4.27.12 to add support for missing/empty weather table
29-Aug-2019 15:55:08 +## revised 11.05.12 to address CASA 4.0 changes
29-Aug-2019 15:55:08 +###############################################
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +from __future__ import absolute_import
29-Aug-2019 15:55:08 +# get is_CASA6 and is_python3
29-Aug-2019 15:55:08 +from casatasks.private.casa_transition import is_CASA6
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +if is_CASA6:
29-Aug-2019 15:55:08 +    from casatools import atmosphere, table, ms, quanta, measures
29-Aug-2019 15:55:08 +    from casatasks import casalog
29-Aug-2019 15:55:08 +else:
29-Aug-2019 15:55:08 +    from taskinit import *
29-Aug-2019 15:55:08 +    from casac import atmosphere, table, ms, quanta, measures
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +mytb = table( )
29-Aug-2019 15:55:08 +myms = ms( )
29-Aug-2019 15:55:08 +myqa = quanta( )
29-Aug-2019 15:55:08 +myme = measures( )
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +import pylab as pl
29-Aug-2019 15:55:08 +from math import pi,floor
29-Aug-2019 15:55:08 +import os.path as osp
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +###############
29-Aug-2019 15:55:08 +## hides the extreme Y-axis ticks, helps stack plots close together without labels overlaping
29-Aug-2019 15:55:08 +def jm_clip_Yticks():
29-Aug-2019 15:55:08 +    xa=pl.gca()
29-Aug-2019 15:55:08 +    nlabels=0
29-Aug-2019 15:55:08 +    for label in xa.yaxis.get_ticklabels():
29-Aug-2019 15:55:08 +        nlabels+=1
29-Aug-2019 15:55:08 +    thislabel=0
29-Aug-2019 15:55:08 +    if nlabels>3:
29-Aug-2019 15:55:08 +        for label in xa.yaxis.get_ticklabels():
29-Aug-2019 15:55:08 +            if thislabel==0: label.set_alpha(0)
29-Aug-2019 15:55:08 +            if thislabel==nlabels-1: label.set_alpha(0)
29-Aug-2019 15:55:08 +            thislabel+=1
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +##############
29-Aug-2019 15:55:08 +##  sets the position of the y-axis label to the right side of the plot, can also move up/down
29-Aug-2019 15:55:08 +def jm_set_Ylabel_pos(pos=(0.5,0.5)):
29-Aug-2019 15:55:08 +    ax=pl.gca();
29-Aug-2019 15:55:08 +    ax.yaxis.set_label_position('right')
29-Aug-2019 15:55:08 +    ax.yaxis.label.set_rotation(270)
29-Aug-2019 15:55:08 +    ax.yaxis.label.set_position(pos)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +###############
29-Aug-2019 15:55:08 +## fixed y-ticks, from myMin to myMax
29-Aug-2019 15:55:08 +def jm_set_Ylim_ticks(myMin=-1,myMax=1):
29-Aug-2019 15:55:08 +    myYlocs=pl.linspace(round(myMin,1),round(myMax,1),5)
29-Aug-2019 15:55:08 +    myLocator = pl.FixedLocator(myYlocs)
29-Aug-2019 15:55:08 +    ax=pl.gca()
29-Aug-2019 15:55:08 +    ax.yaxis.set_major_locator( myLocator )
29-Aug-2019 15:55:08 +    pl.ylim(myMin,myMax)
29-Aug-2019 15:55:08 +    jm_clip_Yticks()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +###############
29-Aug-2019 15:55:08 +## variable y-ticks, but not more than 1+ this argument
29-Aug-2019 15:55:08 +def jm_set_Yvar_ticks(myScale=4):
29-Aug-2019 15:55:08 +    xa=pl.gca()
29-Aug-2019 15:55:08 +    xa.yaxis.set_major_locator(pl.MaxNLocator(myScale))
29-Aug-2019 15:55:08 +    jm_clip_Yticks()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +###############
29-Aug-2019 15:55:08 +## calculates K-band zenith opacity from temperature and dewpoint
29-Aug-2019 15:55:08 +def Tau_K_Calc(D,T,day, weights=(.5,.5)):
29-Aug-2019 15:55:08 +    P = pl.exp(1.81+(17.27*D)/(D+237.3)) # water vapor partial pressure
29-Aug-2019 15:55:08 +    h = 324.7*P/(T+273.15) # PWV in mm
29-Aug-2019 15:55:08 +    tau_w = 3.8 + 0.23*h + 0.065*h**2 # tau from weather, in %, at 22GHz
29-Aug-2019 15:55:08 +    if day > 199: day = day - 365.
29-Aug-2019 15:55:08 +    m = day + 165. # modified day of the year
29-Aug-2019 15:55:08 +    tau_d = 22.1 - 0.178*m + 0.00044*m**2 # tau from seaonal model, in %
29-Aug-2019 15:55:08 +    tau_k = weights[0]*tau_w + weights[1]*tau_d # the average, with equal weights (as in the AIPS default)
29-Aug-2019 15:55:08 +    return tau_k, h
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +################
29-Aug-2019 15:55:08 +## calculates elevation of the sun
29-Aug-2019 15:55:08 +def jm_sunEL(mytime):
29-Aug-2019 15:55:08 +    myme.doframe(myme.observatory('VLA'))
29-Aug-2019 15:55:08 +    myme.doframe(myme.epoch('utc',mytime))
29-Aug-2019 15:55:08 +    mysun=myme.measure(myme.direction('SUN'),'AZELGEO')
29-Aug-2019 15:55:08 +    return mysun['m1']['value']
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +################
29-Aug-2019 15:55:08 +## gets and plots data from the weather table of the given MS
29-Aug-2019 15:55:08 +def plotweather(vis='', seasonal_weight=0.5, doPlot=True, plotName = ''):
29-Aug-2019 15:55:08 +    myMS=vis
29-Aug-2019 15:55:08 +    if plotName == '':
29-Aug-2019 15:55:08 +        if myMS.endswith("/"):
29-Aug-2019 15:55:08 +            plotName = myMS + myMS.rstrip("/") + '.plotweather.png'
29-Aug-2019 15:55:08 +        else:
29-Aug-2019 15:55:08 +            plotName = myMS + '.plotweather.png'
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    # check for weather table
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    if osp.isdir(myMS+'/WEATHER'):
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        try:
29-Aug-2019 15:55:08 +            mytb.open(myMS+'/WEATHER')
29-Aug-2019 15:55:08 +            firstTime = mytb.getcol('TIME')[0]
29-Aug-2019 15:55:08 +            mytb.close()
29-Aug-2019 15:55:08 +            WEATHER_table_exists = True
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        except:
29-Aug-2019 15:55:08 +            print('could not open weather table, using seasonal model only and turning off plots')
29-Aug-2019 15:55:08 +            mytb.close()
29-Aug-2019 15:55:08 +            WEATHER_table_exists = False
29-Aug-2019 15:55:08 +            doPlot=False
29-Aug-2019 15:55:08 +            seasonal_weight = 1.0
29-Aug-2019 15:55:08 +    else:
29-Aug-2019 15:55:08 +        print('could not find a weather table, using seasonal model only and turning off plots')
29-Aug-2019 15:55:08 +        WEATHER_table_exists = False
29-Aug-2019 15:55:08 +        doPlot=False
29-Aug-2019 15:55:08 +        seasonal_weight = 1.0
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    ##retrieve center frequency for each sub-band
29-Aug-2019 15:55:08 +    mytb.open(myMS+'/SPECTRAL_WINDOW')
29-Aug-2019 15:55:08 +    spwFreqs=mytb.getcol('REF_FREQUENCY') * 1e-9
29-Aug-2019 15:55:08 +    mytb.close()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    ##retrieve stuff from weather table, if exists
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    if WEATHER_table_exists:
29-Aug-2019 15:55:08 +        mytb.open(myMS+'/WEATHER')
29-Aug-2019 15:55:08 +        mytime=mytb.getcol('TIME')
29-Aug-2019 15:55:08 +        mytemp=mytb.getcol('TEMPERATURE') - 273.15
29-Aug-2019 15:55:08 +        mydew=mytb.getcol('DEW_POINT') - 273.15
29-Aug-2019 15:55:08 +        mywinds=mytb.getcol('WIND_SPEED')
29-Aug-2019 15:55:08 +        # Text starts at 90 degrees, whereas the wind direction starts at 0
29-Aug-2019 15:55:08 +        # Hence the wind direction is adjusted 90 degrees counterclockwise
29-Aug-2019 15:55:08 +        # to make the arrows point to right direction
29-Aug-2019 15:55:08 +        mywindd=270-mytb.getcol('WIND_DIRECTION')*(180.0/pi)
29-Aug-2019 15:55:08 +        mypres=mytb.getcol('PRESSURE')
29-Aug-2019 15:55:08 +        myhum=mytb.getcol('REL_HUMIDITY')
29-Aug-2019 15:55:08 +        mytb.close()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    else:
29-Aug-2019 15:55:08 +        myms.open(myMS)
29-Aug-2019 15:55:08 +        mytime_range = myms.range(["time"])
29-Aug-2019 15:55:08 +        mytime = [mytime_range['time'][0]]
29-Aug-2019 15:55:08 +        myms.close()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    ##calculate the elevation of the sun
29-Aug-2019 15:55:08 +    sunEL=[]
29-Aug-2019 15:55:08 +    for time in mytime:
29-Aug-2019 15:55:08 +        t1= myqa.quantity(time,'s')
29-Aug-2019 15:55:08 +        myday=myqa.convert(t1,'d')
29-Aug-2019 15:55:08 +        sunEL1=jm_sunEL(myday)
29-Aug-2019 15:55:08 +        sunEL.append(sunEL1)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    ##convert time to a string of date/time
29-Aug-2019 15:55:08 +    myTimestr = []
29-Aug-2019 15:55:08 +    myTimestr2=[]
29-Aug-2019 15:55:08 +    for time in mytime:
29-Aug-2019 15:55:08 +        q1=myqa.quantity(time,'s')
29-Aug-2019 15:55:08 +        time1=myqa.time(q1,form='ymd')[0]
29-Aug-2019 15:55:08 +        time2=myqa.time(q1,form='local')[0]
29-Aug-2019 15:55:08 +        myTimestr.append(time1)
29-Aug-2019 15:55:08 +        myTimestr2.append(time2)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    ##convert time to a decimal
29-Aug-2019 15:55:08 +    numtime=pl.datestr2num(myTimestr)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    ##### calculate opacity as in EVLA memo 143
29-Aug-2019 15:55:08 +    thisday= 30*(float(myTimestr[0][5:7])-1)+float(myTimestr[0][8:10])
29-Aug-2019 15:55:08 +    thisday=thisday + 5 * (thisday / 365.)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    if WEATHER_table_exists:
29-Aug-2019 15:55:08 +        # get 22 GHz zenith opacity and pwv estimate from weatherstation (myPWV)
29-Aug-2019 15:55:08 +        myTauZ, myPWV1 = Tau_K_Calc(mydew,mytemp,thisday)
29-Aug-2019 15:55:08 +        myTauZ1, myPWV = Tau_K_Calc(mydew,mytemp,thisday, weights=(0,1.0))
29-Aug-2019 15:55:08 +        myTauZ2, myPWV = Tau_K_Calc(mydew,mytemp,thisday, weights=(1.0,0))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # estimate pwv from seasonal model zenith opacity
29-Aug-2019 15:55:08 +        myPWV2 = -1.71 + 1.3647*myTauZ1
29-Aug-2019 15:55:08 +        myPWV = (1-seasonal_weight)*myPWV1 + seasonal_weight*myPWV2
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    else:
29-Aug-2019 15:55:08 +        day = thisday*1.0
29-Aug-2019 15:55:08 +        if day > 199: day = day - 365.
29-Aug-2019 15:55:08 +        m = day + 165. # modified day of the year
29-Aug-2019 15:55:08 +        myTauZ = 22.1 - 0.178*m + 0.00044*m**2 # tau from seaonal model, in %
29-Aug-2019 15:55:08 +        myPWV = -1.71 + 1.3647*myTauZ
29-Aug-2019 15:55:08 +        myPWV1, myPWV2 = myPWV, myPWV
29-Aug-2019 15:55:08 +        myTauZ1, myTauZ2 = myTauZ, myTauZ
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    tmp = myqa.quantity(270.0,'K')
29-Aug-2019 15:55:08 +    pre = myqa.quantity(790.0,'mbar')
29-Aug-2019 15:55:08 +    alt = myqa.quantity(2125,'m')
29-Aug-2019 15:55:08 +    h0 = myqa.quantity(2.0,'km')
29-Aug-2019 15:55:08 +    wvl = myqa.quantity(-5.6, 'K/km')
29-Aug-2019 15:55:08 +    mxA = myqa.quantity(48,'km')
29-Aug-2019 15:55:08 +    dpr = myqa.quantity(10.0,'mbar')
29-Aug-2019 15:55:08 +    dpm = 1.2
29-Aug-2019 15:55:08 +    att = 1
29-Aug-2019 15:55:08 +    nb = 1
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    fC=myqa.quantity(25.0,'GHz')
29-Aug-2019 15:55:08 +    fW=myqa.quantity(50.,'GHz')
29-Aug-2019 15:55:08 +    fR=myqa.quantity(0.025,'GHz')
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    at=atmosphere()
29-Aug-2019 15:55:08 +    hum=20.0
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    myatm=at.initAtmProfile(alt,tmp,pre,mxA,hum,wvl,dpr,dpm,h0,att)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    at.initSpectralWindow(nb,fC,fW,fR)
29-Aug-2019 15:55:08 +    sg=at.getSpectralWindow()
29-Aug-2019 15:55:08 +    mysg = sg['value']
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    nstep = 20
29-Aug-2019 15:55:08 +    pwv = []
29-Aug-2019 15:55:08 +    opac = pl.zeros((len(mysg),nstep))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    for i in range(nstep):
29-Aug-2019 15:55:08 +        hum = 20.0*(i+1)
29-Aug-2019 15:55:08 +        myatm = at.initAtmProfile(alt,tmp,pre,mxA,hum,wvl,dpr,dpm,h0,att)
29-Aug-2019 15:55:08 +        w=at.getGroundWH2O()
29-Aug-2019 15:55:08 +        pwv.append(w['value'][0])
29-Aug-2019 15:55:08 +        at.initSpectralWindow(nb,fC,fW,fR)
29-Aug-2019 15:55:08 +        at.setUserWH2O(w)
29-Aug-2019 15:55:08 +        sg=at.getSpectralWindow()
29-Aug-2019 15:55:08 +        mysg = sg['value']
29-Aug-2019 15:55:08 +        sdry=at.getDryOpacitySpec()
29-Aug-2019 15:55:08 +        swet=at.getWetOpacitySpec()
29-Aug-2019 15:55:08 +        sd=sdry[1]
29-Aug-2019 15:55:08 +        sw=swet[1]['value']
29-Aug-2019 15:55:08 +        stot = pl.array(sd)+pl.array(sw)
29-Aug-2019 15:55:08 +        opac[:,i]=stot
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    pwv_coef=pl.zeros((len(mysg),2))
29-Aug-2019 15:55:08 +    for i in range(len(mysg)):
29-Aug-2019 15:55:08 +        myfit=pl.polyfit(pwv,opac[i,:],1)
29-Aug-2019 15:55:08 +        pwv_coef[i,:]=myfit
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    freqs=pl.array(mysg)/1e9
29-Aug-2019 15:55:08 +    coef0=pwv_coef[:,1]/1e-3
29-Aug-2019 15:55:08 +    coef1=pwv_coef[:,0]/1e-3
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    #interpolate between nearest table entries for each spw center frequency
29-Aug-2019 15:55:08 +    meanTau=[]
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    for i in range(len(spwFreqs)):
29-Aug-2019 15:55:08 +        mysearch=(pl.array(freqs)-spwFreqs[i])**2
29-Aug-2019 15:55:08 +        hits=pl.find(mysearch == min(mysearch))
29-Aug-2019 15:55:08 +        # Fix deprecation warning: could be array of 1
29-Aug-2019 15:55:08 +        #if len(hits) > 1: hits=hits[0]
29-Aug-2019 15:55:08 +        if not isinstance(hits, int):
29-Aug-2019 15:55:08 +            hits = hits[0]
29-Aug-2019 15:55:08 +        tau_interp = (pl.array(coef0[hits-2:hits+2])+pl.array(coef1[hits-2:hits+2])*pl.mean(myPWV)) * 1e-1  #percent
29-Aug-2019 15:55:08 +        tau_F = pl.interp(spwFreqs[i],freqs[hits-2:hits+2],tau_interp)
29-Aug-2019 15:55:08 +        meanTau.append(pl.mean(tau_F*.01))  #nepers
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    tau_allF = (pl.array(coef0) + pl.array(coef1)*pl.mean(myPWV)) * 1e-1  #percent
29-Aug-2019 15:55:08 +    tau_allF1 = (pl.array(coef0) + pl.array(coef1)*pl.mean(myPWV1)) *1e-1
29-Aug-2019 15:55:08 +    tau_allF2 = (pl.array(coef0) + pl.array(coef1)*pl.mean(myPWV2)) *1e-1
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    casalog.post('SPW : Frequency (GHz) : Zenith opacity (nepers)')
29-Aug-2019 15:55:08 +    for i in range(len(meanTau)):
29-Aug-2019 15:55:08 +        myStr = str(i).rjust(3) + '  :  '
29-Aug-2019 15:55:08 +        myStr2 = '%.3f'%(spwFreqs[i])
29-Aug-2019 15:55:08 +        myStr += myStr2.rjust(7) + '  :  ' +str(round(meanTau[i], 3))
29-Aug-2019 15:55:08 +        casalog.post(myStr)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    ##make the plots
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    if doPlot==False:
29-Aug-2019 15:55:08 +        return meanTau
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    pl.ioff()
29-Aug-2019 15:55:08 +    myColor2='#A6A6A6'
29-Aug-2019 15:55:08 +    myColorW='#92B5F2'
29-Aug-2019 15:55:08 +    myColor1='#4D4DFF'
29-Aug-2019 15:55:08 +    myOrangeColor='#FF6600'
29-Aug-2019 15:55:08 +    myYellowColor='#FFCC00'
29-Aug-2019 15:55:08 +    myWeirdColor='#006666'
29-Aug-2019 15:55:08 +    myLightBrown='#996633'
29-Aug-2019 15:55:08 +    myDarkGreay='#333333'
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    thisfig=pl.figure(1)
29-Aug-2019 15:55:08 +    thisfig.clf()
29-Aug-2019 15:55:08 +    thisfig.set_size_inches(8.5,10)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    Xrange=numtime[-1]-numtime[0]
29-Aug-2019 15:55:08 +    Yrange=max(mywinds)-min(mywinds)
29-Aug-2019 15:55:08 +    Xtextoffset=-Xrange*.01
29-Aug-2019 15:55:08 +    Ytextoffset=-Yrange*.08
29-Aug-2019 15:55:08 +    Xplotpad=Xrange*.03
29-Aug-2019 15:55:08 +    Yplotpad=Yrange*.03
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    sp1=thisfig.add_axes([.13,.8,.8,.15])
29-Aug-2019 15:55:08 +    pl.ylabel('solar el')
29-Aug-2019 15:55:08 +    nsuns=30
29-Aug-2019 15:55:08 +    myj=pl.array(pl.linspace(0,len(sunEL)-1,nsuns),dtype='int')
29-Aug-2019 15:55:08 +    for i in myj:
29-Aug-2019 15:55:08 +        if sunEL[i]<0: pl.plot([numtime[i],numtime[i]],[(180/pi)*sunEL[i],(180/pi)*sunEL[i]],'kH')
29-Aug-2019 15:55:08 +        else: pl.plot([numtime[i],numtime[i]],[(180/pi)*sunEL[i],(180/pi)*sunEL[i]],'H',color=myYellowColor)
29-Aug-2019 15:55:08 +    pl.plot([numtime[0],numtime[-1]],[0,0],'-',color='brown')
29-Aug-2019 15:55:08 +    xa=pl.gca(); xa.set_xticklabels('')
29-Aug-2019 15:55:08 +    jm_set_Ylim_ticks(myMin=-90,myMax=90)
29-Aug-2019 15:55:08 +    jm_set_Ylabel_pos(pos=(0,.5))
29-Aug-2019 15:55:08 +    pl.title('Weather Summary for '+myMS)
29-Aug-2019 15:55:08 +    pl.xlim(numtime[0]-Xplotpad,numtime[-1]+Xplotpad)
29-Aug-2019 15:55:08 +    xa.set_xticks(pl.linspace(min(numtime),max(numtime),3))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    sp2=thisfig.add_axes([.13,.65,.8,.15])
29-Aug-2019 15:55:08 +    pl.ylabel('wind (m/s)')
29-Aug-2019 15:55:08 +    nwind=60
29-Aug-2019 15:55:08 +    myj=pl.array(pl.linspace(0,len(mywinds)-1,nwind),dtype='int')
29-Aug-2019 15:55:08 +    for i in myj:
29-Aug-2019 15:55:08 +        pl.text(numtime[i]+Xtextoffset,Ytextoffset+mywinds[i],'-->',rotation=mywindd[i], alpha=1,color='purple',fontsize=12)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    pl.plot(numtime, .3+mywinds,'.', color='black', ms=2, alpha=0)
29-Aug-2019 15:55:08 +    jm_set_Ylabel_pos(pos=(0,.5))
29-Aug-2019 15:55:08 +    jm_set_Yvar_ticks(5)
29-Aug-2019 15:55:08 +    xa=pl.gca(); xa.set_xticklabels('')
29-Aug-2019 15:55:08 +    pl.xlim(numtime[0]-Xplotpad,numtime[-1]+Xplotpad)
29-Aug-2019 15:55:08 +    pl.ylim(min(mywinds)-Yplotpad,max(mywinds)+Yplotpad)
29-Aug-2019 15:55:08 +    xa.set_xticks(pl.linspace(min(numtime),max(numtime),3))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    sp4=thisfig.add_axes([.13,.5,.8,.15])
29-Aug-2019 15:55:08 +    pl.plot(numtime, mytemp,'-', color=myOrangeColor,lw=2)
29-Aug-2019 15:55:08 +    pl.plot(numtime, mydew,'-', color=myWeirdColor,lw=2)
29-Aug-2019 15:55:08 +    pl.ylabel('temp,dew')
29-Aug-2019 15:55:08 +    jm_set_Ylabel_pos(pos=(0, .5))
29-Aug-2019 15:55:08 +    xa=pl.gca(); xa.set_xticklabels('')
29-Aug-2019 15:55:08 +    jm_set_Yvar_ticks(5)
29-Aug-2019 15:55:08 +    pl.xlim(numtime[0]-Xplotpad,numtime[-1]+Xplotpad)
29-Aug-2019 15:55:08 +    xa.set_xticks(pl.linspace(min(numtime),max(numtime),3))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    sp7=thisfig.add_axes([.13,.35,.8,.15])
29-Aug-2019 15:55:08 +    pl.ylabel('PWV (mm)')
29-Aug-2019 15:55:08 +    pl.plot(numtime, myPWV2, color=myColor2, lw=2, label='seasonal model')
29-Aug-2019 15:55:08 +    pl.plot(numtime, myPWV1, color=myColor1, lw=2, label='weather station')
29-Aug-2019 15:55:08 +    pl.plot(numtime, myPWV, color=myColorW,lw=2, label='weighted')
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    thismin=min([min(myPWV),min(myPWV1),min(myPWV2)])
29-Aug-2019 15:55:08 +    thismax=max([max(myPWV),max(myPWV1),max(myPWV2)])
29-Aug-2019 15:55:08 +    pl.ylim(.8*thismin,1.2*thismax)
29-Aug-2019 15:55:08 +    jm_set_Ylabel_pos(pos=(0,.5))
29-Aug-2019 15:55:08 +    jm_set_Yvar_ticks(5)
29-Aug-2019 15:55:08 +    xa=pl.gca(); xa.set_xticklabels('')
29-Aug-2019 15:55:08 +    pl.xlim(numtime[0]-Xplotpad,numtime[-1]+Xplotpad)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    middletimei=int(floor(len(myTimestr)/2.))
29-Aug-2019 15:55:08 +    middletimes=str(myTimestr[middletimei])[11:]
29-Aug-2019 15:55:08 +    endtimes=myTimestr[-1][11:]
29-Aug-2019 15:55:08 +    ax=pl.gca()
29-Aug-2019 15:55:08 +    axt=ax.get_xticks()
29-Aug-2019 15:55:08 +    ax.set_xticks(pl.linspace(min(numtime),max(numtime),3))
29-Aug-2019 15:55:08 +    ax.set_xticklabels([myTimestr[0],middletimes,endtimes ])
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    sp8=thisfig.add_axes([.13,.1,.8,.2])
29-Aug-2019 15:55:08 +    pl.plot(freqs,.01*tau_allF2,'-', color=myColor2, lw=2, label='seasonal model')
29-Aug-2019 15:55:08 +    pl.plot(freqs,.01*tau_allF1,'-', color=myColor1, lw=2, label='weather station')
29-Aug-2019 15:55:08 +    pl.plot(freqs,.01*tau_allF,'-', color=myColorW, lw=2,label='weighted')
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    sp8.legend(loc=2, borderaxespad=0)
29-Aug-2019 15:55:08 +    pl.ylabel('Tau_Z (nepers)')
29-Aug-2019 15:55:08 +    pl.xlabel('Frequency (GHz)')
29-Aug-2019 15:55:08 +    pl.ylim(0,.25)
29-Aug-2019 15:55:08 +    jm_set_Yvar_ticks(6)
29-Aug-2019 15:55:08 +    jm_set_Ylabel_pos(pos=(0,.5))
29-Aug-2019 15:55:08 +    pl.savefig( plotName, dpi=150)
29-Aug-2019 15:55:08 +    pl.close()
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    casalog.post('wrote weather figure: '+plotName)
29-Aug-2019 15:55:08 +    return meanTau
29-Aug-2019 15:55:08 diff --git a/tests/tasks/test_plotants.py b/tests/tasks/test_plotants.py
29-Aug-2019 15:55:08 new file mode 100644
29-Aug-2019 15:55:08 index 0000000..ee5e42b
29-Aug-2019 15:55:08 --- /dev/null
29-Aug-2019 15:55:08 +++ b/tests/tasks/test_plotants.py
29-Aug-2019 15:55:08 @@ -0,0 +1,125 @@
29-Aug-2019 15:55:08 +from __future__ import absolute_import
29-Aug-2019 15:55:08 +import os
29-Aug-2019 15:55:08 +import string
29-Aug-2019 15:55:08 +import sys
29-Aug-2019 15:55:08 +import shutil
29-Aug-2019 15:55:08 +import unittest
29-Aug-2019 15:55:08 +from casatasks.private.casa_transition import is_CASA6
29-Aug-2019 15:55:08 +if is_CASA6:
29-Aug-2019 15:55:08 +    from casatasks import plotants
29-Aug-2019 15:55:08 +    from casatools import ctsys
29-Aug-2019 15:55:08 +    ctsys_resolve = ctsys.resolve
29-Aug-2019 15:55:08 +else:
29-Aug-2019 15:55:08 +    from __main__ import default
29-Aug-2019 15:55:08 +    from tasks import *
29-Aug-2019 15:55:08 +    #from taskinit import *
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def ctsys_resolve(apath):
29-Aug-2019 15:55:08 +        dataPath = os.path.join(os.environ['CASAPATH'].split()[0],'data')
29-Aug-2019 15:55:08 +        return os.path.join(dataPath,apath)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +'''
29-Aug-2019 15:55:08 +Unit tests for task plotants. It tests the following parameters:
29-Aug-2019 15:55:08 +    vis:           wrong and correct values
29-Aug-2019 15:55:08 +    figfile:       if output is created
29-Aug-2019 15:55:08 +'''
29-Aug-2019 15:55:08 +class plotants_test(unittest.TestCase):
29-Aug-2019 15:55:08 +    # Input and output names
29-Aug-2019 15:55:08 +    msfile = 'ic2233_1.ms'
29-Aug-2019 15:55:08 +    res = None
29-Aug-2019 15:55:08 +    fig = 'plotantstest.png'
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def setUp(self):
29-Aug-2019 15:55:08 +        self.res = None
29-Aug-2019 15:55:08 +        if not is_CASA6: default(plotants)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        # It is not necessary to copy it for all tests
29-Aug-2019 15:55:08 +        if (not os.path.exists(self.msfile)):
29-Aug-2019 15:55:08 +            datapath = ctsys_resolve('regression/ic2233')
29-Aug-2019 15:55:08 +            shutil.copytree(os.path.join(datapath,self.msfile), self.msfile)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def tearDown(self):
29-Aug-2019 15:55:08 +        if (os.path.exists(self.msfile)):
29-Aug-2019 15:55:08 +            os.system('rm -rf ' + self.msfile)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        os.system('rm -rf ' + self.fig)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test1(self):
29-Aug-2019 15:55:08 +       '''Test 1: Default parameters'''
29-Aug-2019 15:55:08 +       if is_CASA6:
29-Aug-2019 15:55:08 +           self.assertRaises(Exception,plotants)
29-Aug-2019 15:55:08 +       else:
29-Aug-2019 15:55:08 +           self.res = plotants()
29-Aug-2019 15:55:08 +           self.assertFalse(self.res)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test2(self):
29-Aug-2019 15:55:08 +        '''Test 2: Bad input file'''
29-Aug-2019 15:55:08 +        msfile = 'badfile'
29-Aug-2019 15:55:08 +        if is_CASA6:
29-Aug-2019 15:55:08 +            self.assertRaises(Exception,plotants,vis=msfile)
29-Aug-2019 15:55:08 +        else:
29-Aug-2019 15:55:08 +            self.res = plotants(vis=msfile)
29-Aug-2019 15:55:08 +            self.assertFalse(self.res)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test3(self):
29-Aug-2019 15:55:08 +        '''Test 3: Good input file and output exists'''
29-Aug-2019 15:55:08 +        self.res = plotants(vis=self.msfile, figfile=self.fig)
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test4(self):
29-Aug-2019 15:55:08 +        '''Test 4: Label antenna IDs'''
29-Aug-2019 15:55:08 +        self.res = plotants(vis=self.msfile, figfile=self.fig, antindex=True)
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test5(self):
29-Aug-2019 15:55:08 +        '''Test 5: Logarithmic antenna positions'''
29-Aug-2019 15:55:08 +        self.res = plotants(vis=self.msfile, figfile=self.fig, logpos=True)
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"failure, unknown reasons")
29-Aug-2019 15:55:08 +    def test6(self):
29-Aug-2019 15:55:08 +        '''Test 6: Exclude antenna positions'''
29-Aug-2019 15:55:08 +        self.res = plotants(vis=self.msfile, figfile=self.fig,
29-Aug-2019 15:55:08 +            exclude='1,5,19,14,10,13')
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test7(self):
29-Aug-2019 15:55:08 +        '''Test 7: checkbaselines'''
29-Aug-2019 15:55:08 +        self.res = plotants(vis=self.msfile, figfile=self.fig,
29-Aug-2019 15:55:08 +            checkbaselines=True)
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test8(self):
29-Aug-2019 15:55:08 +        '''Test 8: exclude checkbaselines'''
29-Aug-2019 15:55:08 +        # antenna (name) 11 is already excluded by checkbaselines
29-Aug-2019 15:55:08 +        # (warning)
29-Aug-2019 15:55:08 +        self.res = plotants(vis=self.msfile, figfile=self.fig,
29-Aug-2019 15:55:08 +            exclude='11', checkbaselines=True)
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test9(self):
29-Aug-2019 15:55:08 +        '''Test 9: Title'''
29-Aug-2019 15:55:08 +        self.res = plotants(vis=self.msfile, figfile=self.fig,
29-Aug-2019 15:55:08 +            title='IC2233')
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def test10(self):
29-Aug-2019 15:55:08 +        '''Test 10: All arguments'''
29-Aug-2019 15:55:08 +        self.res = plotants(self.msfile, self.fig, True, True, '1,3,5,7,9',
29-Aug-2019 15:55:08 +            True, "IC2233")
29-Aug-2019 15:55:08 +        self.assertEqual(self.res,None)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +def suite():
29-Aug-2019 15:55:08 +    return [plotants_test]
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +if is_CASA6:
29-Aug-2019 15:55:08 +    if __name__ == '__main__':
29-Aug-2019 15:55:08 +        unittest.main()
29-Aug-2019 15:55:08 diff --git a/tests/tasks/test_plotweather.py b/tests/tasks/test_plotweather.py
29-Aug-2019 15:55:08 new file mode 100644
29-Aug-2019 15:55:08 index 0000000..7aa133e
29-Aug-2019 15:55:08 --- /dev/null
29-Aug-2019 15:55:08 +++ b/tests/tasks/test_plotweather.py
29-Aug-2019 15:55:08 @@ -0,0 +1,147 @@
29-Aug-2019 15:55:08 +from __future__ import absolute_import
29-Aug-2019 15:55:08 +import os
29-Aug-2019 15:55:08 +import string
29-Aug-2019 15:55:08 +import sys
29-Aug-2019 15:55:08 +import shutil
29-Aug-2019 15:55:08 +import unittest
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +from casatasks.private.casa_transition import is_CASA6
29-Aug-2019 15:55:08 +if is_CASA6:
29-Aug-2019 15:55:08 +    from casatasks import plotweather
29-Aug-2019 15:55:08 +    from casatools import ctsys
29-Aug-2019 15:55:08 +    ctsys_resolve = ctsys.resolve
29-Aug-2019 15:55:08 +else:
29-Aug-2019 15:55:08 +    from __main__ import default
29-Aug-2019 15:55:08 +    from tasks import *
29-Aug-2019 15:55:08 +    from taskinit import *
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def ctsys_resolve(apath):
29-Aug-2019 15:55:08 +        dataPath = os.path.join(os.environ['CASAPATH'].split()[0],'data')
29-Aug-2019 15:55:08 +        return os.path.join(dataPath,apath)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +'''
29-Aug-2019 15:55:08 +Unit tests for task plotweather. It tests the following parameters:
29-Aug-2019 15:55:08 +    vis:                wrong and correct values
29-Aug-2019 15:55:08 +    seasonal_weight:    default (0.5) and other values
29-Aug-2019 15:55:08 +    doPlot:             default (True) and False
29-Aug-2019 15:55:08 +    plotName:           if output is created; test formats
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    return value:       [opacity] (type='list')
29-Aug-2019 15:55:08 +'''
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +class plotweather_test(unittest.TestCase):
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    # Input MS, must have WEATHER table
29-Aug-2019 15:55:08 +    msfile = 'nep2-shrunk.ms'
29-Aug-2019 15:55:08 +    msNoWeatherfile = 'ngc5921_ut.ms'
29-Aug-2019 15:55:08 +    # output plots
29-Aug-2019 15:55:08 +    fig = '/tmp/plotweathertest.png'
29-Aug-2019 15:55:08 +    defaultFig = msfile + ".plotweather.png"
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    def setUp(self):
29-Aug-2019 15:55:08 +        if not is_CASA6:
29-Aug-2019 15:55:08 +            default(plotweather)
29-Aug-2019 15:55:08 +        if (os.path.exists(self.msfile)):
29-Aug-2019 15:55:08 +            shutil.rmtree(self.msfile)
29-Aug-2019 15:55:08 +        shutil.copytree(ctsys_resolve(os.path.join("regression/unittest/listobs",self.msfile)), self.msfile)
29-Aug-2019 15:55:08 +   
29-Aug-2019 15:55:08 +    def tearDown(self):
29-Aug-2019 15:55:08 +        if (os.path.exists(self.msfile)):
29-Aug-2019 15:55:08 +            shutil.rmtree(self.msfile)
29-Aug-2019 15:55:08 +        if (os.path.exists(self.fig)):
29-Aug-2019 15:55:08 +            os.remove(self.fig)
29-Aug-2019 15:55:08 +        if (os.path.exists(self.defaultFig)):
29-Aug-2019 15:55:08 +            os.remove(self.defaultFig)
29-Aug-2019 15:55:08 +       
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"failure, data not found")
29-Aug-2019 15:55:08 +    def test0(self):
29-Aug-2019 15:55:08 +        '''Test 0: Default parameters'''
29-Aug-2019 15:55:08 +        opac = plotweather()
29-Aug-2019 15:55:08 +        self.assertIsNone(opac)
29-Aug-2019 15:55:08 +       
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"failure, data not found")
29-Aug-2019 15:55:08 +    def test1(self):
29-Aug-2019 15:55:08 +        '''Test 1: Bad input file'''
29-Aug-2019 15:55:08 +        badmsfile = 'badfile.ms'
29-Aug-2019 15:55:08 +        opac = plotweather(vis=badmsfile)
29-Aug-2019 15:55:08 +        self.assertIsNone(opac)
29-Aug-2019 15:55:08 +       
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"failure, 0.005426051322080905 != 0.0054234724819465846 within 7 places")
29-Aug-2019 15:55:08 +    def test2(self):
29-Aug-2019 15:55:08 +        '''Test 2: ms with no weather, no plot '''
29-Aug-2019 15:55:08 +        if (os.path.exists(self.msNoWeatherfile)):
29-Aug-2019 15:55:08 +            shutil.rmtree(self.msNoWeatherfile)
29-Aug-2019 15:55:08 +        shutil.copytree(ctsys_resolve(os.path.join("regression/unittest/listobs",self.msNoWeatherfile)), self.msNoWeatherfile)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +        opac = plotweather(vis=self.msNoWeatherfile, plotName=self.fig)
29-Aug-2019 15:55:08 +        self.assertIsNotNone(opac)
29-Aug-2019 15:55:08 +        self.assertAlmostEqual(opac[0], 0.0054234724819465846)
29-Aug-2019 15:55:08 +        self.assertFalse(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +        if (os.path.exists(self.msNoWeatherfile)):
29-Aug-2019 15:55:08 +            shutil.rmtree(self.msNoWeatherfile)
29-Aug-2019 15:55:08 +       
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"failure, 1.3931958371884026 != 1.3867727940788754 within 7 places")
29-Aug-2019 15:55:08 +    def test3(self):
29-Aug-2019 15:55:08 +        '''Test 3: Good input file and output exists'''
29-Aug-2019 15:55:08 +        res = plotweather(vis=self.msfile, plotName=self.fig)
29-Aug-2019 15:55:08 +        self.assertIsNotNone(res)
29-Aug-2019 15:55:08 +        opac = res[0]/1e55
29-Aug-2019 15:55:08 +        self.assertAlmostEqual(opac, 1.3867727940788754)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"failure, 1.3931958371884026 != 1.3867727940788754 within 7 places")
29-Aug-2019 15:55:08 +    def test4(self):
29-Aug-2019 15:55:08 +        '''Test 4: Good input file and no output plot exists'''
29-Aug-2019 15:55:08 +        res = plotweather(vis=self.msfile, doPlot=False)
29-Aug-2019 15:55:08 +        self.assertIsNotNone(res)
29-Aug-2019 15:55:08 +        opac = res[0]/1e55
29-Aug-2019 15:55:08 +        self.assertAlmostEqual(opac, 1.3867727940788754)
29-Aug-2019 15:55:08 +        defaultFig = self.msfile + ".plotweather.png"
29-Aug-2019 15:55:08 +        self.assertFalse(os.path.exists(defaultFig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"failure, 6.965979185942013 != 6.933863970394376 within 7 places")
29-Aug-2019 15:55:08 +    def test5(self):
29-Aug-2019 15:55:08 +        '''Test 5: seasonal_weight'''
29-Aug-2019 15:55:08 +        res = plotweather(vis=self.msfile, seasonal_weight=0.75, plotName=self.fig)
29-Aug-2019 15:55:08 +        self.assertIsNotNone(res)
29-Aug-2019 15:55:08 +        opac = res[0]/1e54
29-Aug-2019 15:55:08 +        self.assertAlmostEqual(opac, 6.9338639703943761)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(self.fig))
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"succeeds, total runtime too long")
29-Aug-2019 15:55:08 +    def test6(self):
29-Aug-2019 15:55:08 +        '''Test 6: pdf output format'''
29-Aug-2019 15:55:08 +        plot = '/tmp/plotweathertest.pdf'
29-Aug-2019 15:55:08 +        opac = plotweather(vis=self.msfile, plotName=plot)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(plot))
29-Aug-2019 15:55:08 +        os.remove(plot)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"succeeds, total runtime too long")
29-Aug-2019 15:55:08 +    def test7(self):
29-Aug-2019 15:55:08 +        '''Test 7: ps output format'''
29-Aug-2019 15:55:08 +        plot = '/tmp/plotweathertest.ps'
29-Aug-2019 15:55:08 +        opac = plotweather(vis=self.msfile, plotName=plot)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(plot))
29-Aug-2019 15:55:08 +        os.remove(plot)
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +    @unittest.skipIf(is_CASA6,"succeeds, total runtime too long")
29-Aug-2019 15:55:08 +    def test8(self):
29-Aug-2019 15:55:08 +        '''Test 8: eps output format'''
29-Aug-2019 15:55:08 +        plot = '/tmp/plotweathertest.eps'
29-Aug-2019 15:55:08 +        opac = plotweather(vis=self.msfile, plotName=plot)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(plot))
29-Aug-2019 15:55:08 +        os.remove(plot)
29-Aug-2019 15:55:08 +       
29-Aug-2019 15:55:08 +    def test9(self):
29-Aug-2019 15:55:08 +        '''Test 9: svg output format'''
29-Aug-2019 15:55:08 +        plot = '/tmp/plotweathertest.svg'
29-Aug-2019 15:55:08 +        opac = plotweather(vis=self.msfile, plotName=plot)
29-Aug-2019 15:55:08 +        self.assertTrue(os.path.exists(plot))
29-Aug-2019 15:55:08 +        os.remove(plot)
29-Aug-2019 15:55:08 +       
29-Aug-2019 15:55:08 +def suite():
29-Aug-2019 15:55:08 +    return [plotweather_test]
29-Aug-2019 15:55:08 +
29-Aug-2019 15:55:08 +if is_CASA6:
29-Aug-2019 15:55:08 +    if __name__ == '__main__':
29-Aug-2019 15:55:08 +        unittest.main()
29-Aug-2019 15:55:08 Argument values:
29-Aug-2019 15:55:08 casatasks
29-Aug-2019 15:55:08 /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1/casatasks
29-Aug-2019 15:55:08 master
29-Aug-2019 15:55:08 None
29-Aug-2019 15:55:08 Last Tag: 2019.139
29-Aug-2019 15:55:08 New Tag: 2019.140
29-Aug-2019 15:55:08 Creating a new tag
29-Aug-2019 15:55:08
29-Aug-2019 15:55:08 None
29-Aug-2019 15:55:08 Push enabled. Pushing new tag upstream.
29-Aug-2019 15:55:08 To ssh://git@open-bitbucket.nrao.edu:7999/casa/casatasks.git
29-Aug-2019 15:55:08 * [new tag]         2019.140 -> 2019.140
29-Aug-2019 15:55:08
29-Aug-2019 15:55:08 None
29-Aug-2019 15:55:08 Finished task 'Create wheel' with result: Success
29-Aug-2019 15:55:08 Running post build plugin 'Docker Container Cleanup'
29-Aug-2019 15:55:08
Beginning to execute external process for build 'CASA - Casa6 Tasks Wheel Build - Build and Package RHEL6 #135 (CASA-CTB-JOB1-135)'
... running command line:
/bin/docker rm -f task-wheel-container
... in: /export/home/cbt-el7-6/bamboohome/xml-data/build-dir/CASA-CTB-JOB1
29-Aug-2019 15:55:10 task-wheel-container
29-Aug-2019 15:55:10 Running post build plugin 'NCover Results Collector'
29-Aug-2019 15:55:10 Running post build plugin 'Clover Results Collector'
29-Aug-2019 15:55:10 Running post build plugin 'npm Cache Cleanup'
29-Aug-2019 15:55:10 Running post build plugin 'Artifact Copier'
29-Aug-2019 15:55:10 Publishing an artifact: EL6 wheel
29-Aug-2019 15:55:10 Finished publishing of artifact Non required shared artifact: [EL6 wheel], pattern: [*-any.whl] anchored at: [wheeldirectory/] in 237.5 ms
29-Aug-2019 15:55:10 Finalising the build...
29-Aug-2019 15:55:10 Stopping timer.
29-Aug-2019 15:55:10 Build CASA-CTB-JOB1-135 completed.
29-Aug-2019 15:55:10 Running on server: post build plugin 'NCover Results Collector'
29-Aug-2019 15:55:10 Running on server: post build plugin 'Build Hanging Detection Configuration'
29-Aug-2019 15:55:10 Running on server: post build plugin 'Clover Delta Calculator'
29-Aug-2019 15:55:10 Running on server: post build plugin 'Maven Dependencies Postprocessor'
29-Aug-2019 15:55:10 All post build plugins have finished
29-Aug-2019 15:55:10 Generating build results summary...
29-Aug-2019 15:55:10 Saving build results to disk...
29-Aug-2019 15:55:10 Logging substituted variables...
29-Aug-2019 15:55:10 Indexing build results...
29-Aug-2019 15:55:10 Finished building CASA-CTB-JOB1-135.