Event analysis (Meloland)
This notebook uses the quakeio
Python package to parse and process a suite of ground motion files.
import numpy as np
import quakeio
import quakeio.processing as spec
The following file contains a collection of ground motions in the CSMIP Volume 2 format from the 1979 Imperial Valley earthquake (obtained from www.strongmotioncenter.org).
= "../dat/imperialvalley79_ce01336p.zip" file_name
The signature of the function quakeio.read
is as follows:
def read(filename: str, format: str = None, **parser_options): ...
where format
is a string indicating the file format (see tool documentation for available formats). In this case the format
argument can be ommited because the CSMIP archive parser is the default parser for files with a .zip
extension.
= quakeio.read(file_name, exclusions=["filter*"]) collection
The variable collection
now holds a QuakeCollection
. Once the collection has been parsed, individual components can be extracted using the .at
method of QuakeCollection
= collection.at(file_name="chan02.v2".upper()) component
Acceleration Spectra
=[0.0, 0.01, 0.05]).plot(); spec.Spectrum(component, damping