Changeset 2953


Ignore:
Timestamp:
06/24/14 20:51:58 (11 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-6595)

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs:

Put in Release Notes: Yes

Module(s): sdplot, asapplotter

Description: Proper handling of flagged data in plottp, plotazel, and plotpointing2


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r2945 r2953  
    13281328        from matplotlib.dates import HourLocator, MinuteLocator,SecondLocator, DayLocator
    13291329        from matplotlib.ticker import MultipleLocator
    1330         from numpy import array, pi
     1330        from numpy import array, pi, ma
    13311331        if self._plotter and (PL.gcf() == self._plotter.figure):
    13321332            # the current figure is ASAP plotter. Use mpl plotter
     
    13401340        self._data = scan
    13411341        dates = self._data.get_time(asdatetime=True)
     1342        # for flag handling
     1343        mask = [ self._data._is_all_chan_flagged(i) for i in range(self._data.nrow())]
    13421344        t = PL.date2num(dates)
    13431345        tz = timezone('UTC')
     
    13541356        tdel = max(t) - min(t)
    13551357        ax = PL.subplot(2,1,1)
    1356         el = array(self._data.get_elevation())*180./pi
     1358        el = ma.masked_array(array(self._data.get_elevation())*180./pi, mask)
    13571359        PL.ylabel('El [deg.]')
    13581360        dstr = dates[0].strftime('%Y/%m/%d')
     
    13921394
    13931395        # Az plot
    1394         az = array(self._data.get_azimuth())*180./pi
     1396        az = ma.masked_array(array(self._data.get_azimuth())*180./pi, mask)
    13951397        if min(az) < 0:
    13961398            for irow in range(len(az)):
     
    14401442        """
    14411443        self._plotmode = "pointing"
    1442         from numpy import array, pi
     1444        from numpy import array, pi, ma
    14431445        from asap import scantable
    14441446        # check for scantable
     
    15191521            # getting data to plot
    15201522            dir = array(self._data.get_directionval()).transpose()
     1523            # for flag handling
     1524            mask = [ self._data._is_all_chan_flagged(i) for i in range(self._data.nrow())]
    15211525            ra = dir[0]*180./pi
    1522             dec = dir[1]*180./pi
     1526            dec = ma.masked_array(dir[1]*180./pi, mask)
    15231527            # actual plot
    15241528            self._plotter.set_line(label=(sellab+str(idx)))
     
    16791683        if m > 1:
    16801684            y=y.mean(axis=1)
     1685        # flag handling
     1686        m = [ scan._is_all_chan_flagged(i) for i in range(scan.nrow()) ]
     1687        y = ma.masked_array(y,mask=m)
    16811688        plotit = self._plotter.plot
    16821689        llbl = self._get_label(scan, r, self._stacking, None)
Note: See TracChangeset for help on using the changeset viewer.