Download and run the X11 installer from apple.com.
The version of X11 available on apple.com is not compatible with OS X 10.4. You'll need to run the optional-program installer from the 10.4 Install DVD to get X11.
Download setup.exe from cygwin.com. Run the setup.exe program. Accept the default options until you get to the list of software packages. In that list, you can click the little plus signs to open the list for each category. There are two packages you'll need to install.
Click "Next" and it should download and install all the necessary packages. It could take several minutes to finish.
Do everything described above in the non-Vista Windows installation instructions. Then, open a text editor (e.g., Notepad -- NOT a word processor like MS Word) and enter the following two lines:
X :0 -multiwindow -clipboard &
export DISPLAY=:0.0
Save that file called "go" to your Cygwin home directory, which should be something like c:\cygwin\home\your_username.
The Linux GUI is already built on X11, so you don't have to do anything.
Make sure you are connected to the network before starting your X11 application.
Start your X11 application and get a terminal window (xterm).
Open any terminal application, such as xterm.
Launch X11.app, which is likely to be in /Applications/Utilities. It will give you a terminal window.
Start cygwin. Once the white-on-black command window appears, use the 'startx' command to launch X11. It will give you a terminal window.
Start cygwin. Once the white-on-black command window appears, run the following command:
. go
That's a period, a space, and the word "go." "go" is the name of the file you created in the Window Vista installation instructions above. Your text editor may have added a ".txt" extension, in which case you would have to run . go.txt. You could also rename the file from "go.txt" to "go" with the following command in your terminal window: mv go.txt go. If you saved the file to the wrong directory, move it into your home directory. The command echo $HOME will tell you the location of your home directory.
In the terminal window, use ssh to connect to geoflop:
ssh -Y geo232?@geoflop.uchicago.edu
(Replace the '?' with the letter for your username on geoflop.)Launch the Python programming environment:
idle -nThe initial window is a Python interpreter. It accepts commands you type and runs them immediately without saving the code.
You can open a Notepad-style text editor window by opening IDLE's "File" menu and choosing "New Window." You can type and edit your code in this window before running it. You can save this code to a file on the class server with the text editor window's File menu's "Save" or "Save As" items. You will have to save your code before you can run it from this window. Once you have saved your code, you can run it by choosing "Run Module" from the "Run" menu or by pressing F5. The output of your Python program will appear in the interpreter window.
When you are finished, you can choose "Quit" from the File menu. Then, at the command-prompt window (the xterm), you can use the 'logout' command to log out.
The ClimateUtilities module has a Curve object for drawing graphs. The system draws the graphs using the X11 windowing system, so you will need to have X11 running on your local machine. The easiest way to get started is to import everything from ClimateUtilities:
from ClimateUtilities import *
Then, create a curve object:
c = Curve()
Curve objects accept Python lists as data to graph. The first list you give it becomes the X axis. All subsequent lists will be plotted on the Y axis against that first list. The last thing to do is plot the graph: w = plot(c).
Here is an example that puts everything together:
from ClimateUtilities import * xList = range(10) yListOne = [x**2 for x in xList] yListTwo = [x**3 for x in xList] c=Curve() c.addCurve(xList) c.addCurve(yListOne) c.addCurve(yListTwo) w = plot(c)
The result should look like this:

