The python modules of the OSSL python package are setup for a virtual python environment with the first line of each module pointing towards this environment:
#!/Applications/anaconda3/envs/spectraimagine_py38/bin/python3.8
This must be edited to reflect your python setup before running the modules.
Before you can run the modules you probably also have to set execution rights on your local machine. In MacOS and Linux you do that with the chmod (change mode) command, for example:
chmod OSSL_import.py 755
Introduction
The python scripts for importing, plotting and modelling OSSL data are available for cloning or downloading from GitHub. GitHub is an online service for working with, and sharing, program codes using Git version control. You do not need to use GitHub or git as such to access the OSSL python package. You can simply download the OSSL package from GitHub and not bother about neither GitHub nor Git.
But if you want to easily follow any updates in the online available code you should install git/GitHub and then clone (rather than download) the OSSL package. If there are any updates you can later pull these from the online repository and they will immediately take effect in your local clone.
If you want to use Git for cloning and managing codes, you need to either Install git for command line or download and install GitHub Desktop. I have written a separate “blog” on using Git to get started.
In this post I will assume that you know how to use git or GitHub Desktop if you want to clone the OSSL python package. If not, I suggest you simply just download the OSSL-pydev repo as described in the next section.
Download OSSL-pydev from GitHub
To download the OSSL-pydev repository to your local machine, open a browser and navigate to https://github.com/karttur/OSSL-pydev. Click the green button to get the options for accessing the repo data and code (figure 1).
To download the data directly, just click the Download ZIP options.
When the ZIP file is completely downloaded, move it to the destination where you want to store and work with the python scripts. Unzip the downloaded zip-file.
If you are conversant with using Python and your system is set up with Python, you can jump straight to the next post of Cloning the OSSL example data or the more detailed section on the Open Soil Spectral Library and how to explore, download, import, plot and model the OSSL data.
Remember that the python modules of the OSSL python package are setup for a virtual python environment with the first line of each module pointing towards this environment, for example:
#!/Applications/anaconda3/envs/spectraimagine_py38/bin/python3.8
This must be edited to reflect your python setup before running the modules.
Setup a Python development environment
If you are beginner in Python or want to have a Graphical User Interface (GUI) with support for editing codes, proceed with the post guiding you through installing and setup Anaconda for defining your python environment. Then go to the instruction for how to install and setup the Integrated Development Environment (IDE) Eclipse. After finishing these two posts you should have a working python environment for running the python package ossl-xspectre.
The next post oulines the directory and file structure used as a scaffold for working with OSSL data using the OSSL-pydev package.