Accessing CyberShake Peak Acceleration Data
This page details how to access CyberShake peak acceleration data.
CyberShake peak acceleration data comes in two forms:
- Geometric mean PSA (and X and Y component), at various periods.
- 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.
Contents
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, 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 in [[1]], 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.
RotD data
RotD data files begin with a header, specified in CyberShake_output_data_headers#RotD_header, 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.
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>