Renaming a Field
From CASA Guides
Sometimes sources are named the "wrong" thing in the original data set, and it would be nice to change the field name. Such as in this case I just encountered:
The flux calibrator in some data was named "J1331+3030'. Setjy only recognizes three names for this source ('3C286', '1328+307', and '1331+305')---none of which match the name given in the dataset. So, if you try to run setjy on this source, you'll see that the flux density is set to 1 Jy, which is incorrect.
2010-02-10 23:35:30 INFO setjy ########################################## 2010-02-10 23:35:30 INFO setjy ##### Begin Task: setjy ##### 2010-02-10 23:35:30 INFO setjy::::casa 2010-02-10 23:35:30 INFO setjy J1331+3030 spwid= 0 [I=1, Q=0, U=0, V=0] Jy, (default) 2010-02-10 23:35:30 INFO setjy Selecting data 2010-02-10 23:35:30 INFO setjy Selected 4818 out of 70290 visibilities. 2010-02-10 23:35:30 INFO setjy Fourier transforming: replacing MODEL_DATA column 2010-02-10 23:35:30 INFO setjy Processing after subtracting componentlist /export/home/rso-lchomiuk/test/Leo/leotest.ms.J1331+3030.spw0.tempcl 2010-02-10 23:35:30 INFO setjy Performing interferometric gridding with convolution function SF 2010-02-10 23:35:31 INFO setjy::::casa 2010-02-10 23:35:31 INFO setjy ##### End Task: setjy ##### 2010-02-10 23:35:31 INFO setjy ##########################################
In order for setjy to work properly, we need to change the name of our flux calibrator. We can do this in two ways, the first using table tools:
tb.open('leotest.ms/FIELD',nomodify=False) st=tb.selectrows(4) st.putcol('NAME','1331+305') st.done() tb.close()