Renaming Antennas

From CASA Guides
Revision as of 18:39, 15 October 2010 by Jott (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Some arrays write their fits files with simple numbers to name the antennas. CASA will import the name but also create an antenna id (like for spw, field, etc.). Both the antenna name and ID can be used to identify an antenna, which is very confusing if both are numbers -- but not the same number. The python commands below will append the antenna names with a prefix to more easily distinguish them from their IDs. ALMA will already have antenna names that are strings, as does the EVLA.

In the following exaample, the prefix 'CA' is added to the names of the antennas in the file 'C0104I':

tb.open("c0104I/ANTENNA",nomodify=False)
namelist=tb.getcol("NAME").tolist()
for i in range(len(namelist)):
	name = 'CA'+namelist[i]
	print ' Changing '+namelist[i]+' to '+name
	namelist[i]=name

tb.putcol("NAME",namelist)
tb.close()