Difference between revisions of "Modifying SOURCE and FIELD tables"

From CASA Guides
Jump to navigationJump to search
Line 33: Line 33:
That's it!  Now you can return to the [http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192#Setting_the_flux_density_scale G192 3-bit tutorial to set the flux density scale].
That's it!  Now you can proceed with the [http://casaguides.nrao.edu/index.php?title=EVLA_3-bit_Tutorial_G192 G192 3-bit tutorial].

Latest revision as of 15:23, 29 July 2013

Currenly, setjy will only recognize particular strings as being associated with known calibration sources. Unfortunately, when the G192 observation was set up, the name given to the flux calibrator 3C147 is not recognized by setjy, so we need to change it in the SOURCE and FIELD tables.

We will rename the flux calibrator to be "3C147" with a capital rather than a lower-case "c". We can do this with a few CASA Toolkit commands and some Python:

tb.open('G192_flagged_6s.ms/SOURCE', nomodify=False)
srcNames = tb.getcol('NAME')

You can look at the resulting array by typing "srcNames" -- the first 64 entries are '3c147-J0542+49', which we want to modify:

for element in range (0,64):
     srcNames[element] = '3C147'

Now, put the modified values back into the MS table:

tb.putcol('NAME', srcNames)

There's one more place where we need to make this modification -- the "FIELD" table:

tb.open('G192_flagged_6s.ms/FIELD', nomodify=False)
fldNames = tb.getcol('NAME')
fldNames[0] = '3C147'
tb.putcol('NAME', fldNames)

That's it! Now you can proceed with the G192 3-bit tutorial.