RFM File Formats

Output Spectral File Format

29SEP05

Description
Generic format of all RFM spectral output files.

Structure
ASCII files
!HEADER1
!HEADER2
!HEADER3
NPTSPC LOWSPC RESSPC UPPSPC LABSPC
SPC(1) SPC(2)
... SPC(NPTSPC)
[eof]
Binary files (BIN Flag)
!HEADER1
!HEADER2
!HEADER3
NPTSPC LOWSPC RESSPC UPPSPC LABSPC
NPTREC(1) SPC(1) ... SPC(NPTREC(1))
NPTREC(2) SPC(NPTREC(1)+1) ... SPC(NPTREC(1)+NPTREC(2))
...
NPTREC(n) SPC(NPTSPC-NPTREC(n)+1) ... SPC(NPTSPC)
[eof]

Fields
FieldTypeDescriptionVariations
!HEADER1 C*80 Spectrum type, ray-path and RFM version ID
!HEADER2 C*80 Text read from *HDR section of Driver Table
!HEADER3 C*80 Captions for next record JAC Flag: Jacobian info
NPTSPC I No. spectral points in file
LOWSPC R*8 Lower limit [cm-1] of spectrum GHZ Flag: [GHz]
RESSPC R*8 Resolution [cm-1] of spectrum GHZ Flag: [GHz]
UPPSPC R*8 Upper limit [cm-1] of spectrum GHZ Flag: [GHz]
LABSPC C*(*) Spectral Label or (if no label) Type
NPTREC I No.spectral points in record BIN Flag only
SPC R*4 Spectral Data DBL Flag: R*8
Notes
  1. If no spectral range label is supplied in the *SPC section, then the type of spectrum is inserted in LABSPC (eg 'Absorption')
  2. The RFM works in units of 1cm-1 at a time, a new output record is written after each. Most of these records will contain a fixed number of points determined by RESSPC, however the first and last intervals may contain fewer (determined by LOWSPC,UPPSPC in relation to wavenumber boundaries).
  3. Since the number of data points within a record isn't fixed, this can create problems when reading the binary output. For this reason, the first field in each binary record is NPTREC: the number of spectral points that follow in the record.
  4. An IDL procedure rfmrd.pro is available for reading both ASCII and binary output files.
  5. See below for FORTRAN code for reading binary files
Suggested FORTRAN code for reading RFM binary files
      INTEGER          I, J, N, NPTS
      REAL             X(MAXARR)         ! Or DOUBLE PRECISION for DBL flag
      DOUBLE PRECISION WNO1, WNOD
      CHARACTER*80     RECORD
C
      OPEN ( UNIT=LUN, FILE=FILNAM, STATUS='OLD', FORM='UNFORMATTED' )
C
      READ ( LUN ) RECORD                ! Skip 3 header records
      READ ( LUN ) RECORD
      READ ( LUN ) RECORD
C
      READ ( LUN ) NPTS, WNO1, WNOD      ! No.pts, 1st Wno, Wno increment
C
      J = 0                              ! J=number of points read so far
      DO WHILE ( J .LT. NPTS )
        READ ( LUN ) N, ( X(I), I = J+1, J+N )   
        J = J + N
      END DO
C