Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | synthesis | |
Module | componentmodels | |
Tool | componentlist |
Return a vector of indices.
Synopsis
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.
Returns
vector of non-negative integers
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);
}
This example reads a componentlist from disk and then proceeds to
sum the flux of all the components. The units for all components
are initially converted to Jansky's and the polarization
representations set to Stokes.
Next: componentlist.sort - Function
Up: componentlist - Tool
Previous: componentlist.length - Function
  Contents
  Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc.,
Washington, D.C.
Return to AIPS++ Home Page
2006-10-15