Accessing CyberShake Peak Acceleration Data

From SCECpedia
Jump to navigationJump to search

This page details how to access CyberShake peak acceleration data.

CyberShake peak acceleration data comes in two forms:

  1. Geometric mean PSA (and X and Y component), at various periods.
  2. RotD50 and RotD100 PSA, at various periods, starting with Study 15.4.

The databases contain this information for the most commonly used periods.

For geometric PSA, this is 10, 5, 3, and 2 sec, with 1 sec for 1 Hz CyberShake studies, and 0.5, 0.2, and 0.1 sec for stochastic studies.

For RotD, this is 10, 7.5, 5, 4, 3, and 2 sec, with 1 sec for 1 Hz CyberShake studies, and 0.5, 0.2, and 0.1 sec for stochastic studies.

Accessing database data

To access the database PSA information, details are provided here: Accessing CyberShake Database Data.

Accessing file-based data

To access periods which are not in the database, you must read the data in from files on disk.

Using the retrieval script

To help in finding PSA data, there is a Python script, /home/scec-02/cybershk/utils/retrieve_psa.py (and in SVN at https://source.usc.edu/svn/cybershake/import/trunk/Utils/retrieve_psa.py), which takes the run ID, source ID, rupture ID, rupture variation ID, output file, whether you want RotD data or PSA data, and a flag to include the header information in the output. It works similarly to the seismogram retrieval script.

Finding files by hand

If for some reason you need to find acceleration files by hand, you should follow the instructions for finding seismogram files by hand, given here: Accessing_CyberShake_Seismograms#Locating_Seismogram_Files_by_Hand. For PSA files, the filename convention is PeakVals_*.bsa, and *_PSA.zip for zipped files. We didn't start creating RotD files until Study 15.4, so all RotD files are in the 'new' format, and can be found in the /home/scec-04/tera3d/CyberShake/data/PPFiles/<site>/<runID> root.

Reading Peak Acceleration Files

PeakVals data

'New' (Run_ID > 1309) PeakVals files begin with a header, specified here, followed by the data. This data is given as the PSA values as 4-byte floats for 44 periods, first the X component, then the Y component. A PeakVals file may have information for one or more rupture variations. Like the seismogram files, the rupture variations are not necessarily in order, so the headers must be read to find the rupture variations of interest. Overall, the layout is:

<PSA header for 1st rupture variation(RV)>
<Value for X component, 1st period>
<Value for X component, 2nd period>
...
<Value for X component, 44th period>
<Value for Y component, 1st period>
...
<Value for Y component, 44th period>
<PSA header for 2nd RV>
...
<Value for Y component, 44th period, last RV>

The 44 periods can be read out from surfseis_rspectra.f(SCEC login required), in the 'scec' array. They are:

10.0, 9.5, 9.0, 8.5, 8.0, 7.5, 7.0, 6.5, 6.0, 5.5, 5.0, 4.8, 4.6, 4.4, 4.2, 4.0, 3.8, 3.6, 3.4, 3.2, 3.0, 2.8, 2.6, 2.4, 2.2, 2.0, 1.6667, 1.42857, 1.25, 1.1111, 1.0, 0.6667, 0.5, 0.4, 0.3333, 0.285714, 0.25, 0.2222, 0.2, 0.1667, 0.142857, 0.125, 0.1111, 0.1 sec.

'Old' (Run_ID < 1310) PeakVals files are in the same format, but omit the header.

The units are centimeters per second squared.

RotD data

RotD data files begin with a header, specified at this link, followed by a 4-byte integer giving the number of periods, followed by the data. This data is bundled as individual RotD records, which represent RotD results for a given period. These records are specified in C as:

struct rotD_record {
 float period;
 float rotD100;
 int rotD100_angle;
 float rotD50;
};

Each RotD file may have results from 1 or more rupture variations, which are not necessarily sorted by rupture variation ID. The headers must be parsed to find the rupture variations of interest.

The current list of periods we perform RotD calculations for in CyberShake runs can be found in rotd.c; they are 1.0, 1.2, 1.4, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.5, 4.0, 4.4, 5.0, 5.5, 6.0, 6.5, 7.5, 8.5, 10.0. Previously, we omitted the periods from 1.0-1.8 Hz, so you should not assume these are the available periods; you should parse the records.

So the overall format for a RotD file is:

<RotD header for 1st rupture variation(RV)>
<number of periods, P, to follow>
<1st RV, record 1>
<1st RV, record 2>
...
<1st RV, record P>
<RotD header for 2nd RV>
<number of periods P>
<2nd RV, record 1>
...
<2nd RV, record P>
...
<last RV, record P>

Note that the units are g, different from the PeakVals files.

Plotting PSA data

To plot PeakVals data, you can use the script /home/scec-00/cybershk/scripts/plot_N_peakVals.py , which will produce a comparison plot of an arbitrary number of PeakVals files, with X and Y separate.

Note that the PeakVals files MUST have header information to be used in this script.