Changeset 798


Ignore:
Timestamp:
12/22/05 11:55:22 (19 years ago)
Author:
phi196
Message:

Added swap_pol & invert_phase

Location:
branches/Release12
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/Release12/python/__init__.py

    r788 r798  
    353353            rotate_linpolphase - rotate the phase of the complex
    354354                                 polarization O=Q+iU correlation
     355            invert_phase    - take the complex conjugate of the cross correlation
     356            swap_pol        - swap the order of the parallel polarisations
    355357            freq_switch     - perform frequency switching on the data
    356358            stats           - Determine the specified statistic, e.g. 'min'
  • branches/Release12/python/scantable.py

    r791 r798  
    12681268        return
    12691269
     1270    def invert_phase(self, allaxes=None):
     1271        """
     1272        Take the complex conjugate of the complex polarisation cross
     1273        correlation.  This is always done in situ in the data.  If
     1274        you call this function twice, you end up with the original phase
     1275        Parameters:
     1276            allaxes: If True apply to all spectra. Otherwise
     1277                     apply only to the selected (beam/pol/if)spectra only.
     1278                     The default is taken from .asaprc (True if none)
     1279        Examples:
     1280            scan.invert_phase()
     1281        """
     1282        if allaxes is None: allaxes = rcParams['scantable.allaxes']
     1283        varlist = vars()
     1284        from asap._asap import _invert_phase
     1285        _invert_phase(self, allaxes)
     1286        self._add_history("invert_phase", varlist)
     1287        print_log()
     1288        return
     1289
     1290    def swap_ppol(self, allaxes=None):
     1291        """
     1292        Swaps the order of parallel polarisation products (ie AA, BB
     1293        becomes BB, AA) .  This is always done in situ in the data.
     1294        If you call this function twice, you end up with the original
     1295        order
     1296        Parameters:
     1297            allaxes: If True apply to all spectra. Otherwise
     1298                     apply only to the selected (beam/pol/if)spectra only.
     1299                     The default is taken from .asaprc (True if none)
     1300        Examples:
     1301            scan.swap_pol()
     1302        """
     1303        if allaxes is None: allaxes = rcParams['scantable.allaxes']
     1304        varlist = vars()
     1305        from asap._asap import _swap_pol
     1306        _swap_pol(self, allaxes)
     1307        self._add_history("swap_phase", varlist)
     1308        print_log()
     1309        return
     1310
    12701311
    12711312    def add(self, offset, insitu=None, allaxes=None):
  • branches/Release12/src/SDMath.cc

    r797 r798  
    14251425
    14261426      // Invert
    1427       C4 = -C4
     1427      C4 *= -1.0f;
    14281428
    14291429      // Put
     
    14831483// Swap
    14841484
    1485       Array<Float> tmp = C1;
     1485      Array<Float> tmp;
     1486      tmp = C1;
    14861487      C1 = C2;
    14871488      C2 = C1;
  • branches/Release12/src/SDMath.h

    r716 r798  
    137137   void rotateLinPolPhase(SDMemTable& in, casa::Float value, casa::Bool doAll);
    138138
     139// Complex conjugate of phase
     140   void invertPhase(SDMemTable& in, casa::Bool doAll);
     141
     142// Swap polarisation order
     143   void swapPol(SDMemTable& in, casa::Bool doAll);
    139144 
    140145 private:
  • branches/Release12/src/SDMathWrapper.cc

    r716 r798  
    278278}
    279279
     280void SDMathWrapper::invertPhaseInSitu(SDMemTableWrapper& in, bool doAll)
     281{
     282  SDMemTable* pIn = in.getPtr();
     283 
     284  sdmath.invertPhase(*pIn, Bool(doAll));
     285}
     286
     287void SDMathWrapper::swapPolInSitu(SDMemTableWrapper& in, bool doAll)
     288{
     289  SDMemTable* pIn = in.getPtr();
     290 
     291  sdmath.swapPol(*pIn, Bool(doAll));
     292}
     293
    280294
    281295void SDMathWrapper::rotateLinPolPhaseInSitu(SDMemTableWrapper& in, float angle, bool doAll)
  • branches/Release12/src/SDMathWrapper.h

    r716 r798  
    109109  void rotateLinPolPhaseInSitu(SDMemTableWrapper& in, float angle, bool doAll);
    110110
     111// Complex conjugate of phase
     112   void invertPhaseInSitu(SDMemTableWrapper& in, bool doAll);
     113
     114// Swap polarisation order
     115   void swapPolInSitu(SDMemTableWrapper& in, bool doAll);
     116
    111117// Apply opacity correction
    112118  void opacityInSitu(SDMemTableWrapper& in, float tau, bool doAll);
  • branches/Release12/src/python_SDMath.cc

    r724 r798  
    106106      def("_rotate_linpolphase", &SDMathWrapper::rotateLinPolPhaseInSitu);
    107107
     108      def("_invert_phase", &SDMathWrapper::invertPhaseInSitu);
     109      def("_swap_pol", &SDMathWrapper::swapPolInSitu);
     110
     111
    108112      def("_frequency_switch", &SDMathWrapper::frequencySwitch);
    109113      def("_frequency_switch_insitu", &SDMathWrapper::frequencySwitchInSitu);
Note: See TracChangeset for help on using the changeset viewer.