1.3. Setting up CODAS packages¶
If you installed a Virtual Computer, you do not need to follow these steps; they have already been done.
These instructions are for Install Option #2 (conda). You will:
1.3.1. Download CODAS software using Mercurial¶
This is the first of four steps to install the CODAS software on the computer built using earlier sections of this documentation.
Note
If you are running the pre-built virtual computer, you can skip this step. It is already done.
Mercurial is a distributed version control system. We use it to store and track changes in CODAS software. With any of the options (1,2,3) for installation, Mercurial should already be installed.
Make a location for CODAS software
We will put downloaded code and documentation in the following subdirectories of the user’s home directory:
~/adcpcode/programs
(for these mercurial repositories and a few zip archives)~/adcpcode/topog
(for topography)
To make this structure, execute:
mkdir ~/adcpcode
mkdir ~/adcpcode/programs
mkdir ~/adcpcode/topog
Use Mercurial to download our code, along with its history:
cd ~/adcpcode/programs
hg clone https://currents.soest.hawaii.edu/hg/codas3
hg clone https://currents.soest.hawaii.edu/hg/pycurrents
hg clone https://currents.soest.hawaii.edu/hg/onship
hg clone https://currents.soest.hawaii.edu/hg/uhdas
Now you are ready to compile and install CODAS components.
(Return to TOP)
1.3.2. Compile and install CODAS components¶
Note
If you are using a prebuilt Virtual Computer, you can skip this step
At this point, you should have a working conda Python environment,
and you have used Mercurial to clone our repositories
into ~/adcpcode/programs
.
Check your Python environment. Your prompt should include
(pycodas)
; if it doesn’t, execute conda activate pycodas
. You
can also check your python version:
python --version
should return something like:
Python 3.9.1
The version number will depend on when and how you installed or last updated Python.
In the following, administrative privileges are needed for some
operations, and obtained using sudo
.
Compile and install codas3
(C code for libraries and executables) first.
For a conda-based installation:
cd ~/adcpcode/programs/codas3
./waf configure --python_env
./waf build
./waf install
cd ~
The --python_env
option for the conda case will install to
standard locations in the pycodas environment within your home directory tree,
so no administrative permissions are required.
Now we compile the C extension code in the pycurrents
package, and
install it along with the uhdas
and onship
packages. Most of
the CODAS processing tools are in pycurrents
.
For the conda-based installation:
cd ~/adcpcode/programs/pycurrents
pip3 install .
cd ../uhdas
pip3 insatll .
cd ../onship
pip3 install .
cd ~
Note
The uhdas
installation here is only for obtaining access to code used
in processing data acquired with UHDAS. It does not constitute the UHDAS
system itself.
Now that you have compiled and installed CODAS C and Python code, it is time for the next step: getting the non-Mercurial components.
(Return to TOP)
1.3.3. Download documentation and processing demo directories¶
Note
If you are using a prebuilt Virtual Computer, you can skip this step
At this point, you should have a working conda Python environment,
you have used Mercurial to clone our repositories into ~/adcpcode/programs
,
and you have installed all the CODAS code. Now we are going to get
components supporting topgraphy, documentation, and demos.
The components to be downloaded are zip archives served from
https://currents.soest.hawaii.edu/docs/zipped. The most reliable way
to download them is by using the curl
utility which is available
by default on MacOS. You can probably right-click on the items and
select “download”, but they may not land where you want them to be.
Follow the instructions below for a consistent result.
To download and install everything in the appropriate location, execute:
cd ~/adcpcode/programs
curl -O https://currents.soest.hawaii.edu/docs/zipped/adcp_doc.zip
unzip adcp_doc.zip
curl -O https://currents.soest.hawaii.edu/docs/zipped/codas_demos.zip
unzip codas_demos.zip
The first of these contains the same documentation you are reading now:
zip archive |
subdirectory |
contents |
---|---|---|
DOCUMENTATION |
||
adcp_doc.zip |
adcp_doc |
|
The second contains tutorial and demo material:
zip archive |
subdirectory |
contents |
---|---|---|
DEMO PROCESSING |
||
codas_demos_proc.zip |
codas_demos/adcp_pyproc |
|
codas_demos/uhdas_data |
|
|
codas_demos/vmdas_data |
|
Your codas_demos directory structure should look like this after unpacking:

The fourth and final step in getting CODAS processing to work, is to download suitable topography.
(Return to TOP)
1.3.4. Download and install Topography files¶
Note
If you are using a prebuilt Virtual Computer, you can skip this step
For processing, editing, and visualization we need topography data; we will use Etopo1. As for the documentation and demo data, we will use curl to download it:
cd ~/adcpcode/topog
mkdir etopo
cd etopo
curl -O ftp://currents.soest.hawaii.edu/pub/outgoing/etopo1_for_pycurrents.zip
unzip etopo1_for_pycurrents.zip
We will install this in a location where the pycurrents code that uses it can find it, but instead of moving the directory we will just point to it with a symbolic link:
With conda:
cd ~/miniconda3
ln -s ~/adcpcode/topog .
cd
(Return to TOP)