MCE flat-file format

From MCEWiki
Revision as of 11:53, 19 March 2008 by 24.84.194.46 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This document describes one of MAS/MCE's output file formats. The "DAS flat-file" format is closely related to the form that frame data have when they arrive at the PC from the MCE. This format has many weaknesses as far as end users are concerned. Only flat-files with "header version 6" are described here.

The data consist of any number of "frames". In a given flat-file, all frames should have the same size. The frame size can be determined from the first 28 bytes of the file. No MCE flat-file will be shorter than 28 bytes.

The natural data unit of MCE data is the 32-bit unsigned integer. We refer to 32-bit integers as "words". All offsets are expressed in terms of words, and should be multiplied by 4 to get the byte offset.

An MCE/DAS frame, up to and including header version 6, consists of the following:

  • 43 words of header information
  • 8*R*N words of data, where N is the number of readout cards reporting and R is the number of rows reporting.
  • 1 word of checksum information

Frame header

The variety of frame headers is described in the document "MCE File Formats", version 3.3. This document is out of date in many ways, but the descriptions of the frame headers up to version 6 should be accurate.

http://www.phas.ubc.ca/%7Emce/mcedocs/index.html


The contents of the header are as follows: (some esoteric fields are omitted; absent offsets are not necessarily unused)

Offset Name Category Detail
0 Frame status bits Status/Structure described below
1 CC frame counter Status internal counter, starts at the value of "cc ret_dat_s" and increments by 1 for each output frame.
2 row_len Timing Dwell time of the multiplexer on each row, in units of 1/50 MHz
3 num_rows_reported Structure Number of rows in each column that are reported in each output frame.
4 data_rate Timing Number of internal frames that MCE processes before outputting one to the user.
6 header version Structure 6, the number "six". Subject to change in future header versions.
7 ramp value Status Current value of the internal ramping parameter
8 ramp address Status Card and parameter address of the internal ramping parameter (bits [31-16] are card_addr, bits [15-0] are param_id)
9 num_rows Timing Number of rows that the MCE is servoing
10 Sync box number Status Synchronization number, originating at the sync box, that is used to synchronize data from multiple MCEs and the housekeeping system
11 run_id Status Contents of "cc run_id", typically the ctime (unix time) associated with the acquisition.
12 user_word Status Contents of "cc user_word", which the user may use to store other significant information.