# Radiation of P/S/SH/SV waves from shear-tensile source model

## Description

The developed routine calculates P-wave, S-wave, SH-wave and SV-wave radiation pattern using shear-tensile source model. Original, it is a part of my paper “Assessment of P and S wave energy radiated from very small shear-tensile seismic events in a deep South African mine” published in Journal of Geophysical Research [Kwiatek and Ben-Zion, 2013].  Therefore, if you use the script below and find it useful, please provide an appropriate reference.

All input angles (strike, dip, rake of the fault, tensile angle gamma, takeoff angle TKO and azimuth from the source to the observation point AZM) should be provided in degrees. The takeoff angle is measure from bottom. The azimuth to the observation point is measured from north to east. The function returns matrices of the same size as input TKO and AZM matrices which should be of the same size and denote a set of observation points specified by takeoff angles and azimuth.

The function is available at MATLAB file exchange:

## Examples

Below is the simple script that creates a double-couple radiation pattern “flower” using the rpgen.m routine.

```AZIMUTH = (0:4:360)*pi/180;
TAKEOFF = (0:2:180)*pi/180;
[AZIMUTH,TAKEOFF] = meshgrid(AZIMUTH,TAKEOFF);

strike = 50;
dip = 60;
rake = -90;
sigma = 0.25;
gamma = 0;

[GP, GS, GSH, GSV] = rpgen(strike,dip,rake,gamma,sigma, TAKEOFF*180/pi, AZIMUTH*180/pi);
scale = abs(GP);
YP = scale.*cos(AZIMUTH) .* sin(TAKEOFF);
XP = scale.*sin(AZIMUTH) .* sin(TAKEOFF);
ZP = scale.*-cos(TAKEOFF);

surf(XP,YP,ZP,GP,'EdgeColor','none','FaceAlpha',0.9,'AmbientStrength',0.7,'EdgeColor','k','EdgeAlpha',0.1);
axis equal; box on;```

After execution, the following figure should appear:

## Bonus example :-)

I created two boot animations for Nexus 4 phones using the RPGEN routine. Although I had Nexus 4 in mind, the boot animations should work on most rooted android phones. Here is a nice tutorial I used to create the boot animation.

### Installation

Disclaimer: I take no responsibility for damaging your phone!

The created animations are zipped and you must simply put them manually into an appropriate folder (i.e. you must NOT use rom manager/recovery manager such as TWRP or ClockWorkMod Recovery). Just download the ZIP file to your phone and put it in appropriate folder. In case of Nexus 4, the appropriate folder is /system/media. Keep in mind your phone must be rooted and /system partition must be writable. I normally use root browser app to do this task. The existing bootanimation.zip can be overwritten (make a backup first!).

First boot animation:

Second boot animation: