Context
The xcube software package was created for the purpose of producing, altering, examining, and sharing datacubes derived from Earth observation data.
This article aims to describe the procedure for installing and configuring xcube (and its applications) on Ubuntu.
π Note: version of Ubuntu used in this article is 20.04.
Install xcube on Ubuntu from script
Set up a conda environment
There are several methods to install xcube
, the main one being via Mamba or Conda.
Since Conda could be extremely slow, Mamba is generally preferred. Mamba is a dramatically faster drop-in replacement for Conda and can be installed using conda
itself.
The first step consists in updating the local apt
package index:
sudo apt-get update -y
Next, create a miniconda3
directory:
mkdir -p ~/miniconda3
Download bash script to install conda
with wget
. After, execute the bash script:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
And add the following PATH
variable:
export PATH=$PATH:/root/miniconda3/bin
Initialize conda
:
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
Source the conda
script to enable conda
command in the current shell:
>>. ./miniconda3/etc/profile.d/conda.sh
Once Miniconda is installed, use the conda
command to create a conda environment called xcube_env
and install Python (>=3.9
):
conda create -n xcube_env python=3.9 -y
Once installed, you can activate the environment:
conda activate xcube_env
Use conda to install mamba:
conda install -c conda-forge mamba -y
Install xcube into the environment
Finally, it is possible to install xcube
from its conda-forge
package. Starting from version 1, the xcube
installation automatically installs all plugins, such as the xcube viewer:
mamba install -c conda-forge xcube=1.2.0 proj=9.1.0 pyproj=3.4.1 -y
After xcube
is successfully installed, you can use the package to create and visualize data cubes from Earth Observation data. Examples on how to generate datacubes with xcube can be found here, and more examples will soon be available in our Jupyter Catalogue.
π To go further, you can check this article:
What's next?
Additional resources can be found in our Help Center. Should you require further assistance or wish to provide feedback, feel free to contact us through a chat session available in the bottom right corner of the page.