You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Python tutorial is compatible with Python 3. It relies on several packages including **ecco_v4-py** which include codes to facilitate loading, plotting, and performing calculations on ECCOv4 state estimate fields.
5
+
The ECCO Python tutorial is compatible with Python 3. It relies on several packages including **ecco_v4-py** which include codes to facilitate loading, plotting, and performing calculations on ECCOv4 state estimate fields.
6
6
7
7
.. _in-python:
8
8
@@ -49,7 +49,7 @@ The latest installers for the Anaconda Distribution can be found on the `Anacond
49
49
Downloading the *ecco_v4_py* Python Package
50
50
-------------------------------------------
51
51
52
-
The *ecco_v4_py* package is a library of routines that are helpful for analyzing the ECCO the Version 4 state estimate. The latest version can always be found on our `github repository`_
52
+
The *ecco_v4_py* package is a library of routines for analyzing the ECCO the Version 4 state estimate. The latest version can always be found on our `github repository`_
53
53
54
54
55
55
Below are three **options** or installing the *ecco_v4_py* Python package.
@@ -64,8 +64,8 @@ Option 1: Clone into the repository using git (recommended)
64
64
Cloning into the *ecco_v4_py* repository using `git`
65
65
is recommended because
66
66
67
-
a) you can easily see and modify the ecco_v4_py source code
68
-
b) you can improve the source code and share your improvements with the community.
67
+
a) you can easily see and modify source code
68
+
b) you share your improvements with the community.
69
69
70
70
To use `git` to clone into the project simply run the following commands
71
71
(in the example below the Python files will go into ~/ECCOv4-py/)
@@ -77,9 +77,9 @@ To use `git` to clone into the project simply run the following commands
This method gets you the source code but if you make changes it is harder to share those changes with the community. Use this method if you don't have access to git.
82
+
This method downloads the source code but if you make changes it is harder to share those changes with the community using git.
83
83
84
84
.. code-block:: bash
85
85
@@ -89,141 +89,42 @@ This method gets you the source code but if you make changes it is harder to sha
89
89
> unzip master.zip
90
90
> rm master.zip
91
91
92
+
Option 3: Use the *conda* package manager (less recommended)
If you use *pip* to install the *ecco_v4_py* package the source code will be installed in your Python library directory from https://pypi.org/project/ecco-v4-py/. This method is OK if you don't plan to look at or modify the library code, but what fun would that be? Also, YMMV with respect to installing dependencies.
104
+
*ecco_v4_py* is available via the *pip* package manager (see https://pypi.org/project/ecco-v4-py/ ) Before using pip, you must first install the PROJ and GEOS libraries (see next section).
97
105
98
106
.. code-block:: bash
99
107
100
108
pip install ecco_v4_py
101
109
102
110
103
-
104
111
105
-
Installing Required Python Packages
106
-
-----------------------------------
107
-
108
-
The following additional packages must be installed
109
-
110
-
.. code-block:: bash
111
-
112
-
- aiohttp
113
-
- codecov
114
-
- cartopy>=0.18.0
115
-
- cmocean
116
-
- dask
117
-
- docrep
118
-
- fsspec
119
-
- future
120
-
- geos
121
-
- matplotlib
122
-
- netcdf4
123
-
- numpy
124
-
- pathlib
125
-
- proj
126
-
- pytest
127
-
- python=3.8
128
-
- pytest-cov
129
-
- pyresample
130
-
- scipy
131
-
- xarray
132
-
- xgcm>=0.5.0
133
-
- xmitgcm>=0.5.1
134
-
135
-
Below are several **options** or installing these packages. PICK ONE!
To activate the conda environment with the required dependencies call:
152
-
153
-
.. code-block:: bash
154
-
155
-
conda activate ECCOv4_py
156
-
112
+
Installing Dependencies
113
+
-----------------------
157
114
158
-
Alternatively, one can install the dependencies one at a time into an existing conda environment:
159
-
160
-
.. code-block:: bash
161
-
162
-
conda activate yourExistingCondaEnvironment
163
-
164
-
conda install -c conda-forge aiohttp
165
-
conda install -c conda-forge codecov
166
-
conda install -c conda-forge cartopy
167
-
conda install -c conda-forge cmocean
168
-
conda install -c conda-forge dask
169
-
conda install -c conda-forge docrep
170
-
conda install -c conda-forge fsspec
171
-
conda install -c conda-forge future
172
-
conda install -c conda-forge geos
173
-
conda install -c conda-forge matplotlib
174
-
conda install -c conda-forge netcdf4
175
-
conda install -c conda-forge numpy
176
-
conda install -c conda-forge pathlib
177
-
conda install -c conda-forge proj
178
-
conda install -c conda-forge pytest
179
-
conda install -c conda-forge pytest-cov
180
-
conda install -c conda-forge pyresample
181
-
conda install -c conda-forge scipy
182
-
conda install -c conda-forge xarray
183
-
conda install -c conda-forge xgcm
184
-
conda install -c conda-forge xmitgcm
185
-
186
-
187
-
Option 2: *pip* alone (not recommended)
188
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189
-
190
115
.. DANGER::
191
-
The Python module Cartopy requires the GEOS (Geometry Engine, Open Source) library. Instructions for installing this library can be found on the `geos website`_. Some users have reported difficulties installing GEOS libraries on their platforms. For that reason, we recommend using Conda (Option 1).
While conda is recommended because it automatically installs the required the GEOS (Geometry Engine) and PROJ (generic coordinate transformation software) binary libraries, you can install those libraries yourself.
195
117
118
+
Instructions for installing the GEOS library can be found on the `geos website`_.
196
119
197
-
.. code-block:: bash
120
+
Instructions for installing the PROJ library can be found on the `proj website`_.
198
121
199
-
pip install geos
200
-
pip install aiohttp
201
-
pip install codecov
202
-
pip install cmocean
203
-
pip install dask
204
-
pip install docrep
205
-
pip install fsspec
206
-
pip install future
207
-
pip install matplotlib
208
-
pip install netcdf4
209
-
pip install numpy
210
-
pip install pathlib
211
-
pip install pytest
212
-
pip install pytest-cov
213
-
pip install pyresample
214
-
pip install scipy
215
-
pip install xarray
216
-
pip install xgcm
217
-
pip install xmitgcm
218
-
pip install proj
219
-
pip install cartopy
220
-
221
-
122
+
Some users have reported difficulties installing these libraries on their platforms. For that reason, we recommend using conda (Option 1).
Assuming you downloaded the *ecco_v4_py* routines to ``/home/username/ECCOv4-py`` then simply add these three lines to the top of your Python programs (or Jupyter Notebooks)
229
130
@@ -240,6 +141,7 @@ If you you installed the package using pip then the *ecco_v4_py* library will be
0 commit comments