This page will have a summary of the file formats that we use in the simulations and workflow.
LF/HF/BB binary format
These files store timeseries data. All formats follow a style derived from the LF seis format produced by EMOD3D:
- station size, common metadata
- station list with station metadata
- timeseries
Numbers are 4 bytes in length and may be little or big endian. You can see or use the existing interfaces that also take care of endianness at github:ucgmsim/qcore/qcore/timeseries.py::LFSeis, HFSeis, BBSeis.
File size can be derived knowing the format and the number of stations, and shape of time-series (all necessary values are at the beginning of the file).
The second section is repeated for each station.
The LF format contains unnecessarily repeated common metadata in the station list section (in italics below).
In BB, stations are ordered to match the station input file used in the LF. This means if there was an 'index of station in input file' in BB, it would run incrementally from 0. This is also the case for HF however it is based on the station file given which should therefore be the same (same order of stations) and this is currently a requirement for BB.
HF and BB have gaps between the first 2 sections to allow future additions to section 1 without breaking backwards compatibility.
LF | HF | BB |
---|---|---|
i4 number of stations TOTAL 4 BYTES | i4 number of stations TOTAL 276 BYTES | i4 number of stations TOTAL 788 BYTES |
START OFFSET 4 BYTES i4 index of station in input file TOTAL 48 BYTES * NUM_STATIONS | START OFFSET 512 BYTES f4 longitude of station TOTAL 24 BYTES * NUM_STATIONS | START OFFSET 1280 BYTES f4 longitude of station TOTAL 44 BYETS * NUM_STATIONS |
START OFFSET 0 FROM ABOVE f4 velocity timeseries in array dimensions: TOTAL 4 BYTES * PRODUCT_OF_DIMENTIONS | START OFFSET 0 FROM ABOVE f4 acceleration timeseries in array dimensions: TOTAL 4 BYTES * PRODUCT_OF_DIMENTIONS | START OFFSET 0 FROM ABOVE f4 acceleration timeseries in array dimensions: TOTAL 4 BYTES * PRODUCT_OF_DIMENTIONS |
XYTS.e3d binary format
This file is produced by EMOD3D and contains a timeseries of ground motions on the XY plane. Unlike the LF seis files, this contains data at all grid points and may have a decimated resolution specified when running EMOD3D through the e3d.par file with the parameters dxts and dyts.
Numbers are 4 bytes in length and may be little or big endian. You can see or use the existing interfaces that also take care of endianness at github:ucgmsim/qcore/qcore/xyts.py::XYTSFile.
File size can be derived knowing the format and the shape of time-series (all necessary values are at the beginning of the file).
The gridpoints are based on a model which is an area with equidistant gridpoints in the X, Y, and Z directions. It is centred on a position (longitude, latitude) and may be rotated.
- simulation metadata
- INTEGERS
- number of first x gridpoint
- number of first y gridpoint
- number of first z gridpoint
- number of first timestep
- number of x gridpoints
- number of y gridpoints
- number of z gridpoins (always 1 by definition of X-Y file)
- number of timesteps
- FLOATS
- x spacing between given gridpoints (km)
- y spacing between given gridpoints (km)
- original (pre-decimated) grid spacing between gridpoints used in simulation (km)
- timestep in timeseries (s)
- model rotation of gridpoints (degrees)
- model centre latitude (degrees)
- model centre longitude (degrees)
- x spacing between given gridpoints (km)
- INTEGERS
- timeseries
- float array of velocities in the dimentions of timesteps, components (x, y, z), y grid positions, x grid positions.
Intensity Measure calculation
The IM calculation code will produce a number of text files (decided as of 25/05/2018). We will summarize them in the following.
Intensity measure files
There are two types of IM files: per station and aggregate. The per station one has the following format:
component, IM_1, IM_2, ...., IM_N
Note: The per station file does not have the station name, as it is the file name.
The aggregate one has all the stations on a single place:
station, component, IM_1, IM_2, ...., IM_N
Rrup file
The file format for this is:
station, lat, lon, rrup, rjbs, rx
Note: we don't have rx calculations yet, so we may dump an invalid value just to conform with the format.
Metadata file
So far the requirements indicate that we need:
identifier, rupture, type, date