Git
Setting up the git environment for version control

Let us assume git is installed in your managed linux machine or cluster. (If not, politely ask the administrator to install it)
If you have administrative privileges open a terminal (Ctrl-Alt-t) and at the prompt ($) type the command
$ sudo apt-get install git

You can omit 'sudo' if your system does not require super user (admin) privileges.

To check git has installed correctly you can type
$ git - -help
and a list of commands and options should display. Now let us set the user configuration, common for all git repositories you will use

$ git config - -global user.name "Frederick Gent"
$ git config - -global user.email "moc.liamg|lcn.tneg.derf#moc.liamg|lcn.tneg.derf"
substituting your own values inside the quotation marks and for applying nice color fonts to the terminal display
$ git config - -global color.ui "auto"
Show a summary of the global settings
$ git config - -list

Setting up pysac

One of the git repositories I have been using for the magnetohydrostatic atmosphere modelling is the Sheffield pysac. This includes scripts for reading and writing gdf formatted data to and from the fortran coded Sheffield Advanced Code, which is a fourth order in space finite difference solver for MHD simulations.

Move to or create a directory where you wish to save your codes. e.g.
$ mkdir codes
$ cd codes
then clone pysac into this directory using
$ git clone https://github.com/fredgent/pysac.git
and a new directory pysac will be generated, containing the files from the repository.
$ cd pysac
Here we install pysac so that it will be included in the python path $PYTHONPATH
$ python setup.py develop
If you do not require to develop pysac then replace 'develop' with 'install'. Depending on the python installation, if you have root access you may need to prefix the command with 'sudo'. It admin privileges are required and you do not have them, follow Python without root

To use the gdf based visualisation scripts within pysac, we will also require the yt package.
Move to a convenient location, e.g. $HOME or ~/Downloads and at the prompt
$ hg clone https://bitbucket.org/yt_analysis/yt
to unpack the source files into a directory named yt. Then
$ cd yt
$ hg update yt

There are a number of package dependencies, on which yt relies. These are listed at get yt and if required install any missing dependencies and then apply the above command. Admin may be required, in which case prefix the command with sudo, or if you do not have super user privileges follow Python without root.

To obtain the 3D visualisation used by pysac, we also require the installation of Mayavi. Download and unpack into a convenient directory (e.g. ~/Downloads) mayavi.tar or more recent version, then open a terminal and navigate to that directory.
$ python setup.py install

Additional dependencies may be similarly installed traits, pyface, apptools

If colormath is missing, from a terminal type
$ pip install colormath
or without root / admin
$ pip install colormath - -user

To take advantage of the HMI data, sunpy will be required.
$ pip install sunpy
and that will require suds. Download and extract suds.tar then from the directory into which you extracted the tar
$ python setup.py install

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License