Skip to content

Commit

Permalink
Initial commit. Release 0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
jr3cermak committed May 6, 2021
1 parent 37cae2e commit c43a90d
Show file tree
Hide file tree
Showing 81 changed files with 16,245 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
Expand Down
187 changes: 186 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,187 @@
# gridtools
A collection of grid generation tools

A generic set of grid manipulation tools for computer models. These tools are
adapted from the ROMS ocean model and for specific use in the MOM6 ocean model.
One could hope it can be kept generic enough to support any model. The focus
is on supporting the MOM6 ocean model.

For in depth details about the MOM6 ocean model, please visit provided
[wiki](https://github.com/NOAA-GFDL/MOM6-examples/wiki) pages. Technical
details about this repository can be found below. For usage of
the GridUtils library, please visit the [user manual](docs/manual/GridUtils.md).

Required items:
* spherical.py
* gridutils.py
* app.py

Optional items:
* sysinfo.py

Various tools are available to manipulation of new and existing grids in
an iterative or interactive form.

Python notebooks:
* mkGridIterative.ipynb
* mkGridInteractive.ipynb

With this software, you should be able to operate in any mode you prefer.

# Operational Modes

## Command Line

Using the command line or writing your own python scripts possible utilizing this library.
To look at a few examples, please look at the mkGridsExample1.py, mkGridsExample2.py and
mkGridsExample3.py programs.

## Command Line Widget Mode

* ipython --pylab

The interpreter, ipython, can run python scripts and notebook scripts. To run a notebook
script, you can use `ipython -c "%run your_script.ipynb"`. Or start ipython, and then
`%run your_script.ipynb`.

Again, the mkGridsExample.py programs can be run with ipython.

## Jupyter notebook

* jupyter notebook

These prefer notebook files (ipynb). Please see the mkGridIterative.ipynb program for a hands
on way to access the grid generation library.

A simple graphical user interface (GUI) was built and is available when you run the
mkGridInteractive.ipynb notebook.

## Jupyter lab

* jupyter lab

These prefer notebook files (ipynb). Please see the mkGridIterative.ipynb program for a hands
on way to access the grid generation library.

A simple graphical user interface (GUI) was built and is available when you run the
mkGridInteractive.ipynb notebook.

## mybinder

* Main: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ESMG/gridtools/main)
* Dev: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ESMG/gridtools/dev)

Instead of loading software on your computer, the library and application is hosted on a cloud system. You do not
have to install anything on your system to use the cloud system's copy of the grid generation library.

# Application

The grid generation application, mkGridInteractive.ipynb, can be run on a cloud hosting system. The application has been adapted to work on mybinder.org.
NOTICE: The mybinder application can take upwards to 30 minutes to build.

Use the following options:
* GitHub=https://github.com/ESMG/gridtools
* Git ref=main
* Launch
* Once the server loads, navigate to gridTools/mkMapInteractive.ipynb
* Re-run all the cells
* Have fun with the grid editor.

# Code contributions

