componentlist.indices - Function

1.4.2 Return a vector of indices.
Description

The indices function returns a vector of non-negative integers that can be used to index through the list. This vector always contains the integers starting at one and increasing sequentially to the length of the list. Its main use is in for loops as is illustrated in the example below.

Arguments





Returns
intArray

Example

      include ’componentlist.g’  
      cl := componentlist(’crux.cl’);  
      allcomp := cl.indices();  
      cl.convertfluxunit(allcomp, ’jy’);  
      cl.convertfluxpol(allcomp, ’stokes’);  
      totalflux := [0,0,0,0];  
      for (i in allcomp) {  
        totalflux +:= cl.getfluxvalue(i);  
      }  
    

Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu

Copyright © 2008 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search

Updated daily during alpha development.