astro bits

Warwick CSC stuff

Basics

  • Log into my machine vega1.astro.warwick.ac.uk (not the gateway machine godzilla) using x2go, instructions on CSC wiki here (use your CSC user/password).
  • Basic information on how to use the Linux OS here. Most important is how to use a terminal (i.e. the “Linux command line”).
  • To get stuff from github, copy the clone link and then do “git clone https://github.com/someone/repo_link.git”

Machine choice

Don’t run stuff on godzilla (the machine you first connect to with x2go). If you’re working with me use vega1.astro.warwick.ac.uk; ssh to it in a terminal with “ssh -X vega1.astro.warwick.ac.uk”.

Loading CSC modules

When logging in to CSC machines, run the command below in a terminal to get access to python and some necessary modules. This will allow you to run a jupyter notebook too.

module load GCC/8.3.0  OpenMPI/3.1.4 Python/3.7.4 IPython/7.9.0-Python-3.7.4 matplotlib astropy

module load GCC/6.4.0-2.28 OpenMPI/2.1.1 Python/3.6.3 IPython/6.2.1-Python-3.6.3 matplotlib astropy

If you then type “module save”, you can restore the configuration next time with “module restore” (rather than pasting the whole command in each time).

Python

If you need python modules that don’t exist in CSC, you can install these with something like “pip install –user kplr”. This puts them in a hidden folder in your home space.

Having loaded the modules, open a jupyter notebook by typing “jupyter notebook”. This will open a browser window with the jupyter file browser, use this to find and then run your notebook.

Installing galario

  • Import modules, e.g. module load GCC/8.3.0  OpenMPI/3.1.4 Python/3.7.4 FFTW/3.3.8 CMake/3.15.3 IPython/7.9.0-Python-3.7.4
  • Follow instructions here, including python binding
  • Find python site-packages, create galario directory, and copy contents of galario/build/python/galario (single, double, __init__.py) into it.
module load GCC/8.3.0  OpenMPI/3.1.4 Python/3.7.4 FFTW/3.3.8 CMake/3.15.3 IPython/7.9.0-Python-3.7.4
git clone https://github.com/mtazzari/galario.git
cd galario
mkdir build
cd build
cmake -DPython_ADDITIONAL_VERSIONS=3.7 ..
make
cp -r python/galario/* ~/.local/lib/python3.7/site-packages/galario/

These instructions seem to work on a Mac too, though I needed to remove the galario folder and start from scratch when upgrading the python version.

To use galario with emcee, set the number of galario threads to 1 with galario.double.threads(num=1). It won’t work otherwise.

Conversions

Convert Gaussian \sigma to FWHM with FWHM = 2.35482 \, \sigma

The sky is 41252.961 square degrees, that’s 5.34638 \times 10^{11} square arcseconds or 2.35 \times 10^{-11} steradian per sq arcsecond.

astro-ph

When submitting a MNRAS paper to astro-ph, to make it look nice on US letter paper (rather than A4) you should use these at the top of your TeX file.

\documentclass[usenatbib,letterpaper]{mn2e}
\usepackage[totalwidth=480pt,totalheight=680pt,layoutvoffset=0.5cm]{geometry}

Codes

Mercury

John Chambers’ web page with Mercury doesn’t work any more, but the code seems easy enough to find. There is a binary star version around too. If you get it make sure you implement the bug fix, I found that the binary star version wouldn’t work sensibly until I added it (would die when anything was ejected).

Swift

Watch out if you change the swift.inc file in the standard download of swift, say for the number of test particles. The programs point to two different swift.inc files, one in the root dir and one in the main dir (and another in the tools dir). You could change them both, I removed the one in the main dir and made a symbolic link.

If you try swift you’d be silly not to check out SwiftVis, very clever but make sure you allocate lots of memory with -Xmx2000M or something.