Skip to content

Commit

Permalink
adds site files
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Sep 16, 2024
1 parent ace90e8 commit 9f67594
Show file tree
Hide file tree
Showing 33 changed files with 12,536 additions and 1 deletion.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Earth tomo viewer

![Earth tomo viewer](earth_tomo_viewer.jpg "Earth tomo viewer screenshot")

## Flow animation for tomographic seismic images

This site displays seismic images at a depth of 150 km from different global tomographic models. The flow animation follows the seismic velocity gradient to provide an intuitive visual of the model.

This project is still in a beta version with limited features and capabilities.
The site reads in seismic models, that is tomographic depth slices of shear velocities, as grayscale JPEG-images.
The images have been created so far using the excellent [SubMachine web tool](https://users.earth.ox.ac.uk/~smachine/cgi/index.php?page=tomo_depth)
from Kasra Hosseini.

Once a tomographic depth slice is read in, this project will compute its seismic velocity gradients.
This gradient represents the vector field for the particle animation. Assuming fast velocities (bright gray colors in the original JPEG-image) correspond
to cold mantle material and slow velocities (dark gray) to hot material, the gradient might be similar to a temperature gradient.
Thus, you can think of the particles as being mantle material moving from hot to cold places.

As additional option in the menu on the top right, you can add earthquake locations of all GCMT catalog events between 1976 to 2024 that occurred at a depth between 125 to 175 km. The data file was gathered using the [USGS FDSN event web service](https://earthquake.usgs.gov/fdsnws/event/1/).

The globe model also shows hotspot locations gathered from different sources, and plate boundaries (following Peter Bird's 2002 model) as orientation features.

Now, enjoy the meditation :)


---

## Development

## Idea

This project is highly inspired by Cameron Beccario's [earth.nullschool.net](https://earth.nullschool.net) project.
While his project deals with real-time atmospheric/ocean data, this one here is focussing on seismic models.
Cameron's version is much more sophisticated though.

### Project history

While working together with Elodie Kendall on implementing SGLOBE-rani into SPECFEM3D_GLOBE some years ago, we thought about how to visualize that model in such a way that the seismic anisotropy could reveal itself. That's when I thought it would be cool to see how Cameron's visualization would work on seismic models.

So, I started this project to learn more about javascript and d3 rendering, after trying out other visualizations libraries like
globe.gl and three.js. While globe.gl offered a simple and fast webGL rendering library, I struggled to get the particle animation
running smoothly enough for more than 10,000 particles.

d3 seems to render particles pretty fast to a canvas element, but it's quite a learning curve to get there. What I missed most so far in d3 is a better texture and lightning rendering for the orthographic projection. Thus, the bump map and hillshade effect is calculated explicitly for each pixel - which seems overkill. The main help to render the particle trails was to use the canvas as a history buffer and add a blend composite effect to fade out the old pixels. After learning more about rendering techniques in this project, I might go
back to globe.gl and revisit my code to see if I could further improve that.

## Code setup

For this project, I keep things as simple as possible. In particular, I tried to reduce the dependency on external scripts as much as possible, providing d3 and related scripts in the folder `js/lib`. The main scripts for processing and rendering the seismic images are all in the folder `js/`.

A lot of the model setup is still hard-coded, but in principle you would put your new tomo image into the `data/` folder,
and modify mostly the `vectorField.js` script in the `js/` folder. When time permits, I'll try to make this more automated and recognize any new tomo file in the folder to setup the page correctly. Furthermore, it would be nice to add different depth slices and have a slider to change the depth display.


## Rendering

The rendering is still shaky and there is lots to improve. In particular, the way I handle messaging and state changes in the renderer
are not well thought out. The processing of the image data and texture mapping uses web workers.
This adds multi-threading to this javascript environment, but will only work with newer web browsers.

Furthermore, the code structuring relies on ES6 module capabilities. Thus, it won't be supported on old browsers.
My IIFE's are rudimentary, and most coding style is pretty simple. The rendering uses two canvas elements to separate the bump map and
vector field texturing from the particle animation rendering. On top, I added an SVG element to interact with mouse-over events.
That's just to add a bit of fun, displaying common hotspot locations when you find one :)

Enough blabla, if you have suggestions and/or want to contribute to this project, please feel free to do so - your contributions are very welcome!

-daniel, September 2024
Binary file added data/earth_bumpmap_8192x4096.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 151 additions & 0 deletions data/geological_hotspots.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {"name": "Afar"},
"geometry": {"type": "Point", "coordinates": [42.0, 12.0]}
},
{
"type": "Feature",
"properties": {"name": "Yellowstone"},
"geometry": {"type": "Point", "coordinates": [-110.7, 44.4]}
},
{
"type": "Feature",
"properties": {"name": "Azores"},
"_comment": "or [-28.0, 38.7]",
"geometry": {"type": "Point", "coordinates": [-28.0, 38.5]}
},
{
"type": "Feature",
"properties": {"name": "Canary Islands"},
"_comment": "or [-16.6, 28.0]",
"geometry": {"type": "Point", "coordinates": [-16.0, 28.5]}
},
{
"type": "Feature",
"properties": {"name": "Cape Verde"},
"_comment": "or [-24.0, 15.0]",
"geometry": {"type": "Point", "coordinates": [-23.5, 15.0]}
},
{
"type": "Feature",
"properties": {"name": "Bermuda"},
"_comment": "or [-64.75, 32.3]",
"geometry": {"type": "Point", "coordinates": [-64.8, 32.3]}
},
{
"type": "Feature",
"properties": {"name": "Madeira"},
"geometry": {"type": "Point", "coordinates": [-17.0, 32.8]}
},
{
"type": "Feature",
"properties": {"name": "Iceland"},
"_comment": "or [-17.3, 64.4]",
"geometry": {"type": "Point", "coordinates": [-21.9, 64.1]}
},
{
"type": "Feature",
"properties": {"name": "St. Helena"},
"geometry": {"type": "Point", "coordinates": [-5.7, -15.9]}
},
{
"type": "Feature",
"properties": {"name": "Ascension Island"},
"geometry": {"type": "Point", "coordinates": [-14.4, -7.9]}
},
{
"type": "Feature",
"properties": {"name": "Tristan da Cunha"},
"geometry": {"type": "Point", "coordinates": [-12.3, -37.1]}
},
{
"type": "Feature",
"properties": {"name": "Galapagos"},
"geometry": {"type": "Point", "coordinates": [-91.0, -0.5]}
},
{
"type": "Feature",
"properties": {"name": "Hawaii"},
"_comment": "or [-154.6, 20.6]",
"geometry": {"type": "Point", "coordinates": [-155.5, 19.6]}
},
{
"type": "Feature",
"properties": {"name": "Reunion"},
"geometry": {"type": "Point", "coordinates": [55.7, -21.1]}
},
{
"type": "Feature",
"properties": {"name": "Easter Island"},
"_comment": "or [-108.6, -27.0]",
"geometry": {"type": "Point", "coordinates": [-109.4, -27.1]}
},
{
"type": "Feature",
"properties": {"name": "Samoa"},
"_comment": "or [-169.6, -14.0]",
"geometry": {"type": "Point", "coordinates": [-172.1, -13.8]}
},
{
"type": "Feature",
"properties": {"name": "Louisville"},
"_comment": "or [-139.3, -50.1]",
"geometry": {"type": "Point", "coordinates": [-139.0, -50.0]}
},
{
"type": "Feature",
"properties": {"name": "Macdonald"},
"_comment": "or [-140.4, -28.5]",
"geometry": {"type": "Point", "coordinates": [-150.0, -29.0]}
},
{
"type": "Feature",
"properties": {"name": "Kerguelen"},
"geometry": {"type": "Point", "coordinates": [69.5, -49.5]}
},
{
"type": "Feature",
"properties": {"name": "Caroline Islands"},
"_comment": "or [164.0, 5.2]",
"geometry": {"type": "Point", "coordinates": [151.0, 7.5]}
},
{
"type": "Feature",
"properties": {"name": "Bouvet"},
"geometry": {"type": "Point", "coordinates": [1.0, -54.5]}
},
{
"type": "Feature",
"properties": {"name": "Bowie"},
"geometry": {"type": "Point", "coordinates": [-135.6, 53.5]}
},
{
"type": "Feature",
"properties": {"name": "Cobb"},
"geometry": {"type": "Point", "coordinates": [-130.0, 46.0]}
},
{
"type": "Feature",
"properties": {"name": "Guadalupe"},
"geometry": {"type": "Point", "coordinates": [-117.3, 29.0]}
},
{
"type": "Feature",
"properties": {"name": "Pitcairn"},
"geometry": {"type": "Point", "coordinates": [-128.4, -24.7]}
},
{
"type": "Feature",
"properties": {"name": "Socorro"},
"geometry": {"type": "Point", "coordinates": [-111.0, 19.1]}
},
{
"type": "Feature",
"properties": {"name": "Tahiti"},
"geometry": {"type": "Point", "coordinates": [-148.1, -17.7]}
}
]
}
Loading

0 comments on commit 9f67594

Please sign in to comment.