## Lambert Conformal Conic Grid Generation
Author: Niki Zadeh [REPO](https://github.com/nikizadehgfdl/grid_generation)
* [regional_grid_spheical.ipynb](https://github.com/nikizadehgfdl/grid_generation/blob/dev/jupynotebooks/regional_grid_spherical.ipynb)

## Numpy bitwise-the-same floating-point values
Author: Alistair Adcroft [REPO](https://github.com/adcroft/numpypi)
* To obtain bitwise-the-same floating-point values in certain non-time-critical calculations.

## ROMS to MOM6 Grid Converter
Authors: Mehmet Ilicak; Alistair Adcroft [REPO](https://github.com/ESMG/pyroms)
* [convert_ROMS_grid_to_MOM6.py](https://raw.githubusercontent.com/ESMG/pyroms/python3/examples/grid_MOM6/convert_ROMS_grid_to_MOM6.py)

# Installation

If you plan to use the grid generation software on your system, you need to peform the following steps.

## Step 1

[Download](https://github.com/ESMG/gridtools/archive/refs/heads/main.zip) or [clone](https://github.com/ESMG/gridtools.git) the
[ESMG/gridtools](https://github.com/ESMG/gridtools) repository.

Discover the full directory path to gridtools/gridTools/lib. Place the full path in the environment variable `LIBROOT` if you are planning to run
the python notebooks. If you are going to use the library in your scripts, simply append the full path to `PYTHONPATH`. In the future, we will enable
installation using ptyhon pip.

## Step 2

Install conda or manually install the python libraries and software dependencies that would allow you to run the python scripts or notebooks.

We have pulled together some pre-defined environments. You may also install an environment yourself. Please look at the [conda](docs/conda/README.md)
page for more information about conda.

We currently recommend the *xesmfTools* environment for use with this libaray.

## Step 3

Follow any steps in the "Workarounds" section.

# Workarounds

These are the current workarounds that are required for the grid toolset
package. You will need to perform these steps once if you plan to install a
copy of the grid generation software.

## datashader

The lastest version from github is required for proper operation of bokeh, holoviews and panel which
are used by the interactive portions of the grid generation library.

[REPO](https://github.com/holoviz/datashader)

Installation:
* Download or clone this repository.
* Change directory to the datashader directory.
* Make sure your conda enviroment is active.
* `pip install -e .`

## numpypi

NOTE: This has not been fully implemented yet. Do not worry about this just yet.

For bitwise-the-same reproducable results, a numpy subset of computational functions are
provided. These routines are slower than the numpy native routines.
[REPO](https://github.com/adcroft/numpypi)

# More

Until we can activate Sphinx to create our body of documentation we will have to resort
to upkeep of a manual index.

[Documentation](docs/Documentation.md)
* [conda](docs/conda/README.md)
* [development](docs/development)
* [CHANGELOG](docs/development/CHANGELOG.md): Development log of changes
* [CREDITS](docs/development/CREDITS.md)
* [Design](docs/development/Design.md): Design elements for the grid generation library
* [Important References](docs/development/ImportantReferences.md): Things that helped this project work
* [Jupyter](docs/development/Jupyter.md): Notes on embeddeding applications within a notebook
* [python](docs/development/python)
* [leaflet](docs/development/python/leaflet.md)
* [panel](docs/development/python/panel.md)
* [pyroms](docs/development/python/pyroms.md)
* [TODO](docs/development/TODO.md): Milestones, tasks, todos and wishes
* [grids](docs/grids)
* [Examples](docs/grids/Examples.md): Descriptions of grids used in examples
* [Grids](docs/grids/Grids.md)
* [MOM6](docs/grids/MOM6.md): MOM6 grids
* [MOM6ROMS](docs/grids/MOM6ROMS.md): Important things between MOM6 and ROMS grids
* [ROMS](docs/grids/ROMS.md): ROMS grids
* [manual](docs/manual/GridUtils.md): User manual for the GridUtils library
* [resources](docs/resources)
* [Bathymetry](docs/resources/Bathymetry)

# Development

This project is soliciting help in development. Please contribute ideas or bug requests using the issues tab.
Code contributions can be sent via github's pull request process.
41 changes: 41 additions & 0 deletions conda/base_export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: base
channels:
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- brotlipy=0.7.0=py38h27cfd23_1003
- ca-certificates=2020.10.14=0
- certifi=2020.6.20=pyhd3eb1b0_3
- cffi=1.14.3=py38h261ae71_2
- chardet=3.0.4=py38h06a4308_1003
- conda=4.9.2=py38h06a4308_0
- conda-package-handling=1.7.2=py38h03888b9_0
- cryptography=3.2.1=py38h3c74f83_1
- idna=2.10=py_0
- ld_impl_linux-64=2.33.1=h53a641e_7
- libedit=3.1.20191231=h14c3975_1
- libffi=3.3=he6710b0_2
- libgcc-ng=9.1.0=hdf63c60_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- ncurses=6.2=he6710b0_1
- openssl=1.1.1h=h7b6447c_0
- pip=20.2.4=py38h06a4308_0
- pycosat=0.6.3=py38h7b6447c_1
- pycparser=2.20=py_2
- pyopenssl=19.1.0=pyhd3eb1b0_1
- pysocks=1.7.1=py38h06a4308_0
- python=3.8.5=h7579374_1
- readline=8.0=h7b6447c_0
- requests=2.24.0=py_0
- ruamel_yaml=0.15.87=py38h7b6447c_1
- setuptools=50.3.1=py38h06a4308_1
- six=1.15.0=py38h06a4308_0
- sqlite=3.33.0=h62c20be_0
- tk=8.6.10=hbc83047_0
- tqdm=4.51.0=pyhd3eb1b0_0
- urllib3=1.25.11=py_0
- wheel=0.35.1=pyhd3eb1b0_0
- xz=5.2.5=h7b6447c_0
- yaml=0.2.5=h7b6447c_0
- zlib=1.2.11=h7b6447c_3
prefix: /home/cermak/miniconda3
14 changes: 14 additions & 0 deletions conda/bokeh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: bokeh
# This is a bokeh/jupyterlab specific environment
channels:
- conda-forge
dependencies:
- bokeh
- jupyter_bokeh
- cartopy
- geopandas
- xlrd
- openpyxl
- jupyterlab
- conda
- pip
Loading

0 comments on commit c43a90d

Please sign in to comment.