Pylab GetDist
Pylab GetDist - produces python code to plot posteriors (incl. 2D and 3D(?)) from CosmoMC chains.
To use:
- Get Python (some systems like Mac OS X have it by default)
- Get PyLab
- Replace the GetDist in your cosmomc/source directory with the file above
- Compile, as normal
- Run GetDist with the same parameter files as normal
- Run "python ROOTNAME.py" to generate the plots (as postscript)
I haven't tried this on many systems, so it's very likely you'll have to mess with the code a bit, especially for things like font sizes and names. If you make any changes that make it better do let me know. - e-mail me at username: joe.zuntz domain name:cantab.net
This version also has a short simple routine to scale up all the parameters in the chains by their own factor. Enable it by adding the lines "jz_have_factors = T" and "jzfac1 = nnn", "jzfac2 = nnn" etc. Remember that the covariance matrices that the program generates will be for the scaled parameters and not suitable (without re-scaling) for use a covmat for later cosmomc runs.
Python SMS Download
SMS Python helps you download phone text messages via bluetooth (or possibly some other kind of serial port). It's written for Mac OS X but parts of it should work on other systems, if you can create a tty for the serial port.
To Use:
- Download the file into a directory in yor python path (or the working directory)
- Pair your phone with your computer. See your computer's instructions for details of this.
- Create bluetooth serial port on the device. On OS X Tiger you do this from System Prefs > Bluetooth > Devices > Edit Serial Ports. Select RS-232 as the port type, and note down the port name.
- Change MY_NAME and MY_NUMBER in the file, and port_name to "tty.[name-of-port]"
- Make sure you have the python serial package in your python path ($PYTHONPATH) (the package is available from Fink)
- Run the program: python sms.py
- You messages will be printed to standard output, with any messages to stderr. The format is designed to be easy to parse automatically.
You can also import the package in python and play with some facilities there (like the phonebook). If I have time I'll make the whole thing more friendly, add some docstrings, maybe make a .app version, and check whether it works with other phones.
Python Posterior tools
A few tools in python to deal with probabilities and similar: