Skip to content

Jupyter notebook used for the "Radiative Transfer practical using Py6S" session for the NEODAAS-FSF workshop, 8-11th November 2021.

Notifications You must be signed in to change notification settings

NEODAAS/Py6S-Practical---NEODAAS-FSF-Workshop-2021

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Py6S Practical - Day 2 of NEODAAS-FSF Workshop 2021

This Jupyter notebook is used to demonstrate the basics of radiative transfer modelling as part of the NERC Earth Observation Data Analysis and AI (NEODAAS) and Field Spectroscopy Facility (FSF) training course.

For more details about the course and future training opportunities see: https://www.neodaas.ac.uk/Services/Support_and_training

There are two methods to run the practical, either locally or on MAGEOHub (if you have access). The MAGEOHub install instructions should also work on other JupyterHub instances but you may need to change some paths.

Local

Software install

The libraries required for this practical can be installed using conda, if you haven't already installed them, first create a new environment from the anaconda interface or via a terminal using the following commands:

conda create -n py6s
conda activate py6s

Then install the required libraries using:

conda install -c conda-forge py6s jupyterlab git
conda install -c https://data.neodaas.ac.uk/files/conda/ pyspectra

Running the practical

After the software has been isntalled, open the py6s environment and make a local copy of the git repository containing this practical and the data using:

git clone https://github.com/NEODAAS/Py6S-Practical---NEODAAS-FSF-Workshop-2021.git

Then open the notebook in Jupyterlab using:

jupyter lab Py6S-Practical---NEODAAS-FSF-Workshop-2021/Py6S_practical_session.ipynb

MAGEOHub

Software install

Log onto MAGEOHub and open a terminal window (from the Launcher under the section 'Other' select 'Terminal').

If you haven't already make a folder on the Lustre scratch space and place a shortcut in your home directory by typing the following commands (replacing <your_github_username> with your github username, used to access MAGEOHub) and pressing enter.

mkdir /lustre_scratch/<your_github_username>
ln -s /lustre_scratch/<your_github_username> ~/lustre_scratch

Then create a new environment for. the practical using the following command:

conda create --prefix /home/jovyan/lustre_scratch/conda-envs/py6s

You will need to type 'y' at the dialogue.

Activate this environment using:

source activate /home/jovyan/lustre_scratch/conda-envs/py6s

Then install the software with:

conda install -c conda-forge py6s ipykernel
conda install -c https://data.neodaas.ac.uk/files/conda/ pyspectra

You will again need to type 'y' at the dialogue after each of these commands, it will take a couple of minutes to install the software.

After the software has been installed you need to add this environment to the launcher with the following command:

python -m ipykernel install --user --name py6s --display-name "Py6S Environment"

If you now click on the blue + button to open a new Launcher you should see 'Py6S Environment' listed next to 'Python 3' under the 'Notebook' section.

Running the practical

The first step is to clone this repository (within the 'Terminal' you had been using to install software):

git clone https://github.com/NEODAAS/Py6S-Practical---NEODAAS-FSF-Workshop-2021.git

In the left hand folder browser you should now have a folder called 'Py6S-Practical---NEODAAS-FSF-Workshop-2021', click to go into this and click on the notebook 'Py6S_practical...' to open it.

Once this is open you will need to tell it to use the Py6S Environment, to do this click on where it says 'Python 3' near the top, this should bring up a 'Select Kernel' dialogue, pick 'Py6S Environment' and click 'Select'.

When running through the practical you might run into an error with Py6S '6S executable not found', if this happens create a new cell in the notebook and run the following commands:

import os
os.environ['PATH'] = os.environ['PATH'] + ':/home/jovyan/lustre_scratch/conda-envs/py6s/bin/' 

This will add the path sixs has been installed so the Python functions can find it.

About

Jupyter notebook used for the "Radiative Transfer practical using Py6S" session for the NEODAAS-FSF workshop, 8-11th November 2021.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%