Showing posts with label Seismology. Show all posts
Showing posts with label Seismology. Show all posts

Sunday, February 26, 2017

Pager duty at Berkeley Seismological Lab

As a graduate student at the Berkeley Seismological Lab, doing pager duty is one of the things that accompany you throughout your PhD study. Why is it called pager duty? You carry a pager with you and wait for it to beep 24 hours a day for a week (the duty is rotating every semester). Whenever it beeps, you need to sit in front of a computer, and work out the mechanism of the earthquake. This is what a pager looks like:
jpg
Some of the young people don't even know what a paper is, and yes, we are still using them. It is amazing that there are still companies doing business with pagers. They have some advantages over the smartphone: the battery can last for months, they work in some places where no cell signal is available, and it is cool to show off to friends :-). Overall, it does the job nicely. Like I mentioned, whenever this thing beeps, I need to work on the earthquake it reports in the next half hour to one hour, even in the middle of the night. Luckily, during my PhD life, it only happend about 3 or 4 times that I needed to do this 1 or 3 am in the morning. 
Ok, now you must be curious what we do after the pager beeps. Well, when it beeps, it means there was an earthquake larger than M3.5 in Northern California that just happened. Based on the waveforms recorded at seismic stations, a computer algorithm will generate a Moment Tensor Solution, which is a mathematical representation of the movement on a fault during an earthquake. This solution can tell us (mostly seismologists) how the fault actually moves. The alarm responders need to login to the system, review the result and do a better version of Moment Tensor Solutions. Once the result is reviewed, or a better solution is made, we will publish it to USGS. It will appear on the USGS website as the following figure
png
If you play around a little bit on the USGS website, and you can find more details about the solution the responder did, here's an example of one I did in 2013:
png
Don't worry if you can not understand what is shown here, it is designed for seismologists. And if you really want to know how it works, you can read this famous paper - A student's guide to and review of moment tensors. You can also check out the following video to get an idea of focal mechanism, which is a very close concept and you will learn how to read a beach ball diagram. 

I think it is really cool that we students can contribute to the USGS earthquake website and leave our names there forever (I assume the USGS earthquake page will last forever, as long as we still have earthquakes). 
Anyway, the pager duty is part of our graduate student life, and I believe that we will miss the feeling of doing duty in the middle of night after we graduate. 

Fun facts

  1. The pager will beep two times a day for testing purposes, at noon and 3:30 pm. That's usually the time when we show off to friends or see the curious looks on other people's faces. 
  2. During one tour of duty (7 days), responders will experience 0 or 1 earthquakes most of the time. Some lucky ones will have earthquake swarm occur during their duty :-)
  3. The average time to finish one earthquake moment tensor is about 1 hour. 
  4. We switch duty on Wednesdays at 5 pm.
I downloaded the earthquakes larger than M3.4 in Northern California (I choose M3.4, because after we finish the moment tensor solution, the magnitude may change from M3.5 to a smaller magnitude, i.e. M3.4, M3.3, and so on) from 2011 to 2017, and made some quick figures to show some interesting facts. 

Where do the earthquakes happen?

png
The red dots are the locations of earthquakes that our responders worked on in the last 6 years. 

When do the earthquakes happen?

png
It seems earthquakes were randomly distributed. 

Which hour during the day do the earthquakes happen?

png
We have relatively more earthquakes in the middle of night in the last 6 years, how many of us remember the earthquakes that woke us up: hands up! I have at least have 3 or 4 cases in my memory. Also, in the last 6 years, relatively low number of earthquakes around noon, that is good, since everyone is at lunch :-)

On which weekday do the most earthquakes happen?

png
Glad in the last 6 years that Sat and Sun are relatively low on earthquakes. 

What is the number of earthquakes each week?

png
This figure shows the number of earthquakes in each week (Wednesday to next Wednesday), I am wondering who is the lucky one that had 14 earthquakes during the duty :-) Definitely not me.

