Read data from an external file.
Before the file formats are described some general remarks
need to be mentioned:
- Format:
- SPECTRA
>
rea
d/arr
ay file_name [internal_name]
- Description:
- A column is read from an ASCII file and copied to an ARRAY GQE.
The target GQE has to be created before the input command
is executed. SPECTRA uses the attributes of the target
to determine the data type.
- /column=ncol
- The ARRAY can be read from a multicolumn ASCII file. In this
case the column number has to be specified.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is
disabled.
- Format:
- SPECTRA
>
rea
d/as
cii file_name[.dat] [internal_name]
SPECTRA>
rea
d/ascii [/x=n] /y=m
file_name[.dat] [internal_name]
- Description:
- A normal ASCII file contains two columns of data, x and y.
The maximum number of rows is 16384.
Comment lines have a letter,
"$" or "!" as the first non-blank character.
When a file is read, SPECTRA copies the
first 10 comment lines, except the characters "$" and "!",
to the comment strings
of the SCAN which is created by this read operation.
Additional comment lines are ignored.
/x=n, /y=m: The input of a multicolumn ASCII file.
N and m select the column numbers for the x- and y-values of the
SCAN. If the /x qualifier is omitted, the x-values are set
to channel numbers, starting at 1.
- /ignore=n
- SPECTRA is directed to ignore the first n lines of the file.
- /do
uble
- A DSCAN is created (double precision SCAN).
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is
disabled.
- e.g.:
-
- SPECTRA
>
read/ascii bpu1.dat
- SPECTRA
>
read/ascii/y=2 bpu1.dat temp
The y-values of temp are the second column of bpu1.dat, the x-values
start at 1 and are incremented by one for every point.
- Format:
- SPECTRA
>
rea
d/compton file_name[.hst] [internal_name]
- Description:
- SPECTRA expects two columns of data. These columns are interpreted
as the output of two multichannel analyzers.
Reading a HST file creates two SCANs.
The y-values of the SCANs are the two columns of the file, the x-values
are just channel numbers.
The first lines of an HST file may contain some comment. SPECTRA
starts to interpret the input as numbers after a line containing the
string "daten".
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is
disabled.
- Format:
- SPECTRA
>
rea
d/dida file_name[.dida] [internal_name]
- Description:
- A format for ARRAYs. It was written by R. Steube.
/notext
The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- Format:
- SPECTRA
>
rea
d/er
ror file_name[.dat] [internal_name]
- Description:
- SPECTRA
expects four columns: x, y, dx, dy. Three
SCANs are created: internal_name, internal_name_dx and
internal_name_dy. The SCANs for the error bars have
twice as many points as the original and the /pairs flag set.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- Format:
- SPECTRA
>
rea
d/fio file_name[.fio] [internal_name]
- Description:
- FIO files have the following structure (coded by T. Schmidt).
!
! private comments, ignored by the i/o routine
!
%C
comment line 1
comment line 2
...
%P
parameter1 = value1
parameter2 = value2
...
%D
COL 1 name1 [DOUBLE|FLOAT|INT]
COL 2 name2 [DOUBLE|FLOAT|INT]
...
data data data ...
...
The tags %c, %p and %d mark the comment-, parameter- and
data-section of the file.
If a FIO file is read with SPECTRA, the comment
lines are copied to the comment lines of the new SCAN.
The parameters are copied to symbols which are put into the
same slot as the new scan, if the /read_params qualifier is supplied.
The names of these symbols
consist of the SCAN name and the parameter name:
scanname_parametername.
Symbols that belong to a SCAN can be inspected by:
SPECTRA>
show all
If the user wishes to append a parameter to a SCAN which will
be written to a FIO file, he has to use the symbol() function
to create a symbol in the right slot.
SPECTRA>
symbol( bpu1, bpu1_energy) = 12345
The data are described by the col lines. It is not necessary
to have a col line for every column of data.
The number of columns is determined by the first data record. It is
less than 20. The maximum length of each column is 16384.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- /read_params
- The FIO parameters are read.
- /scan
- All columns of a FIO file are read. The SCAN GQEs, which are
created, take their x-values from the first column. In general the
first column is the energy or a motor position and the other columns
are counter readings. All TEXT GQEs but the title are deleted unless
the qualifier /keep_texts is specified. The reason
for deleting the TEXTs is that otherwise the display will
easily be overloaded.
- /sort
- SCANs and DSCANs are automatically sorted after they have been read.
If SCAN GQEs are replaced by the read/fio/scan command,
the entire slot of these SCANs is cleared before the new GQEs are
created.
Files , which is read by /scan,
have most likely been produced by the general scan menu,
write/fio/scan ...
- Format:
- SPECTRA
>
rea
d[/fts] file_name[.fts]
- Description:
- CCD camera file format.
- Format:
- SPECTRA
>
rea
ad/gq
e file_name[.gqe] [id]
- Description:
- Id is the destination of the GQEs. If this parameter is not supplied,
SPECTRA chooses the first empty slot.
A GQE file may contain more than one GQE.
When SPECTRA copies the GQEs from the file to the queue, it
makes sure that:
SCANs are copied to
.0,
TEXTs, CONSTs and SYMBols are not copied to
.0 and
if SPECTRA finds more than one SCAN in the file, it
increases the slot number automatically.
SPECTRA will not replace GQEs without asking for confirmation.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- Format:
- SPECTRA
>
rea
d[/hs
p] file_name[.hsp] [internal_name]
- Description:
- The I/O routine DATIO is
described in: Technischer Bericht, DESY/HASYLAB-F41 86/01, Dezember 1986.
The DATIO common block DAT contains the following
items, which are also used by SPECTRA:
The creation date is copied to date1 of the SCAN info block, see table
, the modification date to date2,
the 160 bytes of the text field are copied to the first two comment
lines of the SCAN info block.
The bytes from 81 to 120 are taken
as the description of the x-axis and the last 40 bytes
as the description of the y-axis.
When a SCAN is written to a HSP file, these items are copied backwards
(except for the axis descriptions).
Normally DATIO uses three common blocks: DAT, NAME and PMETER.
The version called by SPECTRA has only one
common block (DATIO_COMMON) containing the whole
information.
If a user is interested in those data which are
not copied to the queue elements, he can access DATIO_COMMON by a
call to a user-written function, after he has read a HSP data set.
The file GRA_USER_DATIO_FOR.COM (VAX FORTRAN) in gra_examples: demonstrates
how to print the 44 parameter which are part of ID
(the file GRA_USER_DATIO_C.COM contains the same example in C).
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- e.g.:
-
- SPECTRA
>
read bpu1
- Format:
- SPECTRA
>
rea
d/mca file_name[.mca] [internal_name]
- Description:
- MCA is an unformatted file input. The input routine was written
by A. Buttkewitz.
MCA files are produced by the S100-MCA-Program as `standard output` files
( CANBERRA).
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- Format:
- SPECTRA
>
rea
d/nd file_name[.nd] [internal_name]
- Description:
- Nd is an unformatted file input which is
produced by multi channel analyzers from NUCLEAR DATA.
The input routine has been provided by A. Lessmann.
The nd format is read-only.
The relevant information from the header block of the nd files
is copied to the comment lines of the new SCAN. It can
be inspected by "show name" and it can be used with the
help of the comment function.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- Format:
- SPECTRA
>
rea
d/ppm file_name[.ppm] [internal_name]
- Description:
- An ARRAY is read from a portable pixel map file.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- /swap
- Exchanges the RED and BLUE component, useful if the file has been copied
from VMS to Unix or vice versa.
- Format:
- SPECTRA
>
rea
d/rm file_name[.rm] [internal_name]
- Description:
- RM is a special format of an ASCII file, which is used
by x-ray experiments ( R. Frahm).
RM files contain one column of
x-values and up to 18 columns of y-values. The number of SCANs that
are created by one input file is determined by the file itself. The RM
format is READ-ONLY.
The energy is calculated from the motor position (first column).
The offsets are subtracted from the count rates.
Note that the offset values which are in the file have been
measured with a sample time of 1 second.
SPECTRA is able to deal with RM files that consist of several
regions with different sample times.
- /n_comment=n
- This first n lines of the RM file are copied to the
comment lines of the new SCAN. Blank lines are ignored.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- Format:
- SPECTRA
>
rea
d/stw file_name[.stw] [internal_name]
- Description:
- This is a special format of an ASCII file, used by a standing
wave experiment.
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.
- Format:
- SPECTRA
>
rea
d/tmc file_name[.tmc] [internal_name]
- Description:
- Tmca is an unformatted file input. The input routine was written
by A. Buttkewitz.
SPC files are produced by the
TMCA2-Multichannel-analyzer Program as `standard output` files
( TARGET, distributor Tennelec).
- /notext
- The creation of the four standard TEXT GQEs (Date, title, ...) is disabled.