Data File Format for RMN files

One-Dimensional Data Format

The data structure for both time and frequency one-dimensional data starts with a header that contains the following information:

Size in Bytes
Format
Content
0001 Byte Version number - currently that number is 2
0004 long integer Npts: Number of complex points in file - i.e. half the number of real points
0008 short double Dwell time in seconds
0008 short double Initial time
0008 short double Spectrometer frequency in MHz
0008 short double Offset frequency from carrier for referencing
0512 char 512 Bytes (characters) for comments

The one-dimensional data follows in the following format. For time domain data there are Npts complex points saved. For frequency domain data there are Npts+1 complex points saved. The last (Npts+1)th point is (aliased) the same as the first point.

Size in Bytes
Format
Content
0004 float 1st real data point
0004 float 1st imag data point
0004 float 2nd real data point
0004 float 2nd imag data point
.
.
.
0004 float (Npts+1)th real data point
0004 float (Npts+1)th imag data point

Two-Dimensional Data Format

The data structure for all two-dimensional data sets starts with a header that contains the following information:

Size in Bytes
Format
Content
0001 Byte Version number - currently that number is 4
0004 long integer Npt2: Number of points in 2nd (i.e., t2, w2, or horizontal) dimension
0008 short double Dwell time in 2nd (i.e., t2, w2, or horizontal) dimension
0008 short double Initial time in 2nd (i.e., t2, w2, or horizontal) dimension - pretty much a useless parameter, leftover from the old days
0008 short double Spectrometer frequency in MHz in 2nd (i.e., t2, w2, or horizontal) dimension
0008 short double Offset frequency from carrier for referencing in 2nd (i.e., t2, w2, or horizontal) dimension
0004 long integer Npt1: Number of points in 1st (i.e., t1, w1, or vertical) dimension
0008 short double Dwell time in 1st (i.e., t1, w1, or vertical) dimension
0008 short double Initial time in 1st (i.e., t1, w1, or vertical) dimension - pretty much a useless parameter, leftover from the old days
0008 short double Spectrometer frequency in MHz in 1st (i.e., t1, w1, or vertical) dimension
0008 short double Offset frequency from carrier for referencing in 1st (i.e., t1, w1, or vertical) dimension
0512 char 512 Bytes (characters) for comments

The data follows in the following format. Starting with the first cross-section in the 1st (i.e., t1, w1, or vertical) dimension, alternating real, imaginary data points in the 2nd (i.e., t2, w2, or horizontal) dimension are saved. There are Npt2+1 complex points saved in each cross-section. The last point is (aliased) identical to the first point in the cross-section. This is true for both time and frequency domain data. Although RMN saves and expects to read in an aliased point for both time and frequency domain data, it does not use that point internally for time data.

First comes the first cross-section in the 1st (i.e., t1, w1, or vertical) dimension

0004 float 1st real data point in 2nd (t2, w2, or horizontal) dimension (1st cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 1st imag data point in 2nd (t2, w2, or horizontal) dimension (1st cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd real data point in 2nd (t2, w2, or horizontal) dimension (1st cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd imag data point in 2nd (t2, w2, or horizontal) dimension (1st cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
.
.
.
0004 float (Npt2 +1)th real data point in 2nd (t2, w2, or horizontal) dimension (1st cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float (Npt2 +1)th imag data point in 2nd (t2, w2, or horizontal) dimension (1st cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
.
.
.
Then comes the second cross-section in the 1st (i.e., t1, w1, or vertical) dimension
0004 float 1st real data point in 2nd (t2, w2, or horizontal) dimension (2nd cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 1st imag data point in 2nd (t2, w2, or horizontal) dimension (2nd cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd real data point in 2nd (t2, w2, or horizontal) dimension (2nd cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd imag data point in 2nd (t2, w2, or horizontal) dimension (2nd cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
.
.
.
0004 float (Npt2 +1)th real data point in 2nd (t2, w2, or horizontal) dimension (2nd cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float (Npt2 +1)th imag data point in 2nd (t2, w2, or horizontal) dimension (2nd cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
.
.
.
This continues to the (Npt1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension
.
.
.
0004 float 1st real data point in 2nd (t2, w2, or horizontal) dimension ((Npt1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 1st imag data point in 2nd (t2, w2, or horizontal) dimension ((Npt1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd real data point in 2nd (t2, w2, or horizontal) dimension ((Npt1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd imag data point in 2nd (t2, w2, or horizontal) dimension ((Npt1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
.
.
.
0004 float (Npt2 +1)th real data point in 2nd (t2, w2, or horizontal) dimension ((Npt1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float (Npt2 +1)th imag data point in 2nd (t2, w2, or horizontal) dimension ((Npt1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
.
.
.
And concludes with the (Npt1+1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension. This cross section, however, is (aliased) identical to the 1st cross-section in the 1st (i.e., t1, w1, or vertical) dimension.
.
.
.
0004 float 1st real data point in 2nd (t2, w2, or horizontal) dimension ((Npt1+1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 1st imag data point in 2nd (t2, w2, or horizontal) dimension ((Npt1+1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd real data point in 2nd (t2, w2, or horizontal) dimension ((Npt1+1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float 2nd imag data point in 2nd (t2, w2, or horizontal) dimension ((Npt1+1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
.
.
.
0004 float (Npt2 +1)th real data point in 2nd (t2, w2, or horizontal) dimension ((Npt1+1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)
0004 float (Npt2 +1)th imag data point in 2nd (t2, w2, or horizontal) dimension ((Npt1+1)th cross-section in the 1st (i.e., t1, w1, or vertical) dimension)

I realize that this may seem like a complicated way to save 2D data. This is the way in which I keep the data internally in the 2D data array in RMN. So, it is a simple task for me to save and read the data straight from and back into the internal array. Again, the reason for all of this was to have a way to always display the correct number of points depending on whether frequency or time domain data was displayed. Remember that frequency data must have an odd number of points (if zero is to remain at the center of the spectrum), and that time domain data must have an even (or more specifically 2n points where n is an integer) number of points.


Notes to Macintosh Programmers

The program signature is MRMN.

For 1D with time domain data the file type is TIME.

For 1D with frequency domain data the file type is FREQ.

For 2D with time domain data in both dimensions the file type is 2DTT.

For 2D with the time domain data in the 2nd (horizontal) dimension and frequency domain data in the 1st (vertical) dimension the file type is 2DTF.

For 2D with the frequency domain data in the 2nd (horizontal) dimension and time domain data in the 1st (vertical) dimension the file type is 2DFT.

For 2D with frequency domain data in both dimensions the file type is 2DFF.