<p>UVFITS is a file format that has a history of use in AIPS, so it likely won't be much use here.</p>
<p>It looks like an easy way to get what you're looking for is to use the <em>export_uvtable</em> task of uvplot (see documentation <a href="https://github.com/mtazzari/uvplot" rel="nofollow noreferrer">here</a>). Since uvplot is not a standard CASA library, you'll have to install it with pip from within CASA (if you are using a mac and CASA 5 or above):</p>
<pre><code>pip install uvplot
</code></pre>
<p>Then run split to isolate the visibilities you wish to extract, e.g.:</p>
<pre><code>split(vis='FULL.ms', field=&quot;0&quot;, spw=&quot;0~2&quot;, outputvis=&quot;TEST.ms&quot;, datacolumn=&quot;data&quot;) 
</code></pre>
<p>And finally run export_uvtable</p>
<pre><code>from uvplot import export_uvtable
export_uvtable(&quot;uvtable.txt&quot;, tb, vis=&quot;TEST.ms&quot;, datacolumn=&quot;DATA&quot;)
</code></pre>
<p>The resulting uvtable.txt file contains columns of u, v, Real(V), Im(V), and weight.</p>

CC BY-SA 4.0
2021-06-21T09:49:12.507Z
Thank you for your answer - this looks like a good way to achieve what I was looking for. In the meantime, I was able to write some python within CASA to do what I needed (with some help from a colleague).
jm22b
CC BY-SA 4.0
2021-06-14T12:16:58.430Z
2021-06-14T12:16:58.430Z
gj283
<p>I am trying to export the UV wavelengths, visibilities and weights from a measurement set in CASA, but I haven't been able to find the right commands to do this.</p>
<p>'exportuvfits' might be what I am looking for, but I can't find a clear explanation of what this format really is.</p>
<p>Any CASA users out there that can help me?</p>

CC BY-SA 4.0
2021-01-30T00:41:23.933Z
Have you tried it to see what happens? If so, can you add to your question a description of the results and if they are not suitable, what you need instead? *Thanks!*
uhoh
CC BY-SA 4.0
2021-06-14T12:23:55.923Z
What is CASA? More details/links please.
ProfRob
CC BY-SA 4.0
2021-06-21T09:47:39.800Z
@ProfRob CASA is the Common Astronomy Software Application, and is used for data processing of ALMA/VLA data (https://casa.nrao.edu/)
jm22b
<radio-astronomy><data-analysis>
extracting visibility information from CASA measurement set
jm22b
# extracting visibility information from CASA measurement set

(Asked by: username_0 on 2021-01-28)

I am trying to export the UV wavelengths, visibilities and weights from a measurement set in CASA, but I haven't been able to find the right commands to do this.

'exportuvfits' might be what I am looking for, but I can't find a clear explanation of what this format really is.

Any CASA users out there that can help me?

**Tags:** radio-astronomy, data-analysis

> **Comments:**
> **username_1**: Have you tried it to see what happens? If so, can you add to your question a description of the results and if they are not suitable, what you need instead? *Thanks!*  
> **username_2**: What is CASA? More details/links please.  
> **username_0**: @username_2 CASA is the Common Astronomy Software Application, and is used for data processing of ALMA/VLA data (https://casa.nrao.edu/)  

---

## 1 answers

### Answer by username_3 on 2021-06-14. Score: 1 | Accepted answer

UVFITS is a file format that has a history of use in AIPS, so it likely won't be much use here.
It looks like an easy way to get what you're looking for is to use the export_uvtable task of uvplot (see documentation here). Since uvplot is not a standard CASA library, you'll have to install it with pip from within CASA (if you are using a mac and CASA 5 or above):
pip install uvplot

Then run split to isolate the visibilities you wish to extract, e.g.:
split(vis='FULL.ms', field="0", spw="0~2", outputvis="TEST.ms", datacolumn="data") 

And finally run export_uvtable
from uvplot import export_uvtable
export_uvtable("uvtable.txt", tb, vis="TEST.ms", datacolumn="DATA")

The resulting uvtable.txt file contains columns of u, v, Real(V), Im(V), and weight.

> **Comments:**
> **username_0**: Thank you for your answer - this looks like a good way to achieve what I was looking for. In the meantime, I was able to write some python within CASA to do what I needed (with some help from a colleague).  

---

