vdatum-mcp 0.1.1__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.
- vdatum_mcp-0.1.1/.gitignore +45 -0
- vdatum_mcp-0.1.1/LICENSE +21 -0
- vdatum_mcp-0.1.1/PKG-INFO +49 -0
- vdatum_mcp-0.1.1/README.md +33 -0
- vdatum_mcp-0.1.1/pyproject.toml +50 -0
- vdatum_mcp-0.1.1/server.json +22 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/__init__.py +1 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/__main__.py +5 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/__init__.py +0 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/coastalmodeling_vdatum/LICENSE.txt +121 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/coastalmodeling_vdatum/VENDORED.md +38 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/coastalmodeling_vdatum/__init__.py +0 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/coastalmodeling_vdatum/_geoid_tr.py +71 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/coastalmodeling_vdatum/_path.py +33 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/coastalmodeling_vdatum/utils.py +64 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/_vendor/coastalmodeling_vdatum/vdatum.py +504 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/server.py +15 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/tools/__init__.py +1 -0
- vdatum_mcp-0.1.1/src/vdatum_mcp/tools/convert.py +176 -0
- vdatum_mcp-0.1.1/tests/__init__.py +0 -0
- vdatum_mcp-0.1.1/tests/conftest.py +10 -0
- vdatum_mcp-0.1.1/tests/test_convert.py +161 -0
- vdatum_mcp-0.1.1/tests/test_mcp_protocol.py +29 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
*.egg
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
*.whl
|
|
10
|
+
|
|
11
|
+
# Virtual environments
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
|
|
16
|
+
# Testing
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.coverage
|
|
19
|
+
htmlcov/
|
|
20
|
+
.tox/
|
|
21
|
+
|
|
22
|
+
# IDE
|
|
23
|
+
.idea/
|
|
24
|
+
.vscode/
|
|
25
|
+
*.swp
|
|
26
|
+
*.swo
|
|
27
|
+
*~
|
|
28
|
+
|
|
29
|
+
# OS
|
|
30
|
+
.DS_Store
|
|
31
|
+
Thumbs.db
|
|
32
|
+
|
|
33
|
+
# Linting
|
|
34
|
+
.ruff_cache/
|
|
35
|
+
.mypy_cache/
|
|
36
|
+
|
|
37
|
+
# Lock files (each server manages its own)
|
|
38
|
+
uv.lock
|
|
39
|
+
|
|
40
|
+
# Environment
|
|
41
|
+
.env
|
|
42
|
+
.env.local
|
|
43
|
+
|
|
44
|
+
# Registry tokens
|
|
45
|
+
.mcpregistry_*
|
vdatum_mcp-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mansur Jisan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vdatum-mcp
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: MCP server for vertical datum conversions using coastalmodeling-vdatum
|
|
5
|
+
Project-URL: Homepage, https://github.com/mansurjisan/ocean-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/mansurjisan/ocean-mcp
|
|
7
|
+
Author-email: Mansur Jisan <mansur.jisan@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: coastal,mcp,mllw,model-context-protocol,navd88,noaa,vdatum,vertical-datum
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: mcp[cli]<2,>=1.0.0
|
|
13
|
+
Requires-Dist: numpy<3,>=1.26
|
|
14
|
+
Requires-Dist: pyproj<4,>=3.7
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# vdatum-mcp
|
|
18
|
+
|
|
19
|
+
<!-- mcp-name: io.github.mansurjisan/vdatum-mcp -->
|
|
20
|
+
|
|
21
|
+
MCP server for vertical datum conversions using [coastalmodeling-vdatum](https://github.com/oceanmodeling/coastalmodeling-vdatum).
|
|
22
|
+
|
|
23
|
+
Converts elevations between NAVD88, MLLW, MLW, MHW, MHHW, LMSL, xGEOID20b, IGLD85, and LWD.
|
|
24
|
+
|
|
25
|
+
`coastalmodeling-vdatum` isn't published to PyPI, so the small amount of its
|
|
26
|
+
code this server actually calls is vendored directly (CC0-licensed; see
|
|
27
|
+
`src/vdatum_mcp/_vendor/coastalmodeling_vdatum/VENDORED.md` for the exact
|
|
28
|
+
commit and attribution) rather than installed as an external dependency.
|
|
29
|
+
|
|
30
|
+
## Tools
|
|
31
|
+
|
|
32
|
+
| Tool | Description |
|
|
33
|
+
|------|-------------|
|
|
34
|
+
| `vdatum_convert` | Convert elevation values between vertical datums |
|
|
35
|
+
| `vdatum_list_datums` | List all supported vertical datums |
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install -e .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Example Queries via CORAL
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Convert 1.5 meters from NAVD88 to MLLW at The Battery (40.7, -74.0)
|
|
47
|
+
What vertical datums are supported?
|
|
48
|
+
Convert these water levels from MLLW to NAVD88: lat 30,26,27.5 lon -80,-75,-77.5 z 0.5,1.0,0.3
|
|
49
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# vdatum-mcp
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.mansurjisan/vdatum-mcp -->
|
|
4
|
+
|
|
5
|
+
MCP server for vertical datum conversions using [coastalmodeling-vdatum](https://github.com/oceanmodeling/coastalmodeling-vdatum).
|
|
6
|
+
|
|
7
|
+
Converts elevations between NAVD88, MLLW, MLW, MHW, MHHW, LMSL, xGEOID20b, IGLD85, and LWD.
|
|
8
|
+
|
|
9
|
+
`coastalmodeling-vdatum` isn't published to PyPI, so the small amount of its
|
|
10
|
+
code this server actually calls is vendored directly (CC0-licensed; see
|
|
11
|
+
`src/vdatum_mcp/_vendor/coastalmodeling_vdatum/VENDORED.md` for the exact
|
|
12
|
+
commit and attribution) rather than installed as an external dependency.
|
|
13
|
+
|
|
14
|
+
## Tools
|
|
15
|
+
|
|
16
|
+
| Tool | Description |
|
|
17
|
+
|------|-------------|
|
|
18
|
+
| `vdatum_convert` | Convert elevation values between vertical datums |
|
|
19
|
+
| `vdatum_list_datums` | List all supported vertical datums |
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install -e .
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example Queries via CORAL
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Convert 1.5 meters from NAVD88 to MLLW at The Battery (40.7, -74.0)
|
|
31
|
+
What vertical datums are supported?
|
|
32
|
+
Convert these water levels from MLLW to NAVD88: lat 30,26,27.5 lon -80,-75,-77.5 z 0.5,1.0,0.3
|
|
33
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vdatum-mcp"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "MCP server for vertical datum conversions using coastalmodeling-vdatum"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "Mansur Jisan", email = "mansur.jisan@gmail.com"},
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"noaa",
|
|
20
|
+
"vdatum",
|
|
21
|
+
"vertical-datum",
|
|
22
|
+
"navd88",
|
|
23
|
+
"mllw",
|
|
24
|
+
"coastal",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"mcp[cli]>=1.0.0,<2",
|
|
28
|
+
"numpy>=1.26,<3",
|
|
29
|
+
"pyproj>=3.7,<4",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://github.com/mansurjisan/ocean-mcp"
|
|
34
|
+
Repository = "https://github.com/mansurjisan/ocean-mcp"
|
|
35
|
+
|
|
36
|
+
[project.scripts]
|
|
37
|
+
vdatum-mcp = "vdatum_mcp.server:main"
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.wheel]
|
|
40
|
+
packages = ["src/vdatum_mcp"]
|
|
41
|
+
|
|
42
|
+
[tool.pytest.ini_options]
|
|
43
|
+
testpaths = ["tests"]
|
|
44
|
+
asyncio_mode = "auto"
|
|
45
|
+
|
|
46
|
+
[dependency-groups]
|
|
47
|
+
dev = [
|
|
48
|
+
"pytest>=8.0.0",
|
|
49
|
+
"pytest-asyncio>=0.24.0",
|
|
50
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.mansurjisan/vdatum-mcp",
|
|
4
|
+
"title": "VDatum MCP Server",
|
|
5
|
+
"description": "MCP server for vertical datum conversions using coastalmodeling-vdatum",
|
|
6
|
+
"version": "0.1.1",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/mansurjisan/ocean-mcp",
|
|
9
|
+
"source": "github"
|
|
10
|
+
},
|
|
11
|
+
"packages": [
|
|
12
|
+
{
|
|
13
|
+
"registryType": "pypi",
|
|
14
|
+
"identifier": "vdatum-mcp",
|
|
15
|
+
"version": "0.1.1",
|
|
16
|
+
"runtimeHint": "uvx",
|
|
17
|
+
"transport": {
|
|
18
|
+
"type": "stdio"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""VDatum MCP server for vertical datum conversions."""
|
|
File without changes
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Creative Commons Legal Code
|
|
2
|
+
|
|
3
|
+
CC0 1.0 Universal
|
|
4
|
+
|
|
5
|
+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
|
6
|
+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
|
7
|
+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
|
8
|
+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
|
9
|
+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
|
10
|
+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
|
11
|
+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
|
12
|
+
HEREUNDER.
|
|
13
|
+
|
|
14
|
+
Statement of Purpose
|
|
15
|
+
|
|
16
|
+
The laws of most jurisdictions throughout the world automatically confer
|
|
17
|
+
exclusive Copyright and Related Rights (defined below) upon the creator
|
|
18
|
+
and subsequent owner(s) (each and all, an "owner") of an original work of
|
|
19
|
+
authorship and/or a database (each, a "Work").
|
|
20
|
+
|
|
21
|
+
Certain owners wish to permanently relinquish those rights to a Work for
|
|
22
|
+
the purpose of contributing to a commons of creative, cultural and
|
|
23
|
+
scientific works ("Commons") that the public can reliably and without fear
|
|
24
|
+
of later claims of infringement build upon, modify, incorporate in other
|
|
25
|
+
works, reuse and redistribute as freely as possible in any form whatsoever
|
|
26
|
+
and for any purposes, including without limitation commercial purposes.
|
|
27
|
+
These owners may contribute to the Commons to promote the ideal of a free
|
|
28
|
+
culture and the further production of creative, cultural and scientific
|
|
29
|
+
works, or to gain reputation or greater distribution for their Work in
|
|
30
|
+
part through the use and efforts of others.
|
|
31
|
+
|
|
32
|
+
For these and/or other purposes and motivations, and without any
|
|
33
|
+
expectation of additional consideration or compensation, the person
|
|
34
|
+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
|
35
|
+
is an owner of Copyright and Related Rights in the Work, voluntarily
|
|
36
|
+
elects to apply CC0 to the Work and publicly distribute the Work under its
|
|
37
|
+
terms, with knowledge of his or her Copyright and Related Rights in the
|
|
38
|
+
Work and the meaning and intended legal effect of CC0 on those rights.
|
|
39
|
+
|
|
40
|
+
1. Copyright and Related Rights. A Work made available under CC0 may be
|
|
41
|
+
protected by copyright and related or neighboring rights ("Copyright and
|
|
42
|
+
Related Rights"). Copyright and Related Rights include, but are not
|
|
43
|
+
limited to, the following:
|
|
44
|
+
|
|
45
|
+
i. the right to reproduce, adapt, distribute, perform, display,
|
|
46
|
+
communicate, and translate a Work;
|
|
47
|
+
ii. moral rights retained by the original author(s) and/or performer(s);
|
|
48
|
+
iii. publicity and privacy rights pertaining to a person's image or
|
|
49
|
+
likeness depicted in a Work;
|
|
50
|
+
iv. rights protecting against unfair competition in regards to a Work,
|
|
51
|
+
subject to the limitations in paragraph 4(a), below;
|
|
52
|
+
v. rights protecting the extraction, dissemination, use and reuse of data
|
|
53
|
+
in a Work;
|
|
54
|
+
vi. database rights (such as those arising under Directive 96/9/EC of the
|
|
55
|
+
European Parliament and of the Council of 11 March 1996 on the legal
|
|
56
|
+
protection of databases, and under any national implementation
|
|
57
|
+
thereof, including any amended or successor version of such
|
|
58
|
+
directive); and
|
|
59
|
+
vii. other similar, equivalent or corresponding rights throughout the
|
|
60
|
+
world based on applicable law or treaty, and any national
|
|
61
|
+
implementations thereof.
|
|
62
|
+
|
|
63
|
+
2. Waiver. To the greatest extent permitted by, but not in contravention
|
|
64
|
+
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
|
65
|
+
irrevocably and unconditionally waives, abandons, and surrenders all of
|
|
66
|
+
Affirmer's Copyright and Related Rights and associated claims and causes
|
|
67
|
+
of action, whether now known or unknown (including existing as well as
|
|
68
|
+
future claims and causes of action), in the Work (i) in all territories
|
|
69
|
+
worldwide, (ii) for the maximum duration provided by applicable law or
|
|
70
|
+
treaty (including future time extensions), (iii) in any current or future
|
|
71
|
+
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
|
72
|
+
including without limitation commercial, advertising or promotional
|
|
73
|
+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
|
74
|
+
member of the public at large and to the detriment of Affirmer's heirs and
|
|
75
|
+
successors, fully intending that such Waiver shall not be subject to
|
|
76
|
+
revocation, rescission, cancellation, termination, or any other legal or
|
|
77
|
+
equitable action to disrupt the quiet enjoyment of the Work by the public
|
|
78
|
+
as contemplated by Affirmer's express Statement of Purpose.
|
|
79
|
+
|
|
80
|
+
3. Public License Fallback. Should any part of the Waiver for any reason
|
|
81
|
+
be judged legally invalid or ineffective under applicable law, then the
|
|
82
|
+
Waiver shall be preserved to the maximum extent permitted taking into
|
|
83
|
+
account Affirmer's express Statement of Purpose. In addition, to the
|
|
84
|
+
extent the Waiver is so judged Affirmer hereby grants to each affected
|
|
85
|
+
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
|
86
|
+
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
|
87
|
+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
|
88
|
+
maximum duration provided by applicable law or treaty (including future
|
|
89
|
+
time extensions), (iii) in any current or future medium and for any number
|
|
90
|
+
of copies, and (iv) for any purpose whatsoever, including without
|
|
91
|
+
limitation commercial, advertising or promotional purposes (the
|
|
92
|
+
"License"). The License shall be deemed effective as of the date CC0 was
|
|
93
|
+
applied by Affirmer to the Work. Should any part of the License for any
|
|
94
|
+
reason be judged legally invalid or ineffective under applicable law, such
|
|
95
|
+
partial invalidity or ineffectiveness shall not invalidate the remainder
|
|
96
|
+
of the License, and in such case Affirmer hereby affirms that he or she
|
|
97
|
+
will not (i) exercise any of his or her remaining Copyright and Related
|
|
98
|
+
Rights in the Work or (ii) assert any associated claims and causes of
|
|
99
|
+
action with respect to the Work, in either case contrary to Affirmer's
|
|
100
|
+
express Statement of Purpose.
|
|
101
|
+
|
|
102
|
+
4. Limitations and Disclaimers.
|
|
103
|
+
|
|
104
|
+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
|
105
|
+
surrendered, licensed or otherwise affected by this document.
|
|
106
|
+
b. Affirmer offers the Work as-is and makes no representations or
|
|
107
|
+
warranties of any kind concerning the Work, express, implied,
|
|
108
|
+
statutory or otherwise, including without limitation warranties of
|
|
109
|
+
title, merchantability, fitness for a particular purpose, non
|
|
110
|
+
infringement, or the absence of latent or other defects, accuracy, or
|
|
111
|
+
the present or absence of errors, whether or not discoverable, all to
|
|
112
|
+
the greatest extent permissible under applicable law.
|
|
113
|
+
c. Affirmer disclaims responsibility for clearing rights of other persons
|
|
114
|
+
that may apply to the Work or any use thereof, including without
|
|
115
|
+
limitation any person's Copyright and Related Rights in the Work.
|
|
116
|
+
Further, Affirmer disclaims responsibility for obtaining any necessary
|
|
117
|
+
consents, permissions or other rights required for any use of the
|
|
118
|
+
Work.
|
|
119
|
+
d. Affirmer understands and acknowledges that Creative Commons is not a
|
|
120
|
+
party to this document and has no duty or obligation with respect to
|
|
121
|
+
this CC0 or use of the Work.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Vendored: coastalmodeling-vdatum
|
|
2
|
+
|
|
3
|
+
This directory is a vendored copy of `coastalmodeling_vdatum`, NOAA's vertical
|
|
4
|
+
datum conversion library.
|
|
5
|
+
|
|
6
|
+
- **Source**: https://github.com/oceanmodeling/coastalmodeling-vdatum
|
|
7
|
+
- **Author**: Felicio Cassalho (felicio.cassalho@noaa.gov)
|
|
8
|
+
- **Vendored from commit**: `0d63b2bbc0b0634e20a0ec55023a53354fab1b47`
|
|
9
|
+
- **License**: CC0 1.0 Universal (public domain dedication) — full text in
|
|
10
|
+
`LICENSE.txt` alongside this file.
|
|
11
|
+
|
|
12
|
+
## Why vendored, not a dependency
|
|
13
|
+
|
|
14
|
+
`coastalmodeling-vdatum` is not published to PyPI, so it has historically
|
|
15
|
+
been declared as a `git+https://...` pinned-commit dependency. PyPI's upload
|
|
16
|
+
service rejects any package whose metadata declares a direct VCS/URL
|
|
17
|
+
dependency (`400 Can't have direct dependency: ...`), which made
|
|
18
|
+
`vdatum-mcp` unpublishable. Vendoring the small amount of code actually used
|
|
19
|
+
(five files, no PyPI-registry dependency of its own beyond `numpy` and
|
|
20
|
+
`pyproj`, both already required here) removes that blocker.
|
|
21
|
+
|
|
22
|
+
This is a private implementation detail of `vdatum-mcp`, not a redistribution
|
|
23
|
+
of `coastalmodeling-vdatum` as its own package — nothing here is importable
|
|
24
|
+
as `coastalmodeling_vdatum` from outside `vdatum_mcp`, and no separate PyPI
|
|
25
|
+
project is created for it.
|
|
26
|
+
|
|
27
|
+
## Keeping this in sync
|
|
28
|
+
|
|
29
|
+
Functional changes from upstream are limited to the internal import in
|
|
30
|
+
`vdatum.py` (`from coastalmodeling_vdatum import _geoid_tr, _path` -> `from .
|
|
31
|
+
import _geoid_tr, _path`, to work as a relocated subpackage), a bare
|
|
32
|
+
`except:` -> `except Exception:` and an ambiguous `l` -> `_` loop variable in
|
|
33
|
+
`utils.py`/`vdatum.py` (both required by this repo's lint gate, both
|
|
34
|
+
no-ops behaviorally), and unused-import removal in `utils.py`. Everything
|
|
35
|
+
else — including full reformatting via this repo's pinned `ruff format` —
|
|
36
|
+
is otherwise faithful to the pinned commit above. If upstream fixes a bug or
|
|
37
|
+
adds a datum, diff against that commit (or a newer one), ignoring
|
|
38
|
+
whitespace/quote-style noise, and reapply.
|
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
ITRF2020_to_ITRF2014 = """\
|
|
4
|
+
+step +proj=cart +ellps=GRS80
|
|
5
|
+
+step +inv +proj=helmert +x=0.0014 +y=0.0009 +z=-0.0014 +rx=0 +ry=0 +rz=0 \
|
|
6
|
+
+s=0.00042 +dx=0 +dy=0.0001 +dz=-0.0002 +drx=0 +dry=0 +drz=0 +ds=0 \
|
|
7
|
+
+t_epoch=2015 +convention=position_vector \
|
|
8
|
+
+step +inv +proj=cart +ellps=GRS80"""
|
|
9
|
+
|
|
10
|
+
ITRF2014_to_ITRF2020 = """\
|
|
11
|
+
+step +proj=cart +ellps=GRS80
|
|
12
|
+
+step +proj=helmert +x=0.0014 +y=0.0009 +z=-0.0014 +rx=0 +ry=0 +rz=0 \
|
|
13
|
+
+s=0.00042 +dx=0 +dy=0.0001 +dz=-0.0002 +drx=0 +dry=0 +drz=0 +ds=0 \
|
|
14
|
+
+t_epoch=2015 +convention=position_vector \
|
|
15
|
+
+step +inv +proj=cart +ellps=GRS80"""
|
|
16
|
+
|
|
17
|
+
ITRF2020_2020_to_NAD832011_2010 = """\
|
|
18
|
+
+step +proj=cart +ellps=GRS80 \
|
|
19
|
+
+step +proj=set +v_4=2010 \
|
|
20
|
+
+step +proj=helmert \
|
|
21
|
+
+dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.000045 +dry=-0.000666 +drz=-0.000098 \
|
|
22
|
+
+t_epoch=2020 \
|
|
23
|
+
+convention=position_vector \
|
|
24
|
+
+step +proj=set +v_4=2010 \
|
|
25
|
+
+step +inv +proj=helmert +x=0.0014 +y=0.0009 +z=-0.0014 +rx=0 +ry=0 +rz=0 \
|
|
26
|
+
+s=0.00042 +dx=0 +dy=0.0001 +dz=-0.0002 +drx=0 +dry=0 +drz=0 +ds=0 \
|
|
27
|
+
+t_epoch=2015 \
|
|
28
|
+
+convention=position_vector \
|
|
29
|
+
+step +proj=set +v_4=2010 \
|
|
30
|
+
+step +proj=helmert +x=1.0053 +y=-1.9092 +z=-0.5416 +rx=0.0267814 \
|
|
31
|
+
+ry=-0.0004203 +rz=0.0109321 +s=0.00037 +dx=0.0008 +dy=-0.0006 \
|
|
32
|
+
+dz=-0.0014 +drx=6.67e-05 +dry=-0.0007574 +drz=-5.13e-05 +ds=-7e-05 \
|
|
33
|
+
+t_epoch=2010 \
|
|
34
|
+
+convention=coordinate_frame \
|
|
35
|
+
+step +inv +proj=cart +ellps=GRS80"""
|
|
36
|
+
|
|
37
|
+
NAD832011_2010_to_ITRF2020_2020 = """\
|
|
38
|
+
+step +proj=cart +ellps=GRS80 \
|
|
39
|
+
+step +proj=set +v_4=2010 \
|
|
40
|
+
+step +inv +proj=helmert \
|
|
41
|
+
+dx=0.00037 +dy=0.00035 +dz=0.00074 +drx=0.000045 +dry=-0.000666 +drz=-0.000098 \
|
|
42
|
+
+t_epoch=2020 \
|
|
43
|
+
+convention=position_vector \
|
|
44
|
+
+step +proj=set +v_4=2010 \
|
|
45
|
+
+step +proj=helmert +x=0.0014 +y=0.0009 +z=-0.0014 +rx=0 +ry=0 +rz=0 \
|
|
46
|
+
+s=0.00042 +dx=0 +dy=0.0001 +dz=-0.0002 +drx=0 +dry=0 +drz=0 +ds=0 \
|
|
47
|
+
+t_epoch=2015 \
|
|
48
|
+
+convention=position_vector \
|
|
49
|
+
+step +proj=set +v_4=2010 \
|
|
50
|
+
+step +inv +proj=helmert +x=1.0053 +y=-1.9092 +z=-0.5416 +rx=0.0267814 \
|
|
51
|
+
+ry=-0.0004203 +rz=0.0109321 +s=0.00037 +dx=0.0008 +dy=-0.0006 \
|
|
52
|
+
+dz=-0.0014 +drx=6.67e-05 +dry=-0.0007574 +drz=-5.13e-05 +ds=-7e-05 \
|
|
53
|
+
+t_epoch=2010 \
|
|
54
|
+
+convention=coordinate_frame \
|
|
55
|
+
+step +inv +proj=cart +ellps=GRS80"""
|
|
56
|
+
|
|
57
|
+
NAD832011_to_ITRF2014 = """\
|
|
58
|
+
+step +proj=cart +ellps=GRS80
|
|
59
|
+
+step +inv +proj=helmert +x=1.0053 +y=-1.9092 +z=-0.5416 +rx=0.0267814
|
|
60
|
+
+ry=-0.0004203 +rz=0.0109321 +s=0.00037 +dx=0.0008 +dy=-0.0006
|
|
61
|
+
+dz=-0.0014 +drx=6.67e-05 +dry=-0.0007574 +drz=-5.13e-05 +ds=-7e-05
|
|
62
|
+
+t_epoch=2010 +convention=coordinate_frame
|
|
63
|
+
+step +inv +proj=cart +ellps=GRS80"""
|
|
64
|
+
|
|
65
|
+
ITRF2014_to_NAD832011 = """\
|
|
66
|
+
+step +proj=cart +ellps=GRS80
|
|
67
|
+
+step +proj=helmert +x=1.0053 +y=-1.9092 +z=-0.5416 +rx=0.0267814
|
|
68
|
+
+ry=-0.0004203 +rz=0.0109321 +s=0.00037 +dx=0.0008 +dy=-0.0006
|
|
69
|
+
+dz=-0.0014 +drx=6.67e-05 +dry=-0.0007574 +drz=-5.13e-05 +ds=-7e-05
|
|
70
|
+
+t_epoch=2010 +convention=coordinate_frame
|
|
71
|
+
+step +inv +proj=cart +ellps=GRS80"""
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
NAVD88_G2018 = "us_noaa_g2018u0.tif"
|
|
4
|
+
XGEOID20B = "https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/xGEOID20B.tif"
|
|
5
|
+
MLLW_ITRF2020_2020 = (
|
|
6
|
+
"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/"
|
|
7
|
+
"us_noaa_nos_MLLW-ITRF2020_2020.0_nwldatum_4.7.0_20240621_3.tif"
|
|
8
|
+
)
|
|
9
|
+
MLW_ITRF2020_2020 = (
|
|
10
|
+
"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/"
|
|
11
|
+
"us_noaa_nos_MLW-ITRF2020_2020.0_nwldatum_4.7.0_20240621_3.tif"
|
|
12
|
+
)
|
|
13
|
+
MHHW_ITRF2020_2020 = (
|
|
14
|
+
"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/"
|
|
15
|
+
"us_noaa_nos_MHHW-ITRF2020_2020.0_nwldatum_4.7.0_20240621_3.tif"
|
|
16
|
+
)
|
|
17
|
+
MHW_ITRF2020_2020 = (
|
|
18
|
+
"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/"
|
|
19
|
+
"us_noaa_nos_MHW-ITRF2020_2020.0_nwldatum_4.7.0_20240621_3.tif"
|
|
20
|
+
)
|
|
21
|
+
LMSL_ITRF2020_2020 = (
|
|
22
|
+
"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/"
|
|
23
|
+
"us_noaa_nos_LMSL-ITRF2020_2020.0_nwldatum_4.7.0_20240621_3.tif"
|
|
24
|
+
)
|
|
25
|
+
IGLD85_ITRF2020_2020 = (
|
|
26
|
+
"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/"
|
|
27
|
+
"us_noaa_nos_IGLD85-ITRF2020_2020.0_nwldatum_4.7.0_20240621_3.tif"
|
|
28
|
+
)
|
|
29
|
+
LWD_ITRF2020_2020 = (
|
|
30
|
+
"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/"
|
|
31
|
+
"us_noaa_nos_LWD-ITRF2020_2020.0_nwldatum_4.7.0_20240621_3.tif"
|
|
32
|
+
)
|
|
33
|
+
# SGEOID2022=f"https://noaa-nos-stofs2d-pds.s3.amazonaws.com/_archive/coastalmodeling-vdatum/us_noaa_sgeoid2022v1a.tif"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def read_station_in(
|
|
5
|
+
file_path: str,
|
|
6
|
+
skip_lines: int = 2,
|
|
7
|
+
) -> list:
|
|
8
|
+
"""
|
|
9
|
+
Reads the station.in file in the following format:
|
|
10
|
+
|
|
11
|
+
1 1 1 1 1 1 1 1 1 !on (1)|off(0) flags for elev,air pressure,windx,windy,T,S,u,v,w,
|
|
12
|
+
rest of tracers (expanded into subclasses of each module)
|
|
13
|
+
3 !# of stations
|
|
14
|
+
1 -81.871 26.648 0 !8725520
|
|
15
|
+
2 -81.8075030 26.1317010 0 !8725110
|
|
16
|
+
3 -81.808333 24.550833 0 !8724580
|
|
17
|
+
|
|
18
|
+
and returns a list for each variable: index, lon, lat, z, and station name
|
|
19
|
+
|
|
20
|
+
Parameters
|
|
21
|
+
----------
|
|
22
|
+
file_path : str
|
|
23
|
+
Path to the station.in file
|
|
24
|
+
skip_lines : int
|
|
25
|
+
Number of lines that will be skiped when reading the file.
|
|
26
|
+
default = 2
|
|
27
|
+
|
|
28
|
+
Returns
|
|
29
|
+
-------
|
|
30
|
+
Lists
|
|
31
|
+
Returns 5 lists: index,longitude,latitude,elevation,station
|
|
32
|
+
|
|
33
|
+
Notes
|
|
34
|
+
-----
|
|
35
|
+
-
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
index, longitude, latitude, elevation, station = [], [], [], [], []
|
|
39
|
+
with open(file_path, "r") as file:
|
|
40
|
+
lines = file.readlines()
|
|
41
|
+
for n, line in enumerate(lines[skip_lines:]):
|
|
42
|
+
if line.strip():
|
|
43
|
+
try:
|
|
44
|
+
parsed = line.split("!")
|
|
45
|
+
parsed, comment = parsed[0], parsed[-1]
|
|
46
|
+
parsed = parsed.split(" ")
|
|
47
|
+
idx, lon, lat, z = (
|
|
48
|
+
int(parsed[0]),
|
|
49
|
+
float(parsed[1]),
|
|
50
|
+
float(parsed[2]),
|
|
51
|
+
float(parsed[3]),
|
|
52
|
+
)
|
|
53
|
+
index.append(idx)
|
|
54
|
+
longitude.append(lon)
|
|
55
|
+
latitude.append(lat)
|
|
56
|
+
elevation.append(z)
|
|
57
|
+
station.append(comment)
|
|
58
|
+
except Exception:
|
|
59
|
+
raise ValueError(
|
|
60
|
+
f"Please review your station.in. "
|
|
61
|
+
f"Failed to parse line {skip_lines + n + 1}"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return index, longitude, latitude, elevation, station
|