How many earthquakes do we usually see during duty?

png
This histogram shows us most responders did 1 or no earthquakes during the duty week (the first two bars show this, and more than half of the weeks in the last 6 years ended up with none earthquake). The following table is a quick statistic summary of the earthquake counts. The mean is 0.75 earthquakes per duty, and the 50th percentile is 0 earthquake, and 1 earthquakes for 75th percentile. So far today, I have already done two earthquakes (my lucky day!), maybe I will do more earthquakes this tour of duty and fall on the tails of the histogram. 
count311
mean0.75
std1.23
50%0
75%1
max14

Why do we have an alarm response team? Why do we have to get up in the middle of the night to look at earthquakes?

This is copied from our Lab website! 
As a seismological observatory, the Berkeley Seismological Laboratory has been involved in earthquake information for over a century. Part of our mission is to monitor earthquake activity and to provide timely and accurate information to state and federal agencies, to the media, and to the public.
Our primary responsibility is for local earthquakes. This has led to the development of the REDI project and the joint notification system with the USGS Menlo Park. Since much of this processing is automated, the Alarm Response workload has been significantly lightened. However, it is extremely important that the UCB alarm response people carefully review - and update, if necessary - information for larger events. This reviewing process must be done in collaboration with the USGS person on duty.
We also have a responsibility to respond to regional and teleseismic events. In this situation, our duties are to provide supporting information for the authoritative agency - for example, Caltech, the University of Washington, or NEIC. In general, we do not formally release our locations and magnitudes to the press if we have a solution from the authoritative group.

Conclusion

This blog was written because this might be my last duty since I will graduate soon and will be off duty. I even feel a little sad, the pager duty experience is somewhat fun while frustrating, and has been a big part of my life. I hope future students will enjoy the experience, and when I talk with them in the future, we will have so many things to cover.

Saturday, October 29, 2016

How to shake a 9-story building on Caltech campus

This week, I am visiting Caltech to do a shaker test, which is a test to shake a 9-story building - The Millikan library, and using sensors to record and measure the response of the building. I am here, because I will put ~30 smartphones on the top of the building, and see if we can use the smartphone to get the fundamental frequency of the building. Also, we will stand on the roof of the building while the shaking, therefore, you will understand that the shaking is not that large, but I was told I can feel the movement of the building for sure. 

How it works

Ok, I know you must curious how they shake the whole building, and whether they are safe or not. Let me explain this to you. 
First, let's see the building from certain distance: 
Figure 1
We know, there are many different things can shake a building, i.e. earthquake, high wind, rain, etc. They all need a force input into the building, for earthquake, the ground movement will introduce a force from the bottom into the building, while for wind, it blows on to the wall of the building, and introduces a lateral force into the building. But for us, how do we introduce a force into the building to shake it? Think about if the building is a toy, and the easiest way is just use your finger to push it on top. But we will not all push the building, instead, we will use something the following device that installed on the top of the building. See the figure below:
You may already have a sense how it works, see the two heavy metal blocks (they call them buckets, which are empty inside, and can be loaded with different configurations of lead weights) in the middle, and they can rotate counter-rotate around the center spindle. When adjust correctly, the shaker can apply a sinusoidal force in any horizontal direction. 
Let me see if I can explain this intuitively. Think about if you rotate a ball with string, you need pull the string with a force to make sure the ball is not moving away. Now think at the same time, you rotate another ball but in the opposite direction, you need pull the two balls with two horizontal forces. And the net effect is the vector sum of the two forces pointing to some direction, we call it resultant force. If we adjust the rotation rate of the rotating two balls, we will have the resultant force pointing to the same direction, but the force will change from large to small, and then from small to large in the exactly opposite direction (180 degree), the so called sinusoidal force. 
Figure 3
The following figure shows the time changing of the amplitude of the resultant force. 
Figure 4
We know that, building has its own natural frequency (it is one of the most important properties of the building), which will oscillate when apply a force, and it will have much larger movement when the frequency of the applied force is similar to the natural frequency. See the following animation, when moving with different frequencies, the movement of the different color ball is different (the length of the stick defines the natural frequency).
Figure 5
Therefore, if we adjust the sinusoidal force with the frequency similar to the natural frequency of the building, the building will start to vibrate. But don't worry, the maximum of the shaking is about 1 mm on the top of the building, which means, a lot of people actually may not feel the movement of the building. 

