%%bash
cd ~/Downloads
curl -LO http://repo.continuum.io/archive/Anaconda3-4.0.0-MacOSX-x86_64.sh
bash Anaconda3-4.0.0-MacOSX-x86_64.sh

"""
Explanation: Anaconda Installation
includes: python, ipython, spyder, jupyter, and more...
Author: Barron Henderson
Better instructions are elsewhere

These were written for distribution for a specific workshop
These might be out of date
Anaconda website (https://www.continuum.io/downloads) may be more throrough
If you're still reading, go ahead and use these.

Windows Installation
How-to

Select an installer from below
Download the installer
unzip first, only if necessary
Double click installer 
Follow instructions to install
if you have admin rights, for system
if you don't, just your user - install directly in user directory.

Windows not zipped

64-bit: http://repo.continuum.io/archive/Anaconda3-4.0.0-Windows-x86_64.exe
32-bit: http://repo.continuum.io/archive/Anaconda3-4.0.0-Windows-x86.exe
64-bit-zipped: https://repo.continuum.io/archive/.winzip/Anaconda3-4.0.0-Windows-x86_64.zip
32-bit-zipped: https://repo.continuum.io/archive/.winzip/Anaconda3-4.0.0-Windows-x86.zip

OS X graphical

Download http://repo.continuum.io/archive/Anaconda3-4.0.0-MacOSX-x86_64.pkg
Double click
Follow instructions to install
if you have admin rights, for system
if you don't, just your user

OS X Command line

Download: http://repo.continuum.io/archive/Anaconda3-4.0.0-MacOSX-x86_64.sh
Open a terminal (command+space, type terminal, enter)
cd ~/Downloads
bash Anaconda3-4.0.0-MacOSX-x86_64.sh
Follow instructions to install
if you have admin rights, for system
if you don't, just your user
End of explanation
"""


!ipython -ic "exit()"

"""
Explanation: Linux

Download one of the installers
64-bit: http://repo.continuum.io/archive/Anaconda3-4.0.0-Linux-x86_64.sh
32-bit: http://repo.continuum.io/archive/Anaconda3-4.0.0-Linux-x86.sh


Open a terminal
Navigate to your download.
Run installer
bash Anaconda3-4.0.0-Linux-x86_64.sh
bash Anaconda3-4.0.0-Linux-x86.sh


Follow instructions to install
if you have admin rights, for system
if you don't, just your user

Confirm Installation

Find "Navigator"
Open "Navigator"
Launch I[py] qtconsol

Compare forematter
```
Jupyter QtConsole 4.2.0
Python 3.5.1 |Anaconda custom (x86_64)| (default, Dec  7 2015, 11:24:55)
Type "copyright", "credits" or "license" for more information.
IPython 4.1.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
```


Alternative Confirmation

Open a terminal or dos prompt

type ipython -ic "exit()"


On windows, ipython might require ipython.exe
End of explanation
"""


!conda install "python>=3.3" "hdf5>=1.8.15.1" "h5py>=2.5.0" "libnetcdf>=4.3.3.1" "netcdf4>=1.2.2" "numpy=1.10.4" "scipy>=0.17.0" "matplotlib>=1.5.1" "pandas>=0.18.0" "proj4>=4.9.1" "pyproj>=1.9.4" "pyyaml>=3.11" "yaml>=0.1.6" "zlib>=1.2.8" "jupyter"

!pip install Shapely-1.5.16-cp34-cp34m-win_amd64.whl
!pip install basemap-1.0.8-cp34-none-win_amd64.whl

"""
Explanation: Extra Libraries
Most libraries we use, come with Anaconda. Some, however, need a little version syncronizing.
Windows

Download shapely for later http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely
Download basemap for later http://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap
End of explanation
"""


!conda install "python>=3.3" "hdf5>=1.8.15.1" "h5py>=2.5.0" "libnetcdf>=4.3.3.1" "netcdf4>=1.2.2" "numpy>=1.8" "scipy>=0.17.0" "matplotlib>=1.5.1" "pandas>=0.18.0" "proj.4>=4.9.1" "pyproj>=1.9.4" "pyyaml>=3.11" "yaml>=0.1.6" "zlib>=1.2.8" "basemap>=1.0.7" "shapely>=1.5"

"""
Explanation: Mac
End of explanation
"""


!pncdump.py --help

!pncdump.py sdf

"""
Explanation: Install PNC Library
PseudoNetCDF is an important library for processing Atmospheric data formats (bpch, uamiv, etc).

Visit site http://github.com/barronh/pseudonetcdf
How do you install it?
To get the latest version, add "--upgrade"

ANSWER HIDDEN
<div class="answers">
```
!pip install http://github.com/barronh/pseudonetcdf/archive/master.zip
```
</div>

Run pncdump.py
Just as a test.
1. Run with help option
2. Run with dummy path
End of explanation
"""


!assoc .py=Python.File
!ftype Python.File="C:\Users\barronh\Anaconda3\python.exe" "%1" %*

"""
Explanation: Windows file association

Do not make your own file associations.
If you do, you may need to delete it (http://websistent.com/delete-file-association-windows-7/)
If that still doesn't work, open a dos prompt.
End of explanation
"""


