Can we predict earthquake?

7 day prediction map

Earthquake prediction at 1 May 2013 1o:20 AM

Scientists since ages have  said that earthquakes cannot be accurately predicted. I tried to develop a simple program which might tell where the next earthquake  might happen in next 3 days.   I  used the following assumptions to draw the earthquake prediction map.

Assumption 1: smaller earthquakes are triggered before the major earthquake.

Assumption 2 :  the longer the gap between earthquakes of smaller magnitude and current period, the higher is the probability of  earthquake of major magnitude(near to  6.0 richter scale or even greater than that).

These assumptions are really vague and to start the initial predictions. However,  I suggest to   adjust the weight of heatMap  by using multivariate linear regression. There can be additional hidden parameters like  solar discharge which interferes with earth magnetic field and maybe the core which later affects the movement of tectonic plates.  Such variables are not used in the present code.

The latest electron flux can be seen from the below image

.

 

 

Here goes the code. The most of the code is taken from Google HeatMap documentation.

<!DOCTYPE html>
<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false&libraries=visualization"></script>
<script>
var map;

function initialize() {
  var mapOptions = {
    zoom: 2,
    center: new google.maps.LatLng(2.8, -187.3),
    mapTypeId: google.maps.MapTypeId.TERRAIN
  };

  map = new google.maps.Map(document.getElementById('map_canvas'),
      mapOptions);

  // Create a script tag and set the USGS URL as the source.
  // Append this tag to the document's <head>.
  var script = document.createElement('script');
  script.src = 'http://earthquake.usgs.gov/earthquakes/feed/v0.1/summary/2.5_month.geojsonp';
  document.getElementsByTagName('head')[0].appendChild(script);
}

window.eqfeed_callback = function(results) {
  var heatmapData = [];
  for (var i = 0; i < results.features.length; i++) {
    var earthquake = results.features[i];
var magnitude = results.features[i].properties.mag;
var eqtime = results.features[i].properties.time;
var currtime = new Date().getTime();
var timeElapsed = (currtime-eqtime)/(3600*1000*24);

    var coords = earthquake.geometry.coordinates;
    var latLng = new google.maps.LatLng(coords[1],coords[0]);

    var marker = new google.maps.Marker({
      position: latLng,
      map: map,
      icon: getCircle(earthquake.properties.mag)
    });

 var weightedLoc = {
      location: latLng,
      weight: Math.pow(2, magnitude*timeElapsed)
    };
    heatmapData.push(weightedLoc);

  }
var heatmap = new google.maps.visualization.HeatmapLayer({
    data: heatmapData,
    dissipating: false,
    map: map
  });
}

function getCircle(magnitude) {
var colorM; 
if (magnitude <4)
   colorM='blue';
else{
   if (magnitude >4 && magnitude <=6)
     colorM='#AAAAAA';
else
     colorM='red';
}

return {
    path: google.maps.SymbolPath.CIRCLE,
    fillColor: colorM,
    fillOpacity: .2,
    scale: Math.pow(2, magnitude) / Math.PI,
    strokeColor: 'white',
    strokeWeight: .5
  };
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>

<body>
<div id="map_canvas" style="width:600px;height:600px;"></div>
</body>
</html>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s