Of course, this shaker can also apply a twist on the building, just adjust the rotation of the two blocks, but this is beyond the simple explaination of this blog, see more information in the references. 

The purpose of the test

The purpose of the test is to identify the natural frequency of the building in different directions, therefore, you can keep a time history of the changes of it. It can be a health state indicator of the building, for example, if after an earthquake, there're some damages to the building, you will see a large change of the natural frequency. See the details in the references. 

Acknowledgement

We thank Professor Monica Kohler, Professor Thomas Heaton, Lucy Yin, and Anthony Massari for the opportunity and help with the tests. Figures except the shaker are all from online resources, I thank the authors as well.

References

Sunday, September 25, 2016

Using datashader to visualize billions of data points

Visualization is the best way to explore and communicate insights about data. But many times, we find it is difficult to visualize if we have a lot of data points, the traditional visualization techniques break down. datashader is a tool developed by Continuum Analytics come to rescue. It is extremly easy and fast to use it to plot even billions of data points (see the examples or a video from Scipy 2016). 
This week, we will use datashader to plot the global seismicity for earthquakes larger than M2.0. To speed up the process, I downloaded the earthquake locations/times from the ANSS Catalog from 1898 to 2016, and save them as a csv file in the data folder (You can also grab the data directly using the APIs from my previous blog post). All together, we only have 1120244 earthquakes
And with a couple of lines, you can see we get a very nice looking map with the global seismicity. You can find the script and data at Qingkai's Github.
import pandas as pd
import datashader as ds
import datashader.transfer_functions as tf
from functools import partial
from datashader.utils import export_image
from datashader.colors import colormap_select, Greys9, Hot, viridis, inferno
# read in the earthquake data from file, note that I only read
# in 5 columns with Origin time, Latitude, Longitude, Depth, and
# Magnitude of the earthquakes
df_eq = pd.read_csv('./data/catalog.csv', usecols=[0,1,2,3,4])
# now let's plot them using a black background
background = "black"
export = partial(export_image, background = background)
cm = partial(colormap_select, reverse=(background!="black"))

cvs = ds.Canvas(plot_width=1600, plot_height=1000)
agg = cvs.points(df_eq, 'Longitude', 'Latitude')
export(tf.interpolate(agg, cmap = cm(Hot,0.2), how='eq_hist'),"global_seismicity")

Wednesday, June 29, 2016

Using folium - 6: Layer control (Turn on/off intensity overlay)

In this blog, let's build on the blog from last week that we add a layer control to turn on/off the intensity layer we overlay on the map. All we need is to add two lines to have this control. You can find the script at Qingkai's Github.

In [1]:
import folium
from folium import plugins
from scipy.ndimage import imread
In [2]:
# boundary of the image on the map
min_lon = -123.5617
max_lon = -121.0617
min_lat = 37.382166
max_lat = 39.048834

# create the map
map_ = folium.Map(location=[38.2, -122],
                  tiles='Stamen Terrain', zoom_start = 8)

# read in png file to numpy array
data = imread('./ii_overlay.png')

Intensity = plugins.ImageOverlay(data, opacity=0.8, \
        bounds =[[min_lat, min_lon], [max_lat, max_lon]],\
        attr = 'Shaking Intensity')

# add a name to the layer
Intensity.layer_name = 'Shaking Intensity'

# Overlay the image
map_.add_children(Intensity)

# add the layer control
folium.LayerControl().add_to(map_)

map_
Out[2]: