From AstroBaki
Revision as of 11:49, 15 February 2010 by WikiSysop (talk | contribs) (Created page with '== Q: How do I know AIPY installed correctly? == Download this UV file, and unzip it with: <source lang="bash"> -x test.uv.tar.bz2 …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Q: How do I know AIPY installed correctly?[edit]

Download this UV file, and unzip it with: -x test.uv.tar.bz2

Then try: -p yy test.uv

You should see:


If you see flat red inside the plots, see the next FAQ.

Q: When I plot with, I get a graph, but the data is a solid color. What's wrong?[edit]

This is a problem with matplotlib not interfacing correctly to your window. Try the following:

import pylab ; pylab.imshow([[0,1],[3,4]]) ;

If you don't see:


then matplotlib screwed up, and you should reinstall it. This time, edit the file in matplotlib by changing "BUILD_TKAGG" to 1, and "BUILD_GTK", "BUILD_GTKAGG", and "BUILD_WINDOWING" to 0. If you don't get a window at all, make sure Tcl/Tk is installed on your system, and that the source for Tk is also available (if using Fedora, try "yum tk-devel").

Q: When I run on a Miriad UV file, I get the following error:[edit]

File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/aipy/", line 215, in read
   if nread == 0: raise IOError("No data read")
IOError: No data read

This is an endian problem associated with compiling Miriad C code on a PPC-based MAC. Unfortunately, work is still in progress on finding a work-around for this problem.

Q: I can't get matplotlib to install/build. Tips?[edit]

In order to get "easy_install matplotlib" to work on my Ubuntu machine, there were several dependencies I had to apt-get first:

sudo apt-get install libfreetype6-dev
libpng12-dev python-gtk2-dev

Q: What should I do if my installation is haywire / I get random errors / I upgraded and everything broke?[edit]

A first-shot solution to a lot of weird problems is to manually go to /usr/lib/python2.5/site-packages (or wherever python is storing your modules), and delete obsolete versions of packages such as numpy, matplotlib, basemap, and aipy. You may even try deleting all aipy installations and then rebuilding. This can very often fix your problem. Complications are also sometimes introduced when you have multiple python installations. Depending on your path settings, sometimes the python you used to build a package won't be the one that is called when you run a script. This problem seems to be particularly vicious on Macs.