Tech Notes


思想有多远,我们就可以走多远.
(We can go as far as we thought)
  1. Softwares List (mainly for Mac) - updated: 2017-09-29

  2. Install packages in Anaconda - updated: 2017-09-29

    1. Create a NEW python environment
      • Pip 9.0.1
      • Python 2.7.13
      • Setuptools 27.2.0
      • Vs2008_runtime 9.00.30729.5054
      • Vs2015_runtime 14.0.25420
      • Wheel 0.29.0
    2. install pkgs using Terminal BY the ORDER of:
      1. conda install -y -c conda-forge basemap
      2. conda install -y pandas scipy simplejson
      3. conda install -y -c conda-forge rasterio
      4. pip install pyshp pycrs shapely netcdf4
      5. conda install -y -c conda-forge gdal=2.0
      6. conda install -c anaconda statsmodels

      OR specify the version

      1. conda install -y -c conda-forge basemap=1.1 pandas=0.20.3 scipy=0.19.1 simplejson=3.11.1 gdal=2.0 rasterio=0.25.0 shapely=1.6.1 netcdf4 pyshp=1.2.12 statsmodels=0.8.0 krb5=1.14.2 pillow pkg-config gsl gcc
      1. pip install pycrs==0.1.3
    3. install my package:
      1. git clone https://wk1984@bitbucket.org/wk1984/quick-analysis-and-visualization.git
      2. cd quick-analysis-and-visualization
      3. python setup.py install
    4. test:

      python -c “from QuickPlots import QuickPlots”

      python -c “import QuickPlots;print QuickPlots.version

    5. Q&A:

      • Library not loaded: @loader_path/./libgssapi_krb5.2.2.dylib

        conda install krb5

  3. Install MacPorts - updated: 2017-10-10

    1. Install Xcode: Huge file > 5 GB

      Apple Store

      see details: https://guide.macports.org/#installing.xcode

    2. Install Xcode Command Line Tools:

      xcode-select –install

    3. Agree to Xcode license in Terminal:

      sudo xcodebuild -license

    4. Download and install MacPorts for your version of the Mac operating system:

      Just Double-Click pkg file!

  4. Install CDO by using MacPorts:

    CDO = Climate Data Operators

    Homepage = https://code.zmaw.de/projects/cdo

    sudo port install cdo

    To test whether it is installed rightly:

    cdo -V

  5. Install ILAMB in Anaconda.

    • create a new env for installing ILAMB (recommend)
    • install all requirements:

      conda install -c conda-forge -y numpy matplotlib netcdf4=1.2.4 sympy scipy mpi4py cfunits basemap

    • download ilamb from Bitbucket, then install:

      git clone https://wk1984@bitbucket.org/ncollier/ilamb.git

      cd ilamb

      python setup.py install

    • test:

      python -c “import ILAMB; print ILAMB.version

  6. Install NCL:

Notes: It should be consistent generation between gcc and gfortran from http://hpc.sourceforge.net/ and “gcc-x.y.bin.tar.gz” file. e.g, ncl_ncarg-6.4.0-MacOS_10.12_64bit_nodap_gnu530.tar.gz needs gcc-5.1-bin.tar.gz. If you install any other versions of gcc/gfortran, it would notice like:

> dyld: Library not loaded: /usr/local/lib/libgfortran.3.dylib
> Referenced from: /usr/local/ncl-6.4.0/bin/ncl
> Reason: image not found
  • Install XQuartz from https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg

  • For Bash environment: add three lines to ~/.bash, or ~/.bash_profile

    export DISPLAY=:0.0

    export NCARG_ROOT=/usr/local/ncl-6.4.0

    export PATH=$NCARG_ROOT/bin:$PATH

    Save and Quit: press “esc”, and input ‘wq’ following the “:”

    :wq

    After that, make the change active.

    source ~/.bash_profile

  • Test whether it works well (before using NCL, you need to launch XQuartz, otherwise, it will not work!):

    ng4ex gsun01n

The example looks like: