PSI_FORMAT.TXT D. Maden. 1-Jun-1994 ============== 0. Modification History -------------------- 22-Dec-1988. DM. Initial version. FMT_ID = "1A". 17-Mar-1989. DM. FMT_ID = "1B". Introduce "BLOCKSIZE = 2048" in OPEN statement to avoid problems writing data files to magnetic tape. 20-Mar-1989. DM. FMT_ID = "1C". Include NT0, NTINI and NTFIN 3-Jul-1989. DM. FMT_ID = "1E". Include SCALA and HISLA. LENHIS > 8k permitted. 29-Nov-1989. DM. FMT_ID = "1F". Remove NDPM (obsolete temperature monitor) Add MONDEV, TEMPER, TEMDEV. Change DPMPER to MONPER. 5-Jul-1990. DM. FMT_ID = "1G". Include experiment setup in header. The disk save period, DKSPER, is set correctly. 2-Jul-1991. DM. FMT_ID = "1H". Rigs and Modes introduced. Put Data Acq Mode into SETUP instead of group name. 11-Sep-1991. DM. Add reservation regarding FMT_ID = "Rx". 19-Nov-1991. DM. FMT_ID = "1I". Monitor limits changed to reals. 4-May-1993. DM. FMT_ID = "1J". BINWIX and REANT0(0:16) documented; I4SCAL(6) becomes I4SCAL_A(6); SCALA(24) becomes SCALA_A(24); I4SCAL_B(12) introduced; SCALA_B(48) introduced. 27-May-1993. DM. FMT_ID = "1K". PATCH documented. The ID at which this was introduced is not known. 4-Aug-1993. DM. FMT_ID = "1L". Files with Ident 1K had the I4SCAL_A scalers written in Real*4 format rather than Int*4. Files with Ident set to 1L are 1K files which have had these Real*4 values patched to Int*4. For scaler contents over 24 bits (16'777'215), a loss of precision will have occurred. 4-Aug-1993. DM. FMT_ID = "1M". Same as 1K (without the Real*4 format bug for the I4SCAL_A scalers). 1-Jun-1994. DM. FMT_ID = "1N". Up to 4 Hist Mem modules possible. NHM split into bytes NHM_A(2) and NHM_B(2) introduced. 1. Introduction ------------ The format of Data files produced by the muSR deltaT on-line microVAX system, is described in this note. The data file format is essentially compatible with that produced by the earlier PDP-11 system used at PSI. For differences in format, see the section on "Compatibility", below. 2. Overall Format -------------- Data Files are created by the on-line program, DARC, which is written in FORTRAN. The critical parameters in the OPEN statement which creates a data file are: form = 'unformatted', recordtype = 'segmented', blocksize = 2048 In early versions of the data archiving program, the blocksize parameter was omitted and a complete histogram was written as a single record. The resulting files could not be copied to magnetic tape if they contained histograms bigger than 8k. To read a data file from a Fortran program, the only critical parameter to be specified in the "Open" statement is:- form = 'unformatted' The file may then be read with unformatted read statements specifying arrays of the correct size. The records are as follows:- +------------------------------------------+ | Info-record (Length = 1024 bytes) | +------------------------------------------+ See Section 3 for a definition of the Info-record. It contains the values used in the following description. Number of histograms = NUMHIS. Number of bins per histogram = LENHIS. Number of records per histogram = KDAFHI. Number of bytes in each record = LENDAF * 4 (i.e. LENDAF bins). The last record for each histogram is padded, if necessary, with zero bytes so that the record length is (LENDAF * 4) (see also the note on LENDAF under "Compatibility"). LENDAF is never greater than 4096. The records for a histogram are therefore as follows: +------------------------------------------+ | Histogram n, Record 1 | | Bins 0 to (LENDAF - 1) | | Length = LENDAF * 4 bytes | +------------------------------------------+ +------------------------------------------+ | Histogram n, Record 2 | | Bins LENDAF to (2 * LENDAF - 1) | | Length = LENDAF * 4 bytes | +------------------------------------------+ . . +------------------------------------------+ | Histogram n, Record KDAFHI | | Bins (LENDAF * (KDAFHI - 1) to LENHIS | | Zero bytes are added if necessary so | | that record length = LENDAF * 4 bytes | +------------------------------------------+ 3. The Info Record The Info-record contains information on the run for --------------- which the histograms have been compiled. It is based on the earlier PDP-11 system, hence its ad-hoc nature. +------------+----+------+----------------------------------------------------+ | Name(Dim) |Type| Byte | Description | | | |Offset| | +------------+----+------+----------------------------------------------------+ |FMT_ID(2) |L*1 | 0 |Flag identifying file format (= "1M"). See Note 5.1.| |KDTRES |I*2 | 2 |TDC time resolution code (0 - 15) if BINWIX is zero.| |KDOFTI |I*2 | 4 |TDC time overflow setting. The overflow occurs at | | | | | (KDOFTI + 0.5) * 160 nsec. | |NRUN |I*2 | 6 |Run Number. | |PATCH(16) |L*1 | 8 |NIM/ECL patch routing for the counter telescopes | |LENHIS |I*2 | 28 |Length of a histogram (in bins). | |NUMHIS |I*2 | 30 |Number of histogram(s) in use (maximum = 16). | |NHM_B(2) |L*1 | 46 |CAMAC station of 3rd and 4th histogram memories. | |IBR |I*2 | 48 |CAMAC branch. | |ICR |I*2 | 50 |CAMAC crate. | |NTD |I*2 | 52 |Left hand CAMAC station of TDC. | |NHM_A(2) |L*1 | 54 |CAMAC station of 1st and 2nd histogram memories | | | | | (left hand station if LRS type histogram memory). | |HMTYPE(3) |L*1 | 56 |Type of histogram memory ("CES" or "LRS") | |MONDEV(12) |L*1 | 60 |Type of temperature monitor (e.g. "KEITH_1992") | |MON_LO(4) |R*4 | 72 |"Temperature" lower limits. | |MON_HI(4) |R*4 | 88 |"Temperature" upper limits. | |MON_LST(4) |R*4 | 104 |Last "temperature" values read. | |NUMDAF |I*2 | 128 |Number of hist data records in file (NUMHIS*KDAFHI).| |LENDAF |I*2 | 130 |Length (in bins) of a hist data record ( < 4097). | |KDAFHI |I*2 | 132 |Number of histogram data records per histogram. | |KHIDAF |I*2 | 134 |Number of histograms per histogram record. For | | | | | microVAX files, KHIDAF = 1. | |TITLE(40) |L*1 | 138 |4*10 ASCII characters for Target/Temp./Field/Orient.| |SETUP(10) |L*1 | 178 |Selected data acq mode (10 ASCII characters ). | |DATE1(9) |L*1 | 218 |Date of run start (DD-MMM-YY). | |DATE2(9) |L*1 | 227 |Date this file was written (DD-MMM-YY). | |TIME1(8) |L*1 | 236 |Time of run start (HH:MM:SS) | |TIME2(8) |L*1 | 244 |Time this file was written (HH:MM:SS). | |CNTOLD(16) |I*4 | 296 |Number of events in each histogram. | |I4SCAL_B(12)|I*4 | 360 |Contents of scalers 7 to 18 (including overflows). | |TOTOLD |I*4 | 424 |Total number of events in the histograms. | |NT0(16) |I*2 | 458 |Zero time bin for each histogram. | |NTINI(16) |I*2 | 490 |First good bin for each histogram. | |NTFIN(16) |I*2 | 522 |Last good bin for each histogram. | |SCALA_B(48) |L*1 | 554 |Labels for scalers 7 to 18, 4 characters each. | |SCTYPE(5) |L*1 | 642 |Type of singles' scaler ("S500 " or "S500A"). | |IFTYPE |I*2 | 648 |Type of CAMAC Interface (6 = SCI-2280, 9 = CCP). | |NIVG |I*2 | 650 |Station number of camac interface. | |DKSPER |R*4 | 654 |Period between disk saves during data acquisition. | |MONPER |R*4 | 658 |Period between temperature monitor activations (was | | | | | called DPMPER prior to FMT_ID = "1F"). | |I4SCAL_A(6) |I*4 | 670 |Contents of scalers 1 to 6 (including overflows). | |NSC(3) |I*2 | 694 |CAMAC station of the singles' scalers. | |MON_NV |I*4 | 712 |Number of measurements used for TEMPER and TEMDEV. | |TEMPER(4) |R*4 | 716 |Mean temperatures (max. 4 sensors, undefined units).| |TEMDEV(4) |R*4 | 738 |Standard deviations of temperatures. | |NIO |I*2 | 770 |CAMAC station of the IO506. | |REANT0(0:16)|R*4 | 792 |Zero times. Supersede NT0 if non-zero | |C62TXT(62) |L*1 | 860 |Run sub-title. | |SCALA_A(24) |L*1 | 924 |Labels for scalers 1 to 6, 4 characters each. | |HISLA(64) |L*1 | 948 |Labels for histograms, 4 characters each. | |BINWIX |R*4 |1012 |TDC res'n. Supersedes KDTRES if non-zero | +------------+----+------+----------------------------------------------------+ Here is the same list sorted alphabetically. +------------+----+------+----------------------------------------------------+ | Name(Dim) |Type| Byte | Description | | | |Offset| | +------------+----+------+----------------------------------------------------+ |BINWIX |R*4 |1012 |TDC res'n. Supersedes KDTRES if non-zero | |C62TXT(62) |L*1 | 860 |Run sub-title. | |CNTOLD(16) |I*4 | 296 |Number of events in each histogram. | |DATE1(9) |L*1 | 218 |Date of run start (DD-MMM-YY). | |DATE2(9) |L*1 | 227 |Date this file was written (DD-MMM-YY). | |DKSPER |R*4 | 654 |Period between disk saves during data acquisition. | |FMT_ID(2) |L*1 | 0 |Flag identifying file format (= "1M"). See Note 5.1.| |HISLA(64) |L*1 | 948 |Labels for histograms, 4 characters each. | |HMTYPE(3) |L*1 | 56 |Type of histogram memory ("CES" or "LRS") | |I4SCAL_A(6) |I*4 | 670 |Contents of scalers 1 to 6 (including overflows). | |I4SCAL_B(12)|I*4 | 360 |Contents of scalers 7 to 18 (including overflows). | |IBR |I*2 | 48 |CAMAC branch. | |ICR |I*2 | 50 |CAMAC crate. | |IFTYPE |I*2 | 648 |Type of CAMAC Interface (6 = SCI-2280, 9 = CCP). | |KDAFHI |I*2 | 132 |Number of histogram data records per histogram. | |KDTRES |I*2 | 2 |TDC time resolution code (0 - 15) if BINWIX is zero.| |KDOFTI |I*2 | 4 |TDC time overflow setting. The overflow occurs at | | | | | (KDOFTI + 0.5) * 160 nsec. | |KHIDAF |I*2 | 134 |Number of histograms per histogram record. For | | | | | microVAX files, KHIDAF = 1. | |LENDAF |I*2 | 130 |Length (in bins) of a hist data record ( < 4097). | |LENHIS |I*2 | 28 |Length of a histogram (in bins). | |MONDEV(12) |L*1 | 60 |Type of temperature monitor (e.g. "KEITH_1992") | |MONPER |R*4 | 658 |Period between temperature monitor activations (was | | | | | called DPMPER prior to FMT_ID = "1F"). | |MON_HI(4) |R*4 | 88 |"Temperature" upper limits. | |MON_LO(4) |R*4 | 72 |"Temperature" lower limits. | |MON_LST(4) |R*4 | 104 |Last "temperature" values read. | |MON_NV |I*4 | 712 |Number of measurements used for TEMPER and TEMDEV. | |NHM_A(2) |L*1 | 54 |CAMAC station of 1st and 2nd histogram memories | | | | | (left hand station if LRS type histogram memory). | |NHM_B(2) |L*1 | 46 |CAMAC station of 3rd and 4th histogram memories. | |NIO |I*2 | 770 |CAMAC station of the IO506. | |NIVG |I*2 | 650 |Station number of camac interface. | |NRUN |I*2 | 6 |Run Number. | |NSC(3) |I*2 | 694 |CAMAC station of the singles' scalers. | |NTD |I*2 | 52 |Left hand CAMAC station of TDC. | |NTFIN(16) |I*2 | 522 |Last good bin for each histogram. | |NTINI(16) |I*2 | 490 |First good bin for each histogram. | |NT0(16) |I*2 | 458 |Zero time bin for each histogram. | |NUMDAF |I*2 | 128 |Number of hist data records in file (NUMHIS*KDAFHI).| |NUMHIS |I*2 | 30 |Number of histogram(s) in use (maximum = 16). | |PATCH(16) |L*1 | 8 |NIM/ECL patch routing for the counter telescopes | |REANT0(0:16)|R*4 | 792 |Zero times. Supersede NT0 if non-zero | |SCALA_A(24) |L*1 | 924 |Labels for scalers 1 to 6, 4 characters each. | |SCALA_B(48) |L*1 | 554 |Labels for scalers 7 to 18, 4 characters each. | |SCTYPE(5) |L*1 | 642 |Type of singles' scaler ("S500 " or "S500A"). | |SETUP(10) |L*1 | 178 |Selected data acq mode (10 ASCII characters ). | |TEMDEV(4) |R*4 | 738 |Standard deviations of temperatures. | |TEMPER(4) |R*4 | 716 |Mean temperatures (max. 4 sensors, undefined units).| |TIME1(8) |L*1 | 236 |Time of run start (HH:MM:SS) | |TIME2(8) |L*1 | 244 |Time this file was written (HH:MM:SS). | |TITLE(40) |L*1 | 138 |4*10 ASCII characters for Target/Temp./Field/Orient.| |TOTOLD |I*4 | 424 |Total number of events in the histograms. | +------------+----+------+----------------------------------------------------+ History of Obsolete Items Removed at FMT_ID +----------+-----+------+-----------------------------------------------------+ |I2ADC(4) | I*2 | 566 | Last "temperature" values read. 1I| |ILT(4) | I*2 | 598 | "Temperature" lower limits. 1I| |IUT(4) | I*2 | 606 | "Temperature" upper limits. 1I| |NDPM | I*2 | 590 | CAMAC station of DPM "temperature" monitor. 1F| |SCALA(24) | L*1 | 924 | Renamed SCALA_A. 1J| |I4SCAL(6) | I*4 | 670 | Renamed I4SCAL_A. 1J| +----------+-----+------+-----------------------------------------------------+ History of Added Items Added at FMT_ID +------------+----+------+----------------------------------------------------+ |NTFIN(16) |I*2 | 522 |Last good bin for each histogram. 1C| |NTINI(16) |I*2 | 490 |First good bin for each histogram. 1C| |NT0(16) |I*2 | 458 |Zero time bin for each histogram. 1C| |HISLA(64) |L*1 | 948 |Labels for histograms, 4 characters each. 1E| |SCALA(24) |L*1 | 924 |Labels for single scalers, 4 characters each. 1E| |MONDEV(12) |L*1 | 60 |Type of temperature monitor (e.g. "KEITH_1992") 1F| |TEMPER(4) |R*4 | 716 |Mean temperatures (max. 4 sensors, undef units) 1F| |TEMDEV(4) |R*4 | 738 |Standard deviations of temperatures. 1F| |MON_LO(4) |R*4 | 72 |"Temperature" lower limits. 1I| |MON_HI(4) |R*4 | 88 |"Temperature" upper limits. 1I| |MON_LST(4) |R*4 | 104 |Last "temperature" values read. 1I| |MON_NV |I*4 | 712 |Number of measurements used for TEMPER and TEMDEV.1I| |BINWIX |R*4 |1012 |TDC res'n. Supersedes KDTRES if non-zero 1J| |I4SCAL_A(6) |I*4 | 670 |Rename of I4SCAL(6) 1J| |I4SCAL_B(12)|I*4 | 360 |Contents of scalers 7 to 18 (including overflows).1J| |REANT0(0:16)|R*4 | 792 |Zero times. Supersede NT0 if non-zero 1J| |SCALA_A(24) |L*1 | 924 |Rename of SCALA(24) 1J| |SCALA_B(48) |L*1 | 554 |Labels for scalers 7 to 18, 4 characters each. 1J| |NHM_B(2) |L*1 | 46 |CAMAC station of 3rd and 4th histogram memories. 1N| +------------+----+------+----------------------------------------------------+ The info record can be read as follows:- byte info(0:1023) byte fmt_id(2) integer*2 kdtres etc. equivalence (info( 0), fmt_id) equivalence (info( 2), kdtres) etc. open (unit=1, file='data_file', readonly, + form='unformatted', status='old') read (1) info etc. 4. Compatibility ------------- Except for the following differences, the overall data file format generated by the microVAX data acquisition system is the same as that generated by the earlier PDP-11 system used at PSI. The differences are:- a) In data files generated by the microVAX system, KHIDAF is always 1. This means that no attempt is made to pack more than one histogram into a data record. LENDAF is chosen so that its value never exceeds 4096 but also so that it is as near as possible to being a divisor of LENHIS (so that the last data record of a histogram will not need much padding). In the PDP files, KHIDAF could be greater than 1 to optimise disk usage. b) The info record layout has been copied from the old PDP-11 format. The format is very arbitrary and contains many fields which are no longer used. On the PDP-11 system, many of these fields were used for inter-task communication for reasons of economy. Some of these fields have been re-defined in the micro-VAX system. All unused fields in the info record are zero. The following are the fields which have been redefined up to and including FMT_ID = "1I". Since this time, no further updates have been made to this list. New Designation Old Designation Old Use =============== =============== ======= FMT_ID ISTFLA Status Flag for Data Acquisition. HMTYPE TDA0 CDREG encoding for A0 of TDC. SCTYPE QS(0:1) CDREG encoding for Scaler. IFTYPE QS(1) CDREG encoding for Scaler. NIVG QS(2) CDREG encoding for Scaler. DKSPER QS(3) CDREG encoding for Scaler. DPMPER QS(4) CDREG encoding for Scaler. MONDEV HMA0,HMA1,HMA2 CDREG encoding for Hist. Mem. SETUP BLABL(40) Probably not used. MON_LO INHIBI,IK Used for inter-task communication. MON_HI IBLINK,EF.. Used for inter-task communication. MON_LST EF..,IFLGET,IFLACQ Used for inter-task communication. MON_NV NCES Probably a CAMAC station number. NHM_B NFRESH Probably not used. 5. Notes ----- 1. FMT_ID. Files containing a value of the form "Rx" for FMT_ID originate from Andi Kratzer's data acquisition system at the Rutherford Appleton Laboratory. The internal structure of such files is not considered in this description. ------oooOOOooo------ +-------+-------+-------+-------+-------+-------+-------+-------+-------+ 0 16 32 48 64 80 96 112 128 | | | | | | | | | | | ^^^^<------> ^^ ^^^^^<><----><------><------><------> ^^^^ <--- FKKN PATCH LN NIINN H M MON_ MON_ MON_ NLKK MDDR EU HBCTH M O LO(4) HI(4) LST(4) UEDH TTOU NM MRRDM T N MNAI _RFN HH _ _ Y DEV(12) DDFD IET II B A P AAHA DSI SS E(3) FFIF +-------+-------+-------+-------+-------+-------+-------+-------+-------+ 144 160 176 192 208 224 240 256 272 | | | | | | | | | | | ----------------><---> <---\---><--><--> | TITLE(40) S D D T T E A A I IME2(8) TUP(10) T T ME1(8) E E2(9) 1(9) +-------+-------+-------+-------+-------+-------+-------+-------+-------+ 288 304 320 336 352 368 384 400 416 | | | | | | | | | | | <------------------------------><----------------------> <> | CNTOLD(16) I4SCAL_B(12) T O TOLD +-------+-------+-------+-------+-------+-------+-------+-------+-------+ 432 448 464 480 496 512 528 544 560 | | | | | | | | | | | <--------------><--------------><--------------><----------- NT0(16) NTINI(16) NTFIN(16) SCALA_B(48) +-------+-------+-------+-------+-------+-------+-------+-------+-------+ 576 592 608 624 640 656 672 688 704 | | | | | | | | | | | ------------> <->^^ <><> <----------><-> <><-- SCALA_B(48) S IN D M I4SCAL_A(6) N M C FI S O S O T TV K N C N Y YG P P (3) _ P P E E N E E R R V (5) +-------+-------+-------+-------+-------+-------+-------+-------+-------+ 720 736 752 768 784 800 816 832 848 | | | | | | | | | | | -----> <------> ^ <--------------------------------><-- T T N REANT0(0:16) EMPER(4) EMDEV(4) I O +----...----+-------+-------+-------+-------+-------+-------+------+ 864 ... 912 928 944 960 976 992 1008 | | ... | | | | | | | | -----...--------> <----------><------------------------------><> | C62TXT(62) SCALA_A(24) HISLA(64) B INWIX