Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook edits #3

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 27 additions & 104 deletions notebooks/foundations/1_terminology.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"metadata": {},
"source": [
"## Overview\n",
"Great Circles are powerful tools used in the navigation like ships and planes as well as in geoscience for working with and understanding remote sensing via satellites. Great Circle mathematics make use of spherical geometry, where, rather than lines, shapes on a sphere are formed by the intersection of arcs along the curved surface.\n",
"Great circles are powerful tools used in the navigation of ships and planes as well as in geoscience for working with remote sensing via satellites. Great circle mathematics make use of spherical geometry, where, rather than lines, shapes on a sphere are formed by the intersection of arcs along the curved surface.\n",
"\n",
"While spherical geometry played an important role historically in the fields of astronomy and navigation, its teaching has largely fallen out of favor since the 1950's making finding comphrenshive resources difficult.\n",
"\n",
"This notebook will cover some of the important and unique terminology used when working with Great Circles and spherical geometry.\n",
"This notebook will cover the important and unique terminology used when working with Great Circles and spherical geometry.\n",
"\n",
"1. Spherical Geometry\n",
"1. Great Circles\n",
Expand Down Expand Up @@ -69,7 +69,7 @@
"\n",
"### Spherical Trigonometry\n",
"\n",
"Spherical geometry (and one of it important branches: spherical trigonometry) provide for solutions for relationshsips between sides and angles that are commonly solved for with trigonometric functions for right-angled triangles. Spherical trigonometry is unique from traidtional right-angle triangles in many ways, but for example, a triangle on a sphere can easily have internal angles that add up to more than 180 degrees.\n",
"Spherical geometry (and one of it important branches: spherical trigonometry) provide solutions for relationshsips between the sides and angles on a sphere that are commonly used in right-angled triangles. Spheres are unique since unlike triangles, spheres have internal angles that add up to more than 180 degrees.\n",
"\n",
"> The sum of the angles of a spherical triangle is not equal to 180°. A sphere is a curved surface, but locally the laws of the flat (planar) Euclidean geometry are good approximations. In a small triangle on the face of the earth, the sum of the angles is only slightly more than 180 degrees\n",
"> \n",
Expand All @@ -80,18 +80,17 @@
"### Law of Cosines\n",
"> \"The cosine rule is the fundamental identity of spherical trigonometry: all other identities, including the sine rule, may be derived from the cosine rule\" [(Wikiepedia)](https://en.wikipedia.org/wiki/Spherical_trigonometry)\n",
"\n",
"Where the angles A, B, C are opposite of sides a, b, c, where:\n",
"The law of cosines states that for the angles A, B, C and opposite sides a, b, c:\n",
"\n",
"$$cos(a) = cos(b)cos(c) + sin(b)sin(c)cos(A)$$\n",
"$$cos(b) = cos(c)cos(a) + sin(c)sin(a)cos(B)$$\n",
"$$cos(c) = cos(a)cos(b) + sin(a)sin(b)cos(C)$$\n",
"### Law of Sines\n",
"\n",
"The spherical law of sines states that angles A, B, and C be the angles opposite of the sides a, b, c, where:\n",
"### Law of Sines\n",
"\n",
"$$\\frac{sin(A)}{sin(a)} = \\frac{sin(B)}{sin(b)} = \\frac{sin(C)}{sin(c)}$$\n",
"The spherical law of sines states that for the angles A, B, and C and the opposite of the sides a, b, c:\n",
"\n",
"[Proof of Spherical Law of Sines](https://en.wikipedia.org/wiki/Law_of_sines#The_spherical_law_of_sines)"
"$$\\frac{sin(A)}{sin(a)} = \\frac{sin(B)}{sin(b)} = \\frac{sin(C)}{sin(c)}$$"
]
},
{
Expand All @@ -102,16 +101,17 @@
"\n",
"### Great Circle Path vs. Great Circle Arc\n",
"\n",
"A great circle is the largest circle that can be formed on the surface of a sphere created by the intersection of a plane that also passes through the center of the sphere.\n",
"A great circle is the largest circle that can be formed on the surface of a sphere. A great circle is created by the intersection of a plane that also passes through the center of the sphere.\n",
"\n",
"All Great Circles:\n",
"All great circles:\n",
"- Intersect the center of the Earth\n",
"- Divide the Earth in half\n",
"- Represent the shortest distance between any two points on the surface of the Earth\n",
"\n",
"For example, the equator is an example of a great circle, which can be imaged as a plane cutting directly through the center of the planet and intersecting the center.\n",
"For example, the equator is an example of a great circle. The equator can be imagined as the path formed by a plane cutting through the center of the planet and intersecting the center.\n",
"\n",
"A great circle path is a closed path (-180 to 180 degrees longitude) that forms around the entire planet. A great circle path can be defined by a shorter great circle arc which can be formed by:\n",
"\n",
"A great circle path is a closed path (-180 to 180 degrees longitude) that a great circle formed around the entire planet. A great circle path can be defined by a shorter great circle arc which can be formed by:\n",
"- At least two points\n",
"- One point, a bearing, and a distance"
]
Expand All @@ -122,9 +122,9 @@
"source": [
"## Ellipsoids vs. Spheres\n",
"\n",
"The earth is not round, instead it is an irregular ellipsoid known as a an oblate spheroid where the poles are slightly flatter. Spherical trigonomeyry assumes a unit sphere, so working on Earth, without additional corrections, spherical measurements will contain up to 0.3% (22 km) when assuming the Earth is a perfect sphere ([see more](https://gis.stackexchange.com/questions/25494/how-accurate-is-approximating-earth-as-sphere)).\n",
"The earth is not round, instead it is an irregular ellipsoid known as a an oblate spheroid where the poles are slightly flatter. Spherical trigonometry uses a unit sphere, so working on Earth and without additional corrections, the measurements will contain up to 0.3% (22 km) when assuming the Earth is a perfect sphere ([see more](https://gis.stackexchange.com/questions/25494/how-accurate-is-approximating-earth-as-sphere)).\n",
"\n",
"To account for the error when assuming the Earth is a sphere, there are various geodetic systems and ellipsoids to include in calculations."
"To account for the errors when assuming the Earth is a sphere, there are various geodetic systems and ellipsoids to include in calculations."
]
},
{
Expand All @@ -138,67 +138,14 @@
"- [`pyproj`: Python interface to PROJ (catographic projections and coordinate transformations library)](https://pyproj4.github.io/pyproj/stable/)\n",
"- [`geopy`: Python client for several popular geocoding web services](https://geopy.readthedocs.io/en/stable/#)\n",
"\n",
"`pyproj` and `geopy` both take advantage of different types of (optional) ellipsoids."
"`pyproj` and `geopy` both take advantage of different types of (optional) ellipsoids:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"MERIT = {'a': 6378137.0, 'rf': 298.257, 'description': 'MERIT 1983'}\n",
"SGS85 = {'a': 6378136.0, 'rf': 298.257, 'description': 'Soviet Geodetic System 85'}\n",
"GRS80 = {'a': 6378137.0, 'rf': 298.257222101, 'description': 'GRS 1980(IUGG, 1980)'}\n",
"IAU76 = {'a': 6378140.0, 'rf': 298.257, 'description': 'IAU 1976'}\n",
"airy = {'a': 6377563.396, 'rf': 299.3249646, 'description': 'Airy 1830'}\n",
"APL4.9 = {'a': 6378137.0, 'rf': 298.25, 'description': 'Appl. Physics. 1965'}\n",
"NWL9D = {'a': 6378145.0, 'rf': 298.25, 'description': 'Naval Weapons Lab., 1965'}\n",
"mod_airy = {'a': 6377340.189, 'b': 6356034.446, 'description': 'Modified Airy'}\n",
"andrae = {'a': 6377104.43, 'rf': 300.0, 'description': 'Andrae 1876 (Den., Iclnd.)'}\n",
"danish = {'a': 6377019.2563, 'rf': 300.0, 'description': 'Andrae 1876 (Denmark, Iceland)'}\n",
"aust_SA = {'a': 6378160.0, 'rf': 298.25, 'description': 'Australian Natl & S. Amer. 1969'}\n",
"GRS67 = {'a': 6378160.0, 'rf': 298.247167427, 'description': 'GRS 67(IUGG 1967)'}\n",
"GSK2011 = {'a': 6378136.5, 'rf': 298.2564151, 'description': 'GSK-2011'}\n",
"bessel = {'a': 6377397.155, 'rf': 299.1528128, 'description': 'Bessel 1841'}\n",
"bess_nam = {'a': 6377483.865, 'rf': 299.1528128, 'description': 'Bessel 1841 (Namibia)'}\n",
"clrk66 = {'a': 6378206.4, 'b': 6356583.8, 'description': 'Clarke 1866'}\n",
"clrk80 = {'a': 6378249.145, 'rf': 293.4663, 'description': 'Clarke 1880 mod.'}\n",
"clrk80ign = {'a': 6378249.2, 'rf': 293.4660212936269, 'description': 'Clarke 1880 (IGN).'}\n",
"CPM = {'a': 6375738.7, 'rf': 334.29, 'description': 'Comm. des Poids et Mesures 1799'}\n",
"delmbr = {'a': 6376428.0, 'rf': 311.5, 'description': 'Delambre 1810 (Belgium)'}\n",
"engelis = {'a': 6378136.05, 'rf': 298.2566, 'description': 'Engelis 1985'}\n",
"evrst30 = {'a': 6377276.345, 'rf': 300.8017, 'description': 'Everest 1830'}\n",
"evrst48 = {'a': 6377304.063, 'rf': 300.8017, 'description': 'Everest 1948'}\n",
"evrst56 = {'a': 6377301.243, 'rf': 300.8017, 'description': 'Everest 1956'}\n",
"evrst69 = {'a': 6377295.664, 'rf': 300.8017, 'description': 'Everest 1969'}\n",
"evrstSS = {'a': 6377298.556, 'rf': 300.8017, 'description': 'Everest (Sabah & Sarawak)'}\n",
"fschr60 = {'a': 6378166.0, 'rf': 298.3, 'description': 'Fischer (Mercury Datum) 1960'}\n",
"fschr60m = {'a': 6378155.0, 'rf': 298.3, 'description': 'Modified Fischer 1960'}\n",
"fschr68 = {'a': 6378150.0, 'rf': 298.3, 'description': 'Fischer 1968'}\n",
"helmert = {'a': 6378200.0, 'rf': 298.3, 'description': 'Helmert 1906'}\n",
"hough = {'a': 6378270.0, 'rf': 297.0, 'description': 'Hough'}\n",
"intl = {'a': 6378388.0, 'rf': 297.0, 'description': 'International 1924 (Hayford 1909, 1910)'}\n",
"krass = {'a': 6378245.0, 'rf': 298.3, 'description': 'Krassovsky, 1942'}\n",
"kaula = {'a': 6378163.0, 'rf': 298.24, 'description': 'Kaula 1961'}\n",
"lerch = {'a': 6378139.0, 'rf': 298.257, 'description': 'Lerch 1979'}\n",
"mprts = {'a': 6397300.0, 'rf': 191.0, 'description': 'Maupertius 1738'}\n",
"new_intl = {'a': 6378157.5, 'b': 6356772.2, 'description': 'New International 1967'}\n",
"plessis = {'a': 6376523.0, 'b': 6355863.0, 'description': 'Plessis 1817 (France)'}\n",
"PZ90 = {'a': 6378136.0, 'rf': 298.25784, 'description': 'PZ-90'}\n",
"SEasia = {'a': 6378155.0, 'b': 6356773.3205, 'description': 'Southeast Asia'}\n",
"walbeck = {'a': 6376896.0, 'b': 6355834.8467, 'description': 'Walbeck'}\n",
"WGS60 = {'a': 6378165.0, 'rf': 298.3, 'description': 'WGS 60'}\n",
"WGS66 = {'a': 6378145.0, 'rf': 298.25, 'description': 'WGS 66'}\n",
"WGS72 = {'a': 6378135.0, 'rf': 298.26, 'description': 'WGS 72'}\n",
"WGS84 = {'a': 6378137.0, 'rf': 298.257223563, 'description': 'WGS 84'}\n",
"sphere = {'a': 6370997.0, 'b': 6370997.0, 'description': 'Normal Sphere (r=6370997)'}\n"
]
}
],
"outputs": [],
"source": [
"import pyproj\n",
"for key in pyproj.list.get_ellps_map().keys():\n",
Expand All @@ -207,22 +154,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WGS-84 = (6378.137, 6356.7523142, 0.0033528106647474805)\n",
"GRS-80 = (6378.137, 6356.7523141, 0.003352810681182319)\n",
"Airy (1830) = (6377.563396, 6356.256909, 0.0033408506414970775)\n",
"Intl 1924 = (6378.388, 6356.911946, 0.003367003367003367)\n",
"Clarke (1880) = (6378.249145, 6356.51486955, 0.003407561378699334)\n",
"GRS-67 = (6378.16, 6356.774719, 0.003352891869237217)\n"
]
}
],
"outputs": [],
"source": [
"from geopy import distance\n",
"for key in distance.ELLIPSOIDS.keys():\n",
Expand All @@ -235,25 +169,14 @@
"source": [
"### **The standard reference ellipsoid for working with Earth is WGS-84**\n",
"\n",
"`geopy` by default makes use of WGS-84 where \"the mean earth radius as defined by the International Union of Geodesy and Geophysics, (2a + b)/3 = 6371.0087714150598 kilometers approx 6371.009 km (for WGS-84), resulting in an error of up to about 0.5%\" ([geopy](https://geopy.readthedocs.io/en/stable/)).\n",
"\n",
"WGS-84 is a unified global ellipsoid model that is used for GPS collected from GPS satellites to calculate extremely preise measurements of the Earth. For the purpose of this notebook, this is the ellipsoid model we will be working with."
"`geopy` by default makes use of WGS-84 which is a a unified global ellipsoid model that is used for GPS collected from satellites to calculate extremely preise measurements of the Earth. For the purpose of this notebook, this is the ellipsoid model we will be working with."
]
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'a': 6378137.0, 'rf': 298.257223563, 'description': 'WGS 84'}\n",
"(6378.137, 6356.7523142, 0.0033528106647474805)\n"
]
}
],
"outputs": [],
"source": [
"print(pyproj.list.get_ellps_map()[\"WGS84\"])\n",
"print(distance.ELLIPSOIDS[\"WGS-84\"])"
Expand All @@ -274,7 +197,7 @@
"source": [
"## Geodesy\n",
"\n",
"Geodesy is the complex science of measuring the Earth's \"geometric shape, orientation in space, and gravity field\".\n",
"Geodesy is the complex science of measuring the Earth's geometric shape.\n",
"\n",
"[Learn more!](https://oceanservice.noaa.gov/facts/geodesy.html)\n",
"\n",
Expand All @@ -288,7 +211,7 @@
"\n",
"<img src=\"https://upload.wikimedia.org/wikipedia/commons/6/6a/Insect_on_a_torus_tracing_out_a_non-trivial_geodesic.gif\" alt=\"Straight Line on a curved surface\" width=400></img>\n",
"\n",
"This is especially apparent when working with satellite data where the apparent \"straight path\" that a satellite will trace across the the surface of a planet"
"This is especially apparent when working with satellite data where the apparent \"straight path\" that a satellite will trace across the the surface of a planet."
]
},
{
Expand Down Expand Up @@ -322,11 +245,11 @@
"A great circle is formed by a plane intersecting a sphere and the center, like the equator.\n",
"\n",
"\n",
"Great Circles make use of spherical geometry to measure features on the curved surface of a unit sphere. However, planets like Earth are not perfect spheres and to account for the error are combined with geodesic calculations to reduce the error in final calculations.\n",
"Great circles make use of spherical geometry to measure features on the curved surface of a unit sphere. However, planets like Earth are not perfect spheres and to account for the error are combined with geodesic calculations to reduce the error in final calculations.\n",
"\n",
"### What's next?\n",
"\n",
"Coordinates and Great Circles\n"
"Coordinates and Great Circles"
]
}
],
Expand All @@ -346,7 +269,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.1"
"version": "3.12.7"
},
"nbdime-conflicts": {
"local_diff": [
Expand Down
Loading
Loading