naturedynamics 1.2__tar.gz → 1.3__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.
- {naturedynamics-1.2 → naturedynamics-1.3}/PKG-INFO +1 -1
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/__init__.py +1 -1
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/atmospheric.py +22 -3
- naturedynamics-1.3/naturedynamics/astrophysics/insolation.py +72 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/constants.py +12 -0
- naturedynamics-1.3/naturedynamics/geophysics/plate_kinematics.py +127 -0
- naturedynamics-1.3/naturedynamics/tools/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics.egg-info/PKG-INFO +1 -1
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics.egg-info/SOURCES.txt +3 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/pyproject.toml +1 -1
- {naturedynamics-1.2 → naturedynamics-1.3}/LICENSE +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/README.md +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/applications/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/applications/energy.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/applications/engineering.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/applications/environmental.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/applications/medical.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/cosmology.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/galactic.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/magnetism.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/orbital.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/photometry.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/planetary.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/stellar.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/astrophysics/tidal.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/biophysics/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/biophysics/biomechanics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/biophysics/diffusion.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/biophysics/membrane.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/biophysics/neuroscience.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/biophysics/photosynthesis.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/computational/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/computational/finite_elements.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/computational/monte_carlo.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/computational/numerical_methods.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/computational/optimization.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/data/CIE_CMF.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/data/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/data/materials/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/data/materials/materials.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/data/spectroscopic_data/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/data/spectroscopic_data/spectra.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/electromagnetism/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/electromagnetism/circuits.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/electromagnetism/electrostatics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/electromagnetism/magnetostatics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/electromagnetism/maxwell.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/electromagnetism/optics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/electromagnetism/waves.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/experimental/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/experimental/data_analysis.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/experimental/error_analysis.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/experimental/instrumentation.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/experimental/measurement.py +0 -0
- {naturedynamics-1.2/naturedynamics/mathematical → naturedynamics-1.3/naturedynamics/geophysics}/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/laws/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/laws/conservation.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/laws/electromagnetic.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/laws/momentum.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/laws/newtons_laws.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/laws/work_energy.py +0 -0
- {naturedynamics-1.2/naturedynamics/plasma → naturedynamics-1.3/naturedynamics/mathematical}/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/complex_analysis.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/differential_equations.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/group_theory.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/mathematical_neuroscience.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/special_functions.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/tensor_calculus.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/continuum.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/dynamics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/fluid_mechanics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/kinematics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/lagrangian.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/rotational_mechanics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/sound.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/statics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mechanics/stress_strain.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/nuclear/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/nuclear/binding_energy.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/nuclear/decay.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/nuclear/fission_fusion.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/nuclear/particles.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/nuclear/reactions.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/oscillations/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/oscillations/acoustics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/oscillations/coupled_oscillators.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/oscillations/shm.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/oscillations/vibrations.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/oscillations/wave_oscillation.py +0 -0
- {naturedynamics-1.2/naturedynamics/relativity → naturedynamics-1.3/naturedynamics/plasma}/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/plasma/basic.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/plasma/kinetic.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/plasma/magnetohydrodynamics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/plasma/waves.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/harmonic_oscillator.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/hydrogen_atom.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/operators.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/perturbation.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/spin.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/statistics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/tunneling.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/quantum/wave_functions.py +0 -0
- {naturedynamics-1.2/naturedynamics/solidstate → naturedynamics-1.3/naturedynamics/relativity}/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/relativity/cosmology.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/relativity/general.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/relativity/spacetime.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/relativity/special.py +0 -0
- {naturedynamics-1.2/naturedynamics/tools → naturedynamics-1.3/naturedynamics/solidstate}/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solidstate/crystal_structure.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solidstate/electronic.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solidstate/magnetic.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solidstate/phonons.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solidstate/superconductivity.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solutions/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solutions/atomic.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solutions/field_theory.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solutions/molecular.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solutions/operators.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/solutions/statistical.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/critical_phenomena.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/distributions.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/partition_functions.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/quantum_statistics.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/thermodynamics/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/thermodynamics/heat_engines.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/thermodynamics/heat_transfer.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/thermodynamics/laws.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/thermodynamics/phase_transitions.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/tools/calculators.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/tools/exporters.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/tools/simulators.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/tools/visualizers.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/utils/__init__.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/utils/conversions.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/utils/decorators.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/utils/plotting.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/utils/units.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/utils/validators.py +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics.egg-info/dependency_links.txt +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics.egg-info/requires.txt +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics.egg-info/top_level.txt +0 -0
- {naturedynamics-1.2 → naturedynamics-1.3}/setup.cfg +0 -0
|
@@ -36,11 +36,30 @@ def rayleigh_optical_depth(wavelength_nm, refractivity, king_factor, column_dens
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def beer_lambert_transmission(optical_depth, air_mass=1.0):
|
|
39
|
-
"""Fraction of a beam surviving a slab: exp(-tau/mu_0).
|
|
39
|
+
"""Fraction of a beam surviving a slab: exp(-tau * X) = exp(-tau/mu_0).
|
|
40
40
|
|
|
41
|
-
air_mass is
|
|
41
|
+
air_mass X is the path through the atmosphere relative to the vertical,
|
|
42
|
+
1/cos(zenith angle) for a flat slab (see `air_mass` for the curved one);
|
|
43
|
+
1.0 is the overhead sun. (It divided by the air mass until 1.3, which
|
|
44
|
+
was only right at 1.0 -- the only value anything passed.)
|
|
42
45
|
"""
|
|
43
|
-
return math.exp(-optical_depth
|
|
46
|
+
return math.exp(-optical_depth * air_mass)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def air_mass(altitude):
|
|
50
|
+
"""Relative optical air mass towards an altitude above the horizon.
|
|
51
|
+
|
|
52
|
+
Kasten & Young's fit, which stays finite at the horizon where a flat
|
|
53
|
+
slab's 1/sin(altitude) does not: X = 1 / (sin h + 0.50572 (h + 6.07995)^-1.6364),
|
|
54
|
+
h in degrees. 1.0 at the zenith, ~38 at the horizon. F. Kasten and
|
|
55
|
+
A. T. Young, "Revised optical air mass tables and approximation
|
|
56
|
+
formula", Applied Optics 28(22), 4735-4738 (1989),
|
|
57
|
+
https://doi.org/10.1364/AO.28.004735
|
|
58
|
+
|
|
59
|
+
Args: altitude (rad), above about -6 degrees where the fit holds.
|
|
60
|
+
"""
|
|
61
|
+
degrees = math.degrees(altitude)
|
|
62
|
+
return 1.0 / (math.sin(altitude) + 0.50572 * (degrees + 6.07995) ** -1.6364)
|
|
44
63
|
|
|
45
64
|
|
|
46
65
|
def single_scatter_fraction(optical_depth, air_mass=1.0):
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Sunlight at the top of a planet's atmosphere, by latitude and season.
|
|
2
|
+
|
|
3
|
+
Formulas follow Berger, "Long-term variations of daily insolation and
|
|
4
|
+
Quaternary climatic changes", J. Atmos. Sci. 35 (1978), 2362-2367,
|
|
5
|
+
https://doi.org/10.1175/1520-0469(1978)035%3C2362:LTVODI%3E2.0.CO;2: angles
|
|
6
|
+
in radians, the solar longitude measured in the orbital plane from the
|
|
7
|
+
planet's vernal equinox (0 at northern spring, pi/2 at northern summer
|
|
8
|
+
solstice).
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import math
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def solar_longitude(true_anomaly, longitude_of_periapsis):
|
|
15
|
+
"""
|
|
16
|
+
The star's longitude as seen from the planet, from its vernal equinox.
|
|
17
|
+
|
|
18
|
+
With the planet at heliocentric longitude pi at its vernal equinox, the
|
|
19
|
+
star's planetocentric longitude is the planet's heliocentric one less pi:
|
|
20
|
+
Ls = f + varpi - pi.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
true_anomaly (float): f (rad), from periapsis
|
|
24
|
+
longitude_of_periapsis (float): varpi (rad), from the vernal equinox
|
|
25
|
+
direction
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
float: Ls (rad), in [0, 2 pi)
|
|
29
|
+
"""
|
|
30
|
+
return (true_anomaly + longitude_of_periapsis - math.pi) % (2 * math.pi)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def solar_declination(obliquity, solar_longitude):
|
|
34
|
+
"""
|
|
35
|
+
Latitude of the subsolar point: sin(delta) = sin(epsilon) sin(Ls).
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
obliquity (float): epsilon (rad), the axial tilt
|
|
39
|
+
solar_longitude (float): Ls (rad)
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
float: delta (rad)
|
|
43
|
+
"""
|
|
44
|
+
return math.asin(math.sin(obliquity) * math.sin(solar_longitude))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def daily_mean_insolation(flux, latitude, declination):
|
|
48
|
+
"""
|
|
49
|
+
Top-of-atmosphere flux averaged over one rotation, Berger (1978) eq. 1:
|
|
50
|
+
Q = (S / pi) (h0 sin(phi) sin(delta) + cos(phi) cos(delta) sin(h0)), with
|
|
51
|
+
h0 the hour angle of sunset, cos(h0) = -tan(phi) tan(delta); h0 is pi in
|
|
52
|
+
polar day and 0 in polar night.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
flux (float): S (W/m^2), the stellar flux at the planet's distance
|
|
56
|
+
at that moment
|
|
57
|
+
latitude (float): phi (rad)
|
|
58
|
+
declination (float): delta (rad)
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
float: Q (W/m^2)
|
|
62
|
+
"""
|
|
63
|
+
product = math.tan(latitude) * math.tan(declination)
|
|
64
|
+
sunset = math.acos(max(-1.0, min(1.0, -product)))
|
|
65
|
+
return (
|
|
66
|
+
flux
|
|
67
|
+
/ math.pi
|
|
68
|
+
* (
|
|
69
|
+
sunset * math.sin(latitude) * math.sin(declination)
|
|
70
|
+
+ math.cos(latitude) * math.cos(declination) * math.sin(sunset)
|
|
71
|
+
)
|
|
72
|
+
)
|
|
@@ -128,6 +128,17 @@ KING_FACTOR = {
|
|
|
128
128
|
"xe": 1.000,
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
# Dry air at sea level, percent by volume: the reference other atmospheres
|
|
132
|
+
# are compared against, e.g. a sky's Rayleigh scattering relative to Earth's.
|
|
133
|
+
# U.S. Standard Atmosphere, 1976 (NOAA-S/T 76-1562), Table 3, its four major
|
|
134
|
+
# constituents: https://ntrs.nasa.gov/citations/19770009539
|
|
135
|
+
DRY_AIR_COMPOSITION = {
|
|
136
|
+
"n_2": 78.084,
|
|
137
|
+
"o_2": 20.9476,
|
|
138
|
+
"ar": 0.934,
|
|
139
|
+
"co_2": 0.0314,
|
|
140
|
+
}
|
|
141
|
+
|
|
131
142
|
# Longest wavelength (nm) a photosynthetic pigment can usefully absorb.
|
|
132
143
|
# Oxygenic photosynthesis must split water, which costs ~1.77 eV per photon
|
|
133
144
|
# in a two-photon Z-scheme; anoxygenic pathways using H2S/Fe2+/H2 are cheaper.
|
|
@@ -406,6 +417,7 @@ __all__ = [
|
|
|
406
417
|
"LOSCHMIDT_NUMBER",
|
|
407
418
|
"REFRACTIVITY_STP",
|
|
408
419
|
"KING_FACTOR",
|
|
420
|
+
"DRY_AIR_COMPOSITION",
|
|
409
421
|
"EARTH_PHOTOSYNTHETIC_PHOTON_FLUX",
|
|
410
422
|
"OXYGENIC_RED_LIMIT_NM",
|
|
411
423
|
"ANOXYGENIC_RED_LIMIT_NM",
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""Rigid plates on a sphere: Euler poles, finite rotations, surface velocity.
|
|
2
|
+
|
|
3
|
+
Every plate motion on a sphere is a rotation about an axis through its
|
|
4
|
+
centre (Euler's fixed-point theorem); where that axis pierces the surface is
|
|
5
|
+
the plate's Euler pole. Conventions follow Cox & Hart, *Plate Tectonics: How
|
|
6
|
+
It Works* (Blackwell, 1986), ch. 4, and the GPlates rotation files: latitude
|
|
7
|
+
and longitude in radians, east-positive longitude, a positive angle turning
|
|
8
|
+
counter-clockwise seen from above the pole (right-hand rule about the pole).
|
|
9
|
+
Points are unit vectors (x towards 0 deg N 0 deg E, z towards the north pole).
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import math
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def unit_vector(latitude, longitude):
|
|
16
|
+
"""
|
|
17
|
+
The point at a latitude and longitude, as a unit vector.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
latitude (float): rad, north positive
|
|
21
|
+
longitude (float): rad, east positive
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
tuple: (x, y, z)
|
|
25
|
+
"""
|
|
26
|
+
cos_lat = math.cos(latitude)
|
|
27
|
+
return (
|
|
28
|
+
cos_lat * math.cos(longitude),
|
|
29
|
+
cos_lat * math.sin(longitude),
|
|
30
|
+
math.sin(latitude),
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def latitude_longitude(vector):
|
|
35
|
+
"""
|
|
36
|
+
Latitude and longitude of a vector's direction.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
vector (tuple): (x, y, z), any non-zero length
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
tuple: (latitude, longitude) in rad, longitude in (-pi, pi]
|
|
43
|
+
"""
|
|
44
|
+
x, y, z = vector
|
|
45
|
+
return math.atan2(z, math.hypot(x, y)), math.atan2(y, x)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def euler_pole_from_arc(start, end):
|
|
49
|
+
"""
|
|
50
|
+
The rotation taking one point to another along the great circle between
|
|
51
|
+
them: its pole is start x end, its angle the arc length.
|
|
52
|
+
|
|
53
|
+
This is the pole a plate needs to carry `start` to `end` by the shortest
|
|
54
|
+
route; any pole on the perpendicular bisector of the arc would carry the
|
|
55
|
+
point there too, but would turn the rest of the plate differently.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
start (tuple): unit vector
|
|
59
|
+
end (tuple): unit vector
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
tuple: (pole, angle) -- pole a unit vector, angle in rad, 0..pi.
|
|
63
|
+
pole is None when the points coincide (no rotation) and raises
|
|
64
|
+
for antipodal points (every great circle joins them).
|
|
65
|
+
"""
|
|
66
|
+
cross = (
|
|
67
|
+
start[1] * end[2] - start[2] * end[1],
|
|
68
|
+
start[2] * end[0] - start[0] * end[2],
|
|
69
|
+
start[0] * end[1] - start[1] * end[0],
|
|
70
|
+
)
|
|
71
|
+
sine = math.sqrt(sum(c * c for c in cross))
|
|
72
|
+
cosine = sum(a * b for a, b in zip(start, end))
|
|
73
|
+
angle = math.atan2(sine, cosine)
|
|
74
|
+
if sine < 1e-15:
|
|
75
|
+
if cosine > 0:
|
|
76
|
+
return None, 0.0
|
|
77
|
+
raise ValueError("antipodal points: no unique great circle joins them")
|
|
78
|
+
return tuple(c / sine for c in cross), angle
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def rotate_about_pole(point, pole, angle):
|
|
82
|
+
"""
|
|
83
|
+
A point turned about a pole by an angle (Rodrigues' rotation formula).
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
point (tuple): vector
|
|
87
|
+
pole (tuple): unit vector, the rotation axis
|
|
88
|
+
angle (float): rad, right-handed about the pole
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
tuple: the rotated vector
|
|
92
|
+
"""
|
|
93
|
+
c, s = math.cos(angle), math.sin(angle)
|
|
94
|
+
dot = sum(p * k for p, k in zip(point, pole))
|
|
95
|
+
cross = (
|
|
96
|
+
pole[1] * point[2] - pole[2] * point[1],
|
|
97
|
+
pole[2] * point[0] - pole[0] * point[2],
|
|
98
|
+
pole[0] * point[1] - pole[1] * point[0],
|
|
99
|
+
)
|
|
100
|
+
return tuple(
|
|
101
|
+
point[i] * c + cross[i] * s + pole[i] * dot * (1 - c) for i in range(3)
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def surface_velocity(point, pole, angular_rate, radius):
|
|
106
|
+
"""
|
|
107
|
+
Velocity of a point on a plate turning about its Euler pole: omega x r.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
point (tuple): unit vector of the point
|
|
111
|
+
pole (tuple): unit vector of the Euler pole
|
|
112
|
+
angular_rate (float): rad per unit time
|
|
113
|
+
radius (float): sphere radius
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
tuple: (vx, vy, vz) in radius units per unit time, tangent to the
|
|
117
|
+
sphere at the point
|
|
118
|
+
"""
|
|
119
|
+
w = tuple(angular_rate * k for k in pole)
|
|
120
|
+
return tuple(
|
|
121
|
+
radius * v
|
|
122
|
+
for v in (
|
|
123
|
+
w[1] * point[2] - w[2] * point[1],
|
|
124
|
+
w[2] * point[0] - w[0] * point[2],
|
|
125
|
+
w[0] * point[1] - w[1] * point[0],
|
|
126
|
+
)
|
|
127
|
+
)
|
|
File without changes
|
|
@@ -17,6 +17,7 @@ naturedynamics/astrophysics/__init__.py
|
|
|
17
17
|
naturedynamics/astrophysics/atmospheric.py
|
|
18
18
|
naturedynamics/astrophysics/cosmology.py
|
|
19
19
|
naturedynamics/astrophysics/galactic.py
|
|
20
|
+
naturedynamics/astrophysics/insolation.py
|
|
20
21
|
naturedynamics/astrophysics/magnetism.py
|
|
21
22
|
naturedynamics/astrophysics/orbital.py
|
|
22
23
|
naturedynamics/astrophysics/photometry.py
|
|
@@ -52,6 +53,8 @@ naturedynamics/experimental/data_analysis.py
|
|
|
52
53
|
naturedynamics/experimental/error_analysis.py
|
|
53
54
|
naturedynamics/experimental/instrumentation.py
|
|
54
55
|
naturedynamics/experimental/measurement.py
|
|
56
|
+
naturedynamics/geophysics/__init__.py
|
|
57
|
+
naturedynamics/geophysics/plate_kinematics.py
|
|
55
58
|
naturedynamics/laws/__init__.py
|
|
56
59
|
naturedynamics/laws/conservation.py
|
|
57
60
|
naturedynamics/laws/electromagnetic.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "naturedynamics"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.3"
|
|
8
8
|
authors = [{name = "Fabian Schober", email = "reach@fabianschober.com"}]
|
|
9
9
|
description = "A comprehensive physics library providing constants, equations, and formulas"
|
|
10
10
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/data/spectroscopic_data/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/differential_equations.py
RENAMED
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/mathematical/mathematical_neuroscience.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/oscillations/coupled_oscillators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2/naturedynamics/tools → naturedynamics-1.3/naturedynamics/solidstate}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/critical_phenomena.py
RENAMED
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/distributions.py
RENAMED
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/statistical_mechanics/quantum_statistics.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{naturedynamics-1.2 → naturedynamics-1.3}/naturedynamics/thermodynamics/phase_transitions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|