pyearthmesh 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyearthmesh-0.1.0/LICENSE +28 -0
- pyearthmesh-0.1.0/MANIFEST.in +22 -0
- pyearthmesh-0.1.0/PKG-INFO +155 -0
- pyearthmesh-0.1.0/README.md +108 -0
- pyearthmesh-0.1.0/pyearthmesh/__init__.py +32 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/__init__.py +19 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/dggrid.py +627 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/edge.py +398 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/hexagon.py +572 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/latlon.py +557 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/link.py +562 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/meshcell.py +648 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/mpas.py +652 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/square.py +533 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/tin.py +721 -0
- pyearthmesh-0.1.0/pyearthmesh/classes/vertex.py +240 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/cubicsphere/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/cubicsphere/create_cubicsphere_mesh.py +287 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/dggs/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/dggs/dggrid/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/dggs/dggrid/create_dggrid_mesh.py +268 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/dggs/healpix/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/dggs/healpix/create_rhealpix_mesh.py +219 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/dggs/isea/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/dggs/isea/create_isea_mesh.py +221 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/hexaon/__init__.py +1 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/hexaon/create_hexagon_mesh.py +524 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/latlon/__init__.py +1 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/latlon/create_latlon_mesh.py +475 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/square/__init__.py +0 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/square/create_square_mesh.py +270 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/triangular/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/structured/triangular/create_triangular_mesh.py +197 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/unstructured/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/unstructured/mpas/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/unstructured/mpas/create_mpas_mesh.py +784 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/unstructured/tin/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/meshes/unstructured/tin/create_tin_mesh.py +280 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/__init__.py +1 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/convert_attributes.py +57 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/convert_coordinates.py +121 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/extract_land_meshcells.py +202 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/find_minimal_enclosing_polygon.py +28 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/inpoly2.py +221 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/loadgeo.py +189 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/loadgeo2.py +142 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/run_jigsaw.py +1071 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/saveesm.py +299 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/savetin.py +82 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/jigsaw/utility.py +155 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/mesh_utility.py +703 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/mpas_tools/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/mpas_tools/compose.py +73 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/mpas_tools/mpasmsh.py +299 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/mpas_tools/spacing.py +263 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/potentiometric/__init__.py +3 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/potentiometric/calculate_potentiometric.py +49 -0
- pyearthmesh-0.1.0/pyearthmesh/utility/split_by_length.py +127 -0
- pyearthmesh-0.1.0/pyearthmesh.egg-info/PKG-INFO +155 -0
- pyearthmesh-0.1.0/pyearthmesh.egg-info/SOURCES.txt +67 -0
- pyearthmesh-0.1.0/pyearthmesh.egg-info/dependency_links.txt +1 -0
- pyearthmesh-0.1.0/pyearthmesh.egg-info/requires.txt +23 -0
- pyearthmesh-0.1.0/pyearthmesh.egg-info/top_level.txt +1 -0
- pyearthmesh-0.1.0/pyproject.toml +102 -0
- pyearthmesh-0.1.0/setup.cfg +4 -0
- pyearthmesh-0.1.0/setup.py +10 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Chang Liao
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Include documentation and metadata files
|
|
2
|
+
include README.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
|
|
6
|
+
# Include all Python files in the package
|
|
7
|
+
recursive-include pyearthmesh *.py
|
|
8
|
+
|
|
9
|
+
# Exclude development and build files
|
|
10
|
+
exclude .gitignore
|
|
11
|
+
exclude mesh_utility.log
|
|
12
|
+
recursive-exclude .github *
|
|
13
|
+
recursive-exclude .vscode *
|
|
14
|
+
recursive-exclude tests *
|
|
15
|
+
recursive-exclude docs *
|
|
16
|
+
recursive-exclude examples *
|
|
17
|
+
recursive-exclude data *
|
|
18
|
+
|
|
19
|
+
# Exclude Python cache files
|
|
20
|
+
global-exclude __pycache__
|
|
21
|
+
global-exclude *.py[co]
|
|
22
|
+
global-exclude .DS_Store
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyearthmesh
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A lightweight mesh generation and manipulation package for Earth science applications
|
|
5
|
+
Author-email: Chang Liao <changliao.climate@gmail.com>
|
|
6
|
+
License: BSD-3-Clause
|
|
7
|
+
Project-URL: Homepage, https://github.com/changliao1025/pyearthmesh
|
|
8
|
+
Project-URL: Documentation, https://pyearthmesh.readthedocs.io
|
|
9
|
+
Project-URL: Repository, https://github.com/changliao1025/pyearthmesh
|
|
10
|
+
Project-URL: Issues, https://github.com/changliao1025/pyearthmesh/issues
|
|
11
|
+
Keywords: mesh,GIS,earth science,DGGS,hexagon,TIN,MPAS,spatial analysis
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: numpy>=1.20.0
|
|
29
|
+
Requires-Dist: pyearth>=0.2.1
|
|
30
|
+
Provides-Extra: viz
|
|
31
|
+
Requires-Dist: pyearthviz>=0.1.0; extra == "viz"
|
|
32
|
+
Provides-Extra: viz3d
|
|
33
|
+
Requires-Dist: pyearthviz3d>=0.1.0; extra == "viz3d"
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
37
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
38
|
+
Requires-Dist: flake8>=6.0; extra == "dev"
|
|
39
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
40
|
+
Provides-Extra: docs
|
|
41
|
+
Requires-Dist: sphinx>=5.0; extra == "docs"
|
|
42
|
+
Requires-Dist: sphinx-rtd-theme>=1.0; extra == "docs"
|
|
43
|
+
Requires-Dist: myst-parser>=1.0; extra == "docs"
|
|
44
|
+
Provides-Extra: all
|
|
45
|
+
Requires-Dist: pyearthmesh[dev,docs,viz,viz3d]; extra == "all"
|
|
46
|
+
Dynamic: license-file
|
|
47
|
+
|
|
48
|
+
### PyEarthMesh
|
|
49
|
+
|
|
50
|
+
PyEarthMesh is a lightweight mesh generation and manipulation package for Earth science applications.
|
|
51
|
+
|
|
52
|
+
Every hiker/camper would love to have a leatherman pocket knife around because it is lightweight, versatile and reliable, sometimes life saving.
|
|
53
|
+
|
|
54
|
+
This is why I developed PyEarth, a lightweight Python package to support various Earth science tasks.
|
|
55
|
+
I use it in my daily work, and nearly all my research papers use it in some way.
|
|
56
|
+
|
|
57
|
+
**Note:** PyEarth has been restructured and is now part of the **PyEarthSuite** ecosystem. To keep each package lightweight and focused, PyEarth has been split into several specialized packages:
|
|
58
|
+
|
|
59
|
+
- **pyearth** (this package) - Core GIS operations, spatial toolbox, and system utilities
|
|
60
|
+
- **pyearthviz** - 2D visualization utilities
|
|
61
|
+
- **pyearthviz3d** - 3D visualization with GeoVista
|
|
62
|
+
- **pyearthriver** - River network graph algorithms and data structures
|
|
63
|
+
- **pyearthmesh** - Mesh generation and manipulation tools
|
|
64
|
+
- **pyearthhelp** - Helper utilities for data access (NWIS, NLDI, GSIM) and HPC operations
|
|
65
|
+
|
|
66
|
+
This modular approach allows you to install only what you need while maintaining the ability to use all packages together.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Dependency
|
|
70
|
+
|
|
71
|
+
PyEarthMesh depends on the following packages:
|
|
72
|
+
|
|
73
|
+
**Required:**
|
|
74
|
+
|
|
75
|
+
Because PyEarthMesh relies on many APIs from PyEarth, it requires PyEarth to be installed.
|
|
76
|
+
Other than that, additonal dependencies maybe required based on the specific functionalities you intend to use:
|
|
77
|
+
|
|
78
|
+
1. `dggrid` - For DGGRID mesh generation
|
|
79
|
+
2. `dggal` - For DGGS mesh manipulation
|
|
80
|
+
3. `jigsaw` and `MPAS-tools` - For MPAS mesh generation and manipulation
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Documentation
|
|
84
|
+
|
|
85
|
+
Please refer to the [documentation](https://pyearthmesh.readthedocs.io) for details on how to get started using the PyEarth package.
|
|
86
|
+
|
|
87
|
+
### Installation
|
|
88
|
+
|
|
89
|
+
The most easy way to install PyEarthMesh is via `conda`.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Install from conda (recommended)
|
|
93
|
+
conda install pyearthmesh -c conda-forge
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Content
|
|
97
|
+
|
|
98
|
+
PyEarthMesh provides general-purpose functions organized into several categories:
|
|
99
|
+
|
|
100
|
+
#### 1. Structured Meshes
|
|
101
|
+
|
|
102
|
+
- **Square**: Projected coordinate handling, grid generation, coordinate reprojection
|
|
103
|
+
- **LatLon**: Longitude/latitude grid generation, coordinate reprojection
|
|
104
|
+
- **Hexagon**: Projected hexagon grid generation, coordinate reprojection
|
|
105
|
+
- **Triangular**: Projected triangular grid generation, coordinate reprojection
|
|
106
|
+
- **DGGRID**: DGGS grid generation, coordinate reprojection
|
|
107
|
+
- **Healpix**: Healpix grid generation, coordinate reprojection
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
#### 2. Unstructured Meshes
|
|
111
|
+
|
|
112
|
+
- **TIN**: Traiangular Irregular Network generation, manipulation, and analysis
|
|
113
|
+
- **MPAS**: Model for Prediction Across Scales mesh generation, manipulation, and analysis
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Related Packages
|
|
118
|
+
|
|
119
|
+
PyEarthMesh is part of the PyEarthSuite ecosystem, which includes several specialized packages:
|
|
120
|
+
|
|
121
|
+
- **[pyearthviz](../pyearthviz)** - 2D plotting and visualization
|
|
122
|
+
- **[pyearthviz3d](../pyearthviz3d)** - 3D globe visualization with GeoVista
|
|
123
|
+
- **[pyearthriver](../pyearthriver)** - River network topology and graph algorithms
|
|
124
|
+
- **[pyearthmesh](../pyearthmesh)** - Advanced mesh generation tools
|
|
125
|
+
- **[pyearthhelp](../pyearthhelp)** - Data retrieval and HPC job management
|
|
126
|
+
|
|
127
|
+
### Acknowledgment
|
|
128
|
+
|
|
129
|
+
This research was supported as part of the Next Generation Ecosystem Experiments-Tropics, funded by the U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research at Pacific Northwest National Laboratory. The study was also partly supported by U.S. Department of Energy Office of Science Biological and Environmental Research through the Earth and Environmental System Modeling program as part of the Energy Exascale Earth System Model (E3SM) project.
|
|
130
|
+
|
|
131
|
+
### License
|
|
132
|
+
|
|
133
|
+
Copyright © 2022, Battelle Memorial Institute
|
|
134
|
+
|
|
135
|
+
1. Battelle Memorial Institute (hereinafter Battelle) hereby grants permission to any person or entity lawfully obtaining a copy of this software and associated documentation files (hereinafter "the Software") to redistribute and use the Software in source and binary forms, with or without modification. Such person or entity may use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software and may permit others to do so, subject to the following conditions:
|
|
136
|
+
|
|
137
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
|
|
138
|
+
|
|
139
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
140
|
+
|
|
141
|
+
* Other than as used herein, neither the name Battelle Memorial Institute or Battelle may be used in any form whatsoever without the express written consent of Battelle.
|
|
142
|
+
|
|
143
|
+
2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BATTELLE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
144
|
+
|
|
145
|
+
### References
|
|
146
|
+
|
|
147
|
+
Several publications describe the algorithms used in `PyEarth` in detail. If you make use of `PyEarth` in your work, please consider including a reference to the following:
|
|
148
|
+
|
|
149
|
+
* Chang Liao. (2022). PyEarth: A lightweight Python package for Earth science (Software). Zenodo. https://doi.org/10.5281/zenodo.6109987
|
|
150
|
+
|
|
151
|
+
PyEarth is also supporting several other Python packages/projects, including:
|
|
152
|
+
|
|
153
|
+
* Liao et al., (2023). pyflowline: a mesh-independent river network generator for hydrologic models. Journal of Open Source Software, 8(91), 5446, https://doi.org/10.21105/joss.05446
|
|
154
|
+
|
|
155
|
+
* Liao. C. (2022). HexWatershed: a mesh independent flow direction model for hydrologic models (0.1.1). Zenodo. https://doi.org/10.5281/zenodo.6425881
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
### PyEarthMesh
|
|
2
|
+
|
|
3
|
+
PyEarthMesh is a lightweight mesh generation and manipulation package for Earth science applications.
|
|
4
|
+
|
|
5
|
+
Every hiker/camper would love to have a leatherman pocket knife around because it is lightweight, versatile and reliable, sometimes life saving.
|
|
6
|
+
|
|
7
|
+
This is why I developed PyEarth, a lightweight Python package to support various Earth science tasks.
|
|
8
|
+
I use it in my daily work, and nearly all my research papers use it in some way.
|
|
9
|
+
|
|
10
|
+
**Note:** PyEarth has been restructured and is now part of the **PyEarthSuite** ecosystem. To keep each package lightweight and focused, PyEarth has been split into several specialized packages:
|
|
11
|
+
|
|
12
|
+
- **pyearth** (this package) - Core GIS operations, spatial toolbox, and system utilities
|
|
13
|
+
- **pyearthviz** - 2D visualization utilities
|
|
14
|
+
- **pyearthviz3d** - 3D visualization with GeoVista
|
|
15
|
+
- **pyearthriver** - River network graph algorithms and data structures
|
|
16
|
+
- **pyearthmesh** - Mesh generation and manipulation tools
|
|
17
|
+
- **pyearthhelp** - Helper utilities for data access (NWIS, NLDI, GSIM) and HPC operations
|
|
18
|
+
|
|
19
|
+
This modular approach allows you to install only what you need while maintaining the ability to use all packages together.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Dependency
|
|
23
|
+
|
|
24
|
+
PyEarthMesh depends on the following packages:
|
|
25
|
+
|
|
26
|
+
**Required:**
|
|
27
|
+
|
|
28
|
+
Because PyEarthMesh relies on many APIs from PyEarth, it requires PyEarth to be installed.
|
|
29
|
+
Other than that, additonal dependencies maybe required based on the specific functionalities you intend to use:
|
|
30
|
+
|
|
31
|
+
1. `dggrid` - For DGGRID mesh generation
|
|
32
|
+
2. `dggal` - For DGGS mesh manipulation
|
|
33
|
+
3. `jigsaw` and `MPAS-tools` - For MPAS mesh generation and manipulation
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Documentation
|
|
37
|
+
|
|
38
|
+
Please refer to the [documentation](https://pyearthmesh.readthedocs.io) for details on how to get started using the PyEarth package.
|
|
39
|
+
|
|
40
|
+
### Installation
|
|
41
|
+
|
|
42
|
+
The most easy way to install PyEarthMesh is via `conda`.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Install from conda (recommended)
|
|
46
|
+
conda install pyearthmesh -c conda-forge
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Content
|
|
50
|
+
|
|
51
|
+
PyEarthMesh provides general-purpose functions organized into several categories:
|
|
52
|
+
|
|
53
|
+
#### 1. Structured Meshes
|
|
54
|
+
|
|
55
|
+
- **Square**: Projected coordinate handling, grid generation, coordinate reprojection
|
|
56
|
+
- **LatLon**: Longitude/latitude grid generation, coordinate reprojection
|
|
57
|
+
- **Hexagon**: Projected hexagon grid generation, coordinate reprojection
|
|
58
|
+
- **Triangular**: Projected triangular grid generation, coordinate reprojection
|
|
59
|
+
- **DGGRID**: DGGS grid generation, coordinate reprojection
|
|
60
|
+
- **Healpix**: Healpix grid generation, coordinate reprojection
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
#### 2. Unstructured Meshes
|
|
64
|
+
|
|
65
|
+
- **TIN**: Traiangular Irregular Network generation, manipulation, and analysis
|
|
66
|
+
- **MPAS**: Model for Prediction Across Scales mesh generation, manipulation, and analysis
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Related Packages
|
|
71
|
+
|
|
72
|
+
PyEarthMesh is part of the PyEarthSuite ecosystem, which includes several specialized packages:
|
|
73
|
+
|
|
74
|
+
- **[pyearthviz](../pyearthviz)** - 2D plotting and visualization
|
|
75
|
+
- **[pyearthviz3d](../pyearthviz3d)** - 3D globe visualization with GeoVista
|
|
76
|
+
- **[pyearthriver](../pyearthriver)** - River network topology and graph algorithms
|
|
77
|
+
- **[pyearthmesh](../pyearthmesh)** - Advanced mesh generation tools
|
|
78
|
+
- **[pyearthhelp](../pyearthhelp)** - Data retrieval and HPC job management
|
|
79
|
+
|
|
80
|
+
### Acknowledgment
|
|
81
|
+
|
|
82
|
+
This research was supported as part of the Next Generation Ecosystem Experiments-Tropics, funded by the U.S. Department of Energy, Office of Science, Office of Biological and Environmental Research at Pacific Northwest National Laboratory. The study was also partly supported by U.S. Department of Energy Office of Science Biological and Environmental Research through the Earth and Environmental System Modeling program as part of the Energy Exascale Earth System Model (E3SM) project.
|
|
83
|
+
|
|
84
|
+
### License
|
|
85
|
+
|
|
86
|
+
Copyright © 2022, Battelle Memorial Institute
|
|
87
|
+
|
|
88
|
+
1. Battelle Memorial Institute (hereinafter Battelle) hereby grants permission to any person or entity lawfully obtaining a copy of this software and associated documentation files (hereinafter "the Software") to redistribute and use the Software in source and binary forms, with or without modification. Such person or entity may use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software and may permit others to do so, subject to the following conditions:
|
|
89
|
+
|
|
90
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
|
|
91
|
+
|
|
92
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
93
|
+
|
|
94
|
+
* Other than as used herein, neither the name Battelle Memorial Institute or Battelle may be used in any form whatsoever without the express written consent of Battelle.
|
|
95
|
+
|
|
96
|
+
2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BATTELLE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
97
|
+
|
|
98
|
+
### References
|
|
99
|
+
|
|
100
|
+
Several publications describe the algorithms used in `PyEarth` in detail. If you make use of `PyEarth` in your work, please consider including a reference to the following:
|
|
101
|
+
|
|
102
|
+
* Chang Liao. (2022). PyEarth: A lightweight Python package for Earth science (Software). Zenodo. https://doi.org/10.5281/zenodo.6109987
|
|
103
|
+
|
|
104
|
+
PyEarth is also supporting several other Python packages/projects, including:
|
|
105
|
+
|
|
106
|
+
* Liao et al., (2023). pyflowline: a mesh-independent river network generator for hydrologic models. Journal of Open Source Software, 8(91), 5446, https://doi.org/10.21105/joss.05446
|
|
107
|
+
|
|
108
|
+
* Liao. C. (2022). HexWatershed: a mesh independent flow direction model for hydrologic models (0.1.1). Zenodo. https://doi.org/10.5281/zenodo.6425881
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PyEarthMesh: A lightweight mesh generation and manipulation package for Earth science applications.
|
|
3
|
+
|
|
4
|
+
This package provides tools for creating and manipulating various types of meshes:
|
|
5
|
+
- Structured meshes (square, latlon, hexagon, triangular, DGGRID, Healpix)
|
|
6
|
+
- Unstructured meshes (TIN, MPAS)
|
|
7
|
+
|
|
8
|
+
Part of the PyEarthSuite ecosystem.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "0.1.0"
|
|
12
|
+
__author__ = "Chang Liao"
|
|
13
|
+
__email__ = "changliao.climate@gmail.com"
|
|
14
|
+
|
|
15
|
+
# Import main classes
|
|
16
|
+
from pyearthmesh.classes.vertex import Vertex
|
|
17
|
+
from pyearthmesh.classes.edge import Edge
|
|
18
|
+
from pyearthmesh.classes.meshcell import MeshCell
|
|
19
|
+
from pyearthmesh.classes.hexagon import Hexagon
|
|
20
|
+
from pyearthmesh.classes.square import Square
|
|
21
|
+
from pyearthmesh.classes.latlon import LatLon
|
|
22
|
+
from pyearthmesh.classes.link import Link
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"Vertex",
|
|
26
|
+
"Edge",
|
|
27
|
+
"MeshCell",
|
|
28
|
+
"Hexagon",
|
|
29
|
+
"Square",
|
|
30
|
+
"LatLon",
|
|
31
|
+
"Link",
|
|
32
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""PyEarthMesh classes module."""
|
|
2
|
+
|
|
3
|
+
from pyearthmesh.classes.vertex import Vertex
|
|
4
|
+
from pyearthmesh.classes.edge import Edge
|
|
5
|
+
from pyearthmesh.classes.meshcell import MeshCell
|
|
6
|
+
from pyearthmesh.classes.hexagon import Hexagon
|
|
7
|
+
from pyearthmesh.classes.square import Square
|
|
8
|
+
from pyearthmesh.classes.latlon import LatLon
|
|
9
|
+
from pyearthmesh.classes.link import Link
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"Vertex",
|
|
13
|
+
"Edge",
|
|
14
|
+
"MeshCell",
|
|
15
|
+
"Hexagon",
|
|
16
|
+
"Square",
|
|
17
|
+
"LatLon",
|
|
18
|
+
"Link",
|
|
19
|
+
]
|