Spectral File Format

RFM File Formats

30DEC23

Description
Generic format of RFM spectral output files.

Structure
There are two formats, depending on whether the output is on a regular spectral grid on an irregular grid. In the first case the spectral axis can be represented by three numbers in the header, in the second case each data point requires its own associate spectral axis value. The header sections are identical for both formats, the difference being the wavenumber increment (WNOD) being set to zero for the irregular grid.
File Structure
Header Section
!HEADER1 Single record
!HEADER2 Single record
!HEADER3 Single record
NSPC     WNO1     WNOD     WNO2     LABSPC Single record
Data Section (Regular Grid)
SPC(1) SPC(2) ... Multiple records
... SPC(NSPC)
Data Section (Irregular Grid)
WNO(1) SPC(1) NSPC records
WNO(2) SPC(2)
...
WNO(NSPC) SPC(NSPC)

Fields
FieldTypeDescription Units Range
!HEADER1 C80 Spectrum type, ray-path and RFM version ID
!HEADER2 C80 Text from *HDR section of Driver Table
!HEADER3 C80 Captions for next record, or additional info.
NPNT I No. spectral points in file[2] | NPNT | ≥ 1
WNO1 D Lower limit [cm-1] of spectrum GHZ Flag: [GHz]
WNOD D Resolution [cm-1] of spectrum GHZ Flag: [GHz], 0 if irregular grid
WNO2 D Upper limit [cm-1] of spectrum GHZ Flag: [GHz]
LABSPC C* Spectral Label or (if no label) Type See Note 3.
WNO D Wavenumber [cm-1] of spectral point GHZ Flag: [GHz]
SPC R Spectral data value DBL Flag: Double precision
Type: I=Integer; R=Real; D=Double Precision; Cn=character string, length n.
Notes
  1. Reg/Irreg file headers are the same, the regular grid has WNOD > 0 while the irregular grid as WNOD=0

  2. NPNT: a negative value indicates that the spectral axis is GHz (set by GHZ Flag) rather than cm-1.

  3. If no spectral range label is supplied in the *SPC section, then the type of spectrum is inserted in LABSPC (eg 'Absorption')
  4. The RFM outputs the complete spectrum in one WRITE statement. For binary files this will be a single record of NPNT values
  5. An IDL procedure rfmrd.pro is available for reading all the various forms of RFM output files.
  6. Two separate Python modules are availabe for reading either ASCII (text) spectra, rfmrd.py, or binary files rfmrd_bin.py.

Example
Below is an example of a spectral file used to establish the irregular grid, either for RFM output (*SPC section) or for internal calculation (*GRD section). In this case, only the wavenumber points are read so it is not necessary to specify any 'data' values. The header has to contain the number of points (326 in this example), the lowest (1st) point (1400.0), the increment (set to 0.0 for irregular grid) and the highest (326th) point (1410.0), followed by the spectral points themselves, one value per record.
! Basic irregular grid
! Npts, WNO1, WNOD, WNO2
326 1400.0000 0.0000 1410.0000
1400.0000
1400.0810
...
1410.0000