https://github.com/kshramt/eq
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kshramt/eq
- Owner: kshramt
- Created: 2013-06-15T04:20:07.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2015-11-14T10:29:13.000Z (over 10 years ago)
- Last Synced: 2025-09-25T00:39:22.440Z (9 months ago)
- Language: Python
- Size: 664 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `eq`
## Build
```bash
make build
```
## Test
```bash
make check
```
## `eq.moment_tensor`
### Output focal mechanisms in VTK format for 3D visualization
```bash
python3 <| meca.vtk
import math
import eq.moment_tensor
m = eq.moment_tensor.MomentTensor()
x1, y1, z1 = 1, 2, 3
m.strike_dip_rake = 42, 80, 15
point1s, triangle1s, amplitude1s = m.amplitude_distribution(4)
points1 = [point1 + [x1, y1, z1] for point1 in point1s]
x2, y2, z2 = 4, 7, 2
m.strike_dip_rake = 32, 41, 91
point2s, triangle2s, amplitude2s = m.amplitude_distribution(4)
point2s = [point2 + [x2, y2, z2] for point2 in point2s]
points, triangles, amplitudes = eq.moment_tensor.merge_amplitude_distributions((
(point1s, triangle1s, amplitude1s),
(point2s, triangle2s, amplitude2s),
))
amplitudes = [math.copysign(1, a) for a in amplitudes]
print(eq.moment_tensor.vtk(points, triangles, amplitudes))
EOF
paraview meca.vtk
```
## License
GPL version 3.