Getting Started
3 minute read
Prerequisites
This package requires;
- a linux environment or docker for Windows
- python version 3.8.10
- Miniconda (if you are planning to install it using conda)
Basic use installation via conda or pip
This package should be installed by run;
conda install -c bodc coast
However, there is also the option of;
pip install COAsT
(Optional): Extra python packages
In order to try the Examples described in this documentation, you may also need to install the following python packages (as they are not natively part of the COAsT package):
# cartopy
pip install cartopy
# xesmf
pip install xesmf
Development use installation
If you would prefer to work with a clone of the repository in a development python environment do the following. First clone the repository in the place where you want to work:
git clone https://github.com/British-Oceanographic-Data-Centre/COAsT.git
cd COAsT
Then build a python environment:
conda env update --prune --file environment.yml
conda activate coast
The last step is to install the coast package on this environment:
pip install -e .
Building the docker image and executing an interactive environment
Warning: Building the image is resource heavy
After cloning the repo (as above):
docker build . --tag coast
docker compose up -d
docker compose exec coast bash
You can now start a python session and import coast
. Docker compose mounts 3
directories from you host machine onto the docker container:
./example_files:/example_files
./config:/config
./example_scripts:/example_scripts
Check the installation!
Start by opening a python terminal and then importing COAsT:
import coast
Before using coast, we will just check if the installation process (Anaconda or pip) has installed correct package versions. In the python console copy the following:
import gsw
import matplotlib
print(gsw.__version__)
print(matplotlib.__version__)
The output should be
3.4.0
3.5.1
or later. If it is, great carry on. If it is not, problems may occur with some functionality in coast. In this case, please update these packages versions.
Test it!
In order to test the package, example data files and configuration files are recommended.
Example data files
Download example files and link them into a new directory:
wget -c https://linkedsystems.uk/erddap/files/COAsT_example_files/COAsT_example_files.zip && unzip COAsT_example_files.zip && rm -f COAsT_example_files.zip
Example configuration files
To facilitate loading different types of data, key information is passed to COAsT using configuration files. The config files used in the Examples are in the repository, or can be downloaded as static files:
wget -c https://github.com/British-Oceanographic-Data-Centre/COAsT/archive/refs/heads/master.zip && unzip master.zip && rm -f master.zip
mv COAsT-master/config ./ && rm -rf COAsT-master
Explore the API Reference Page to access detailed information about specific objects and methods. Additionally, you can find practical usage examples on the example pages.
IMPORTANT: If you are utilizing COAsT at the National Oceanography Centre (NOC) on Liverpool Servers, kindly access this link on the NOC Intranet for additional details.
Feedback
Was this page helpful?
Glad to hear it!
Sorry to hear that. Please tell us how we can improve.