Type 3 rmf file format:

item  size (# bytes)            comment
----  --------------            ---------------------------

 1:   1                         ; version ID

 2:   2                         ; ngg: number of gates 
                                  in rmf file

 3:   4                         ; Gain: individual tube 
                                  compression factor

 4:   EMAX*(NANG+1)*4           ; gg: gate lookup tables 
                                  for each angle
                                  EMAX and NANG, defined in 
                                  rebel.h

 5:   MAXGATE*4                 ; offset values for the 2D's
                                  MAXGATE defined in rebel.h

 6:   NANG*ngg*(ngg-1)/2*LEN*4  ; SD2 spectra

 7:   NANG*ngg*LEN*4            ; SD1 spectra

 8:   NANG*LEN*4                ; SD0 spectra

 9:   NANG*ngg*(ngg-1)/2*
      MLEN*MLEN*4               ; 2D Matrices. One for each 
                                  tube combination
                                  and each angle.
The capitalized constants are define in rebel.h. As of version 1.17 this file looked like as:

#define LEN 5632
#define MLEN 32
#define NANG 17
#define EMAX 16384
#define MAXCH EMAX-1

#define VERSION_ID 3
.
.