Download Earthquake Catalogs from Global CMT website

In seismology, we always need to download and check the event information about the events. This python script can download the event catalog from the website to the local computer for the given range of time.

Running this program is very simple:
Screen Shot 2017-08-25 at 11.47.09 PM.png

The user just needs to input the time range for the earthquakes e.g., 2000/05-2009/08.


Requirements: Python 3

To download the program, please click here.

Plotting spiral pattern using MATLAB



clear; close all; clc

 t = linspace(0,10*pi,1000);

 x = t.*cos(t);

 y = t.*sin(t);



axis tight, grid on, view(35,30)

c = 1:numel(t);      

surface([x(:), x(:)], [y(:), y(:)], [z(:), z(:)], ...

    [c(:), c(:)], 'EdgeColor','flat', 'FaceColor','none','LineWidth',8);





Using Generic Mapping Tool (Basics)

Generic Mapping Tool (GMT) is an open-source collection of commands for processing and displaying 2D or 3D datasets. It also has features like rasterization, filtering and other image processing operations.

Here, we will see how can we use it to make high resolution publishable quality plots. It is very simple as it only involves few commands to get the control of the plot. In total, GMT only has about 80 commands so it is really simple to learn.

It can be downloaded from the GMT website 

echo "Output file is $output"
rm -f ${output}

# Define map characteristics
proj="-JM4.5i" # Mercator projection

open="-K -V -P -Xc -Yc"
add="-O -K -V"
close="-O -V"

grdimage $IN1 $proj $annot $bounds -C$cpl $open > $output
psscale -D13/10/10/0.5v -C$cpl -B3000:"Altitude in meters":/:mts: $add >> $output

psmeca $IN2 $proj $bounds -Sa.7c/0/0 -G0 -C -N $close >> $output

gs $output #requires the pre-installed ghostview or ghostscipt

For running this script, simply save it in any file and make the file executable and run it.

Screen Shot 2016-11-11 at 1.54.34 PM.png

Screen Shot 2016-11-11 at 2.04.17 PM.png

Guessing a number (Fortran)

This program will randomly pick a value and the user is prompted to enter their guess. It will keep counting your number of attempts to reach the value stored by the system. The lower the number of guesses you have, the better guesser you are or your algorithm is better.

To run the program:

Screen Shot 2016-10-27 at 4.54.33 PM.png

You can play with the program and try to modify it to learn more. Let’s see how many attempts you need!

Program: guess.f (by Cedric Legendre IES, Academia Sinica)