Extracting the u, v, w-coordinates from
a CASA Measurement Set.
Should you want to extract the u, v (and w) coverage of your CASA data into e.g. a text file, rather than simply viewing it plotms(), then the following steps can be taken within CASA. Once in the text file the data is then easy to export into plotting packages etc.
Within CASA:
import numpy
numpy.set_printoptions(threshold='nan') #This prevents numpy truncating the print out of large arrays.
tb.open('your.ms', nomodify=F) #Opens your Measurement Set
uvw = tb.getcol('UVW') #Puts UVW data information into array uvw.
uvw_col = uvw.transpose() #transposes uvw array into uvw_col such that there are 3 columns representing u v and w values.
numpy.savetxt('namefile',uvw_col) # saves uvw_col to a text file named 'namefile'.
tb.close()#Closes your Measurement Set
The text file 'namefile' will then contain 3 columns
representing u, v and w visbility values.
Solution created by A.Avison, D.Fenech and J.McEwen , October 2011.