To save that graph, take a screenshot, or save it to your home directory on geoflop:
w.save("filename") will save the graph to a PostScript file called "filename.eps" in your home directory. To get rid of the graph window, do w.delete().
You can switch the X and Y axes with c.switchXY = True.
That is useful if, for example, you want to plot several curves of T vs. P to show different lapse rates (e.g., dry and moist adiabats).
The first list you add to the Curve object is the independent variable, and every subsequent list is treated as a dependent variable.
With lapse rate, you want P, the independent variable, on the vertical axis, because it is a vertical coordinate.
With lapse rate, you want P on the vertical axis, and you want high pressure at the bottom. After you switch the X and Y axes, you can reverse the Y axis: c.reverseY = True.
You can switch to a log-scale plot: c.YlogAxis = True. Just be careful that you don't have zero or a negative value in the list you're graphing if you use log-scale axes. (What happens to ln(x) as x goes to zero?)
In lab, we modified the professor's ODE script so that we could graph the analytical and numerical solutions and their difference. We only used the Euler method. Here is the code:
#Tutorial on numerical integration of first order ODE. # #We integrate the first order ODE # dy/dx = -x*y #numerically using the Euler method, the midpoint method, #and the Runge-Kutta method, and compare with the exact #solution. # #This is the basic version, using no plotting and using only #Python language constructs that are more or less common to #all programming languages. import math from ClimateUtilities import * xx=[] numerical=[] analytical = [] error=[] #Define the function you are integrating. To #keep things simple, this function has no parameters. #The analytic solution to this #problem is y(x) = y(0)*exp(-x**2/2) def yAnalytical(y0,x): #return y0*math.exp(x) return y0*math.exp(-x**2/2.) def F(x,y): #return y #return math.exp(x) return -x*y #Initial conditions xstart = 0 ystart = 1. # #Increment. Try re-running the script with different #values dx = .5 # #How many steps? nsteps = 10 #Try 15 steps, to show instability of midpoint method #Do an Euler integration and save results for plotting #Do the loop to find the solution starting from the #initial condition x = xstart y = ystart xx=[x] analytical = [yAnalytical(ystart, x)] numerical=[ystart] error=[numerical[0]-analytical[0]] for i in range(nsteps): slope = F(x,y) x = x + dx y = y + slope*dx #yExact = ystart*math.exp(-x**2/2.) yExact = yAnalytical(ystart, x) #print x,y,yExact,y-yExact xx.append(x) analytical.append(yExact) numerical.append(y) error.append(y-yExact) def graph(): c=Curve() c.addCurve(xx) c.addCurve(analytical, label='Analytical solution') c.addCurve(numerical, label='Numerical solution') c.addCurve(error, label='Error') w=plot(c) # raw_input("Press Enter to delete the graph and return...") # w.delete() return w
When the slope (dy/dx) is -x*y, it turns out that the analytical solution is the function that gives the Gaussian distribution (centered at zero with variance=1). When we ran the code and graphed the result, we got the following:

Notice that the numerical solution converges on the true (analytical) solution, and the error goes to zero, but, initially, there is a spurious oscillation.
We also did this exercise with dy/dx=y, which has the obvious solution of y=ex (because dy/dx = ex = y). We got the following graph.

Notice that the error is growing exponentially.
Alt-PrintScreen will copy the current window to the clipboard. From there, you can paste it into an application like Microsoft Paint with Ctrl-V (or Edit->Paste).
GNOME has Applications-->Accessories-->Take a Screenshot. KDE probably has something similar. From the command-line (terminal window), you can do xwd -out filename.xwd. The mouse pointer will turn into a plus sign, and an image of the next window you click on will be saved to the file filename.xwd. You can convert it to a useful format with something like the ImageMagick convert command: convert filename.xwd filename.png.
Read this article. Summary: Command-Shift-4, then Spacebar, then click on a window.
If you save a graph to your home directory on geoflop (w.save('filename')), it will be a Postscript file ('filename.eps').
You can download the file to your local machine using SCP, the secure copy program: scp geoflop.uchicago.edu:filename.eps .
The dot ('.') at the end is part of the command that you run on the local machine, and it just means that the file is copied to whatever directory you are already in when you issue the command on the local machine.
If your local machine can't deal with postscript files, you can convert the file to a PDF on geoflop before you download it: ps2pdf filename.eps will produce filename.pdf. Then, you can download the pdf with the scp command: scp geoflop.uchicago.edu:filename.pdf .
If you just want to display the EPS files on geoflop so that you can take a screenshot, you can use the 'gs' command on geoflop: gs filename.eps will display the file. When you're finished with it, go back to the terminal window where you ran the 'gs' command. Press 'Enter' to get a command prompt in GS, then type 'quit' and press 'Enter' again to get out of GS.