Accelaration Record (ac) File

File Format

An ac file is a ASCII text file with an extension ".ac" and its lines are separated by CRLF. One ac file can include more than one channel records obtained in a strong motion instrument.
The first line contains following information.
  • Columns 1 to 10 : Date (yyyy/mm/dd) of the record.
  • Columns 12 to 19: Time (hh/nn/ss) at which the first data was sampled. It may be the local time at the station.
  • Columns 21 to 23: Number of channels included in the file.
  • Columns 25 to 27: Sampling frequency in Herz (samples per second).
  • Columns 29 to 33: Number of data of each channel. All channel have same number of data.
  • Columns 35 to end: Site information. Normal format is "CODE: Description". CODE is the station code and Description is station description. Lengths of CODE and Description are not fixed.
The second line is a channel header for the first channel record.
  • Columns 1 to 10: Left justified label of the channel. It usually consists of an azimuth (or a direction) and a location code delimited by a hyphen "-". The azimuth is a 3-digit number and a clockwise angle in degree from the north. This part can be a character string indicationg a direction. For example, 063-GL means N063°E (63 degrees from the north to the east) at GL and UP-GL indicates a upward component at GL.
  • Columns 11 to 20: Peak value of the channel.
  • Columns 21 to 30: Occurrence step of the peak.
  • Columns 31 to 40: Offset used in the primary data processing.
  • Columns 41 to 50: Calibration coefficient used in the primary data processing.
The third and following lines make a data block. A width of an acceleration data is 10 columns and one line contains 8 values. The format of data corresponds to (8F10.3) in FORTRAN.
A set of a channel header and a data block is repeated for every channel as shown in the following sample.
1993/01/15 20:06:08   3 100 15700 KSR: Kushiro Local Meteorological Observatory, JMA
063-GL      -711.403      3675     0.013   3.00e-2
     0.077    -0.043     0.017     0.017     0.017    -0.043    -0.013     0.017
    -0.013     0.017    -0.013    -0.013     0.047    -0.013     0.017    -0.043
    -0.043    -0.073     0.017    -0.013     0.047    -0.043    -0.013    -0.013
    -0.043    -0.013     0.017    -0.013     0.017    -0.043     0.017     0.047
          .
          . (snipped)
          .
     1.007     0.707     0.797     1.097     0.677    -0.133    -0.403    -0.313
    -0.733    -1.243    -0.943    -0.283
153-GL      -637.240      3617     0.010   3.00e-2
     0.020     0.020    -0.010     0.020     0.020    -0.040    -0.040     0.020
    -0.010    -0.010     0.020     0.020    -0.010    -0.010    -0.010    -0.010
    -0.040    -0.010     0.020    -0.010    -0.040    -0.010    -0.010    -0.040
    -0.010    -0.010    -0.010    -0.010    -0.010     0.020    -0.010    -0.010
          .
          . (snipped)
          .
    -1.210    -1.690    -2.230    -2.260    -1.900    -1.480    -1.090    -0.610
    -0.400    -0.490    -0.370     0.110
UP-GL        363.391      3298    -0.030   3.00e-2
     0.060     0.000     0.000    -0.030     0.030     0.000    -0.030     0.060
     0.030    -0.030    -0.060     0.060     0.060     0.030     0.000    -0.030
    -0.060     0.000     0.030    -0.030    -0.030     0.000     0.030     0.060
     0.030    -0.030    -0.060    -0.060     0.030     0.030     0.000    -0.030
          .
          . (snipped)
          .
    -0.600    -0.780    -0.420     0.450     0.960     0.600    -0.210    -0.840
    -0.990    -0.810    -0.810    -0.600

Sample program

The following code is a sample program in Fortran 90 to read an ac file. This source code was tested using Compaq Visual Fortran Optimizing Compiler Version 6.6A. Sample program and data is available as a zip file.
real(4), allocatable:: peak(:), acc(:,:)
character(10), allocatable:: comp(:)
integer(4):: nfrq, nstp, nch, ich, istp, i
integer(4):: iostat
real(4):: dt, offset, calib
character(10):: date, time, code
character(128):: site, fname
!
    fname='sample.ac'
    open (88, file=fname, iostat=iostat)
! read file header.
    read (88, '(a10,1x,a8,2i4,i6,a128)') date, time, nch, nfrq, nstp, site
! allocate arrays.
    allocate (comp(nch), peak(nch), acc(nstp,nch))
! read header and acceleration of each channel.
    do ich=1, nch
        read (88, '(a10,f10.3)') comp(ich), peak(ich)
        read (88, '(8f10.3)') (acc(i,ich), i=1,nstp)
    end do
! close a file.
    close (88)
! get some parameters
    dt=1/real(nfrq)
    i=index(site, ':')
    if (i.gt.0) then
        code=site(1:i-1)
        site=site(i+1:)
    else
        code=''
    endif
! output parameters.
    print '(''Acceleration filename: '',a)', trim(fname)
    print '(''             Sitecode: '',a)', trim(code)
    print '(''             Sitename: '',a)', trim(site)
    print '(''Trigger time and date:'',a8,1x,a10)', time, date
    print '(''   Number of channels:'',i6)', nch
    print '(''   Sampling frequency:'',i6,''Hz'')', nfrq
    print '(''       (Time interval:'',f6.3,''sec)'')', dt
    print '(''      Number of steps:'',i6)', nstp
    do ich=1, nch
        print '(''ch:'',i2,'' ('',a,'') peak:'',f8.2)', &
            ich, trim(comp(ich)), peak(ich)
    end do
! release arrays.
    deallocate (peak, comp, acc)
    stop
end

Notes

  • The unit of acceleration recods is cm/s2.
  • Removal of DC offset and conversion to acceleration were only made on original data. Acceleration data is given by Acc = Bin * Coeff - Offset. Bin is a original binary data, Coeff is a conversion coefficient to acceleration, and Offset is a DC offset (average acceleration for first 5 seconds). Values Offset and Coeff are written in the channel header. No other corrections were applied.