Renaming a Field: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Lchomiuk (talk | contribs)
No edit summary
Lchomiuk (talk | contribs)
No edit summary
Line 47: Line 47:


You should be all set! Quit out of [[browsetable]] by going to the File Menu >> Exit. Double-check your edits using [[listobs]].
You should be all set! Quit out of [[browsetable]] by going to the File Menu >> Exit. Double-check your edits using [[listobs]].
And, if we run [[setjy]] again:
<pre>
2010-02-11 00:31:42 INFO setjy ##########################################
2010-02-11 00:31:42 INFO setjy ##### Begin Task: setjy              #####
2010-02-11 00:31:42 INFO  setjy::::casa
2010-02-11 00:31:42 INFO setjy     1331+305  spwid=  0  [I=14.75, Q=0, U=0, V=0] Jy, (Perley-Taylor 99)
2010-02-11 00:31:42 INFO setjy Selecting data
2010-02-11 00:31:42 INFO setjy Selected 4818 out of 70290 visibilities.
2010-02-11 00:31:42 INFO setjy Fourier transforming: replacing MODEL_DATA column
2010-02-11 00:31:42 INFO setjy Processing after subtracting componentlist /export/home/rso-lchomiuk/test/Leo/leotest.ms.1331+305.spw0.tempcl
2010-02-11 00:31:42 INFO setjy Performing interferometric gridding with convolution function SF
2010-02-11 00:31:43 INFO  setjy::::casa
2010-02-11 00:31:43 INFO setjy ##### End Task: setjy                #####
2010-02-11 00:31:43 INFO setjy ##########################################
</pre>
...much better.


--[[User:Lchomiuk|Laura Chomiuk]] 00:10, 11 February 2010 (UTC)
--[[User:Lchomiuk|Laura Chomiuk]] 00:10, 11 February 2010 (UTC)

Revision as of 00:32, 11 February 2010

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 a data set was named "J1331+3030'. Setjy only recognizes three names for this source ('3C286', '1328+307', and '1331+305')---none of which match the field name 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 utilities:

tb.open('leotest.ms/FIELD',nomodify=False)
st=tb.selectrows(4)
st.putcol('NAME','1331+305')
st.done()
tb.close()

The second is a bit more user-friendly, with the task browsetable:

#  browsetable :: Browse a table (MS, calibration table, image)
tablename           = 'leotest.ms'      #  Name of input table
async               =      False        #  If true the taskname must be started using browsetable(...)

This will bring up a GUI that looks like this:

The browsetable GUI.

Click on 'Table Keywords', one of the tabs at the screen's left. You'll then see a window that looks like this:

Select a table keyword.

Double click on 'FIELD'. This will take you to a screen that looks like this:

Edit field names here.

Enter 'edit table' mode by clicking on the icon that looks like this: Edit field names here. Double click on the cells that need editing (in this case, those that read 'J1331+3030') and type the corrected name.


You should be all set! Quit out of browsetable by going to the File Menu >> Exit. Double-check your edits using listobs.

And, if we run setjy again:

2010-02-11 00:31:42 INFO setjy	##########################################
2010-02-11 00:31:42 INFO setjy	##### Begin Task: setjy              #####
2010-02-11 00:31:42 INFO  	setjy::::casa
2010-02-11 00:31:42 INFO setjy	    1331+305  spwid=  0  [I=14.75, Q=0, U=0, V=0] Jy, (Perley-Taylor 99)
2010-02-11 00:31:42 INFO setjy	Selecting data
2010-02-11 00:31:42 INFO setjy	Selected 4818 out of 70290 visibilities.
2010-02-11 00:31:42 INFO setjy	Fourier transforming: replacing MODEL_DATA column
2010-02-11 00:31:42 INFO setjy	Processing after subtracting componentlist /export/home/rso-lchomiuk/test/Leo/leotest.ms.1331+305.spw0.tempcl
2010-02-11 00:31:42 INFO setjy	Performing interferometric gridding with convolution function SF
2010-02-11 00:31:43 INFO  	setjy::::casa
2010-02-11 00:31:43 INFO setjy	##### End Task: setjy                #####
2010-02-11 00:31:43 INFO setjy	##########################################

...much better.

--Laura Chomiuk 00:10, 11 February 2010 (UTC)