Difference between revisions of "CyberShake output data formats"
(Created page with "As of 2016, CyberShake runs output up to 4 different data files: seismograms, peak spectral accelerations, rotD values, and duration metrics. All 4 file formats share the sa...") |
|||
Line 30: | Line 30: | ||
*det_max_freq: A float with the maximum frequency of the deterministic results in this seismogram. | *det_max_freq: A float with the maximum frequency of the deterministic results in this seismogram. | ||
*stoch_max_freq: A float with the maximum frequency of the stochastic results. Stochastic results are assumed to run from det_max_freq to stoch_max_freq. If there is no stochastic data, stoch_max_freq = -1. | *stoch_max_freq: A float with the maximum frequency of the stochastic results. Stochastic results are assumed to run from det_max_freq to stoch_max_freq. If there is no stochastic data, stoch_max_freq = -1. | ||
+ | |||
+ | This header is 56 bytes long. | ||
== Seismogram files == | == Seismogram files == | ||
− | CyberShake produces one seismogram file per rupture. The | + | CyberShake produces one binary seismogram file per rupture. The file format is: |
+ | |||
+ | <RV 1 header> | ||
+ | <RV 1, comp 1 seismogram> | ||
+ | ... | ||
+ | <RV 1, comp c seismogram> | ||
+ | <RV 2 header> | ||
+ | <RV 2, comp 1 seismogram> | ||
+ | ... | ||
+ | <RV 2, comp c seismogram> | ||
+ | ... | ||
+ | <RV n header> | ||
+ | <RV n, comp 1 seismogram> | ||
+ | ... | ||
+ | <RV n, comp c seismogram> | ||
+ | |||
+ | Note that the rupture variations are NOT required to be in numerical order. You should parse them rather than assuming any particular order. | ||
+ | |||
+ | The rupture variation data is sizeof(float) x nt bytes long for each component. So for a seismogram which contains 2 components and 3000 timesteps, the entry for each rupture variation is 56 bytes (header) + 4 (bytes/float) x 3000 (timesteps) x 2 (components) = 24056 bytes. | ||
+ | |||
+ | == Peak Spectral Acceleration (PSA) files == | ||
+ | |||
+ | The file format for the PSA files is the same as the seismogram files: | ||
+ | |||
+ | <RV 1 header> | ||
+ | <RV 1, comp 1 PSA> | ||
+ | ... | ||
+ | <RV 1, comp c PSA> | ||
+ | <RV 2 header> | ||
+ | <RV 2, comp 1 PSA> | ||
+ | ... | ||
+ | <RV 2, comp c PSA> | ||
+ | ... | ||
+ | <RV n header> | ||
+ | <RV n, comp 1 PSA> | ||
+ | ... | ||
+ | <RV n, comp c PSA> | ||
+ | |||
+ | There is data for 44 periods represented in a PSA file; the periods are in the following order: | ||
+ | 10 sec, 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.111, 1.0, .6667, .5, .4, .3333, .285714, .25, .2222, .2, .1667, .142857, .125, .111, .1 |
Revision as of 16:40, 17 May 2016
As of 2016, CyberShake runs output up to 4 different data files: seismograms, peak spectral accelerations, rotD values, and duration metrics.
All 4 file formats share the same header format.
Common header
All 4 formats use a common header. This header is used once for each rupture variation in a file. It's defined in C syntax below:
char version[8]; char site_name[8]; char padding[8]; int source_id; int rupture_id; int rup_var_id; float dt; int nt; int comps; float det_max_freq; float stoch_max_freq;
- version: An 8-character string representing the version of the header. 12.10 is the current (and only so far) version.
- site_name: An 8-character string representing the short name of the CyberShake site; good for checking the right
- padding: 8 bytes of padding, saved in case we have a need for them later. They're here instead of at the end of the header because Fortran (used in the PSA code) likes structures with decreasing-size elements.
- source_id: The source ID of this rupture from the ERF.
- rupture_id: The rupture ID of this rupture from the ERF.
- rup_var_id: The rupture variation ID of the rupture variation whose data follows this header.
- dt: The timestep size used in producing the seismogram data
- nt: The number of timesteps in the seismogram
- comps: A flag which indicates which components are represented in the file. X_COMP = 1, Y_COMP = 2, Z_COMP = 4, then the values are ANDed.
- det_max_freq: A float with the maximum frequency of the deterministic results in this seismogram.
- stoch_max_freq: A float with the maximum frequency of the stochastic results. Stochastic results are assumed to run from det_max_freq to stoch_max_freq. If there is no stochastic data, stoch_max_freq = -1.
This header is 56 bytes long.
Seismogram files
CyberShake produces one binary seismogram file per rupture. The file format is:
<RV 1 header> <RV 1, comp 1 seismogram> ... <RV 1, comp c seismogram> <RV 2 header> <RV 2, comp 1 seismogram> ... <RV 2, comp c seismogram> ... <RV n header> <RV n, comp 1 seismogram> ... <RV n, comp c seismogram>
Note that the rupture variations are NOT required to be in numerical order. You should parse them rather than assuming any particular order.
The rupture variation data is sizeof(float) x nt bytes long for each component. So for a seismogram which contains 2 components and 3000 timesteps, the entry for each rupture variation is 56 bytes (header) + 4 (bytes/float) x 3000 (timesteps) x 2 (components) = 24056 bytes.
Peak Spectral Acceleration (PSA) files
The file format for the PSA files is the same as the seismogram files:
<RV 1 header> <RV 1, comp 1 PSA> ... <RV 1, comp c PSA> <RV 2 header> <RV 2, comp 1 PSA> ... <RV 2, comp c PSA> ... <RV n header> <RV n, comp 1 PSA> ... <RV n, comp c PSA>
There is data for 44 periods represented in a PSA file; the periods are in the following order: 10 sec, 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.111, 1.0, .6667, .5, .4, .3333, .285714, .25, .2222, .2, .1667, .142857, .125, .111, .1