- FLUX = 0
- Sort the components by ABS(I flux), largest first.
- POSITION
- Sort the components by distance from the reference, closest first.
- POLARISATION
- Sort the components by fractional polarisation, biggest first.
- UNSORTED
- No sorting is necessary
- NUMBER_CRITERIA
- The number of criteria in this enumerator
This class is a container that allows many SkyComponents to be grouped together and manipulated as one large compound component. The major operations of this class are:
ComponentLists are memory based objects that can write their contents to and from disk (ie a Table). To read a componentList from a Table the appropriate constructor must be used. Alternatively an empty componentlist can be created that is not associated with a Table. To save the list to disk it must be given a name. This is done using the rename function. This will rename the Table if the ComponentList was already associated with a Table. Saving changes to the table on disk happens automatically when the list is destructed or reset via the assignment operator (unless the table was opened read-only).
The elements of a componentlist (ie., SkyComponents) are accessed via the component functions. These functions return the SkyComponent by reference and hence manipulating the supplied component manipulates the specified element of the list.
Read a componentList from an existing table. By default the Table is opened read-write. Any subsequent changes made to a list opened read-only (i.e. via add(), remove(), or editing a non-const member component returned by component()) will not be saved to disk.
The Copy constructor uses reference semantics
The destructor saves the list to disk if it has a name (assigned using the setName member function)
The assignment operator uses reference semantics
Returns True if all the specified components are physically plausable. See the isPhysical function in the SkyCompBase class for a precise definition of what this means.
Calculate the integrated flux of all the members of the componentlist at the specified direction & frequency, in a pixel of specified size.
Same as the previous function except that many directions & frequencies are done at once. The Flux is added into the values supplied in the samples argument and this cube must have dimensions of: [4, nDirs, nFreqs]. The polarisation and units of the flux added are specified with the reqUnit and reqPol arguments.
Add a SkyComponent to the end of the ComponentList. The list length is increased by one when using this function. By default the newly added component is not selected. Note that it is possible to add a component to a list that was opened read-only; however, the table on disk will not be updated with new component.
Remove the specified SkyComponent(s) from the ComponentList. After removing a component all the components with an indices greater than this one will be reduced by one. For example in a five element list removing elements [0,2,4] will result in a two element list, now indexed as elements zero and one, containing what was previously the second and fourth components. Note that it is possible to remove a component from a list that was opened read-only; however, the table on disk will not be updated accordingly.
returns how many components are in the list.
deselect the specified component. Throws an exception (AipsError) if any element in the index is out of range, ie. index >= nelements().
select the specified component. Throws an exception (AipsError) if any element in the index is out of range, ie. index >= nelements().
Returns a Vector whose indices indicate which components are selected
set the label on the specified components to the specified string
set the flux on the specified components to the specified flux
convert the flux on the specified components to the specified units
convert the flux on the specified components to the specified polarisation representation
set the reference direction on the specified components to the specified direction. The reference frame is not changed, use the setRefFrame function to do that.
set the reference direction frame on the specified components to the specified one. Does not convert the direction values.
Convert the reference direction frame on the specified components to the specified one. Changes the direction values.
set the shape on the specified components to the specified one.
set the shape on the specified components to the specified one. However this function unlike the previous one does not change the reference direction to the one specified in the newShape object.
set the spectrum on the specified components to the specified one.
set the spectrum on the specified components to the specified one. However this function unlike the previous one does not change the reference frequency to the one specified in the newSpectrum object.
set the reference frequency on the specified components to the specified frequency. The reference frame is not changed, use the setRefFrequencyFrame function to do that.
set the reference frequency frame on the specified components to the specified one. Does not convert the frequency values.
set the reference frequency unit on the specified components to the specified one. The unit must have the same dimensions as the Hz.
returns a reference to the specified element in the list.
Make the ComponentList persistant by supplying a filename. If the ComponentList is already associated with a Table then the Table will be renamed. Hence this function cannot be used with ComponentLists that are constructed with readonly=True.
Make a real copy of this componentList. As the copy constructor and the assignment operator use reference semantics this is the only way to get a distinct version of the componentList.
Sort the components in the list using the given criteria.
Convert the SortCriteria enumerator to a string
Convert a given String to a Type enumerator
Function which checks the internal data of this class for consistant values. Returns True if everything is fine otherwise returns False.
methods to store itself as a Record and recover from a Record its state
Private function to read the components from disk