cedadev / extra-sci-packages

A set of RPM packages to supplement Jaspy to provide an scientific analysis environment for CentOS7
1 stars 0 forks source link

extra-sci-packages

A set of RPM packages to supplement Jaspy to provide an scientific analysis environment for CentOS7, principally for use on JASMIN.

To use these packages:

source /opt/rh/jasmin-sci/enable

Removed packages

The following packages which were previously supported under JAP are not provided:

Libraries

Where a package provides a library and associated header files which you wish to use for compilation, it is necessary to point to it using the compiler flag

-I/opt/rh/jasmin-sci/root/usr/include

and the linker flag

-L/opt/rh/jasmin-sci/root/usr/lib64

This applies whether the library is a shared or static library.

However, for run-time use of a shared library, the enable script sets LD_LIBRARY_PATH so that it will be found automatically even though it is in a non-standard location.

Package-specific documentation

Ferret

You should type source ferret_paths.sh after enabling the extra-sci-packages, as this sets additional ferret-specific environment variables that may be needed.

Octave

A copy of octave exists in Jaspy, but it is provided also here in order to provide a version which contains the netcdf package. Enable the extra-sci-packages after Jaspy to pick this up.

Misr toolkit python bindings

Python bindings are not provided for the Misr toolkit, because this would tie it into a particular python installation. Instead, instructions are provided here for you to compile your own python wrapper under your directory, for the Python installation that you are working with.

The example below assumes that you are working with the default release of Jaspy 2.7. (Note that when tested, the Python 3.7 equivalent gave an error, so it may be that the MTK Python bindings are not supported for Python 3.)

Build example

The following commands are typed at the shell prompt.

# load jasmin-sci tools and Jaspy
source /opt/rh/jasmin-sci/enable
module load jaspy/2.7

# create and activate a virtual environment
virtualenv --system-site-packages my_venv
. my_venv/bin/activate

# get the MTK source (matching the installed version) and build the python
# bindings

wget -O Mtk-src-1.4.5.tar.gz https://github.com/nasa/MISR-Toolkit/archive/v1.4.5.tar.gz
tar xvfz Mtk-src-1.4.5.tar.gz
cd MISR-Toolkit-1.4.5/wrappers/python/
export HDFLIB=/usr/lib64/hdf/
export HDFINC=/usr/include/hdf/
export HDFEOS_INC=/opt/rh/jasmin-sci/root/usr/include/
export HDFEOS_LIB=/opt/rh/jasmin-sci/root/usr/lib64/
ln -s $HDFEOS_LIB/libMisrToolkit.a ../../lib
export CFLAGS=`python-config --cflags`
python setup.py install

Run-time example

The following commands are typed at the shell prompt, except for the example python session, shown indented.

# set up the environment
source /opt/rh/jasmin-sci/enable
module load jaspy/2.7
. my_venv/bin/activate

# get some test data
wget https://gamma.hdfgroup.org/ftp/pub/outgoing/NASAHDF/MISR_AM1_CGAL_2017_F06_0024.hdf

# example python session
python

  >>> from MisrToolkit import *
  >>> r = MtkRegion(37, 50, 60)
  >>> r.center
  (44.327741112333754, -108.92382807624027)
  >>> f = MtkFile("MISR_AM1_CGAL_2017_F06_0024.hdf")
  >>> f.grid_list
  ['AlbedoAverage_1_degree', 'AlbedoAverage_5_degree']