1
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2
C.IDENTIFICATION ISTFES.FOR
4
C.AUTHOR: J.D.PONZ ESA-VILSPA
5
C.KEYWORDS IUE, GO FORMAT, FES IMAGE
8
C Reads FES data from tape.
9
C The routine performs the following functions (routine names in brackets):
11
C \item Handles the file header (ISTFHD)
12
C \item Creates the MIDAS image file on disk (STFCRE).
13
C The format and size of the file is controlled by the
14
C argument DSKFMT (0 - floating point, 1 - byte).
15
C \item Iteration on the number of lines to:
17
C \item Read a line (ISTREC)
18
C \item Decode the pixel information
19
C \item Write the line into disk (STFPUT).
21
C \item Writes standard image descriptors (STDWRx)
22
C \item Writes IUE specific descriptors (ISTDES).
23
C \item Closes the file on disk (STFCLO)
28
C The following extensions are used :
31
C \item INCLUDE statement
32
C \item Long variable names
33
C \item Underscore character
36
C.VERSION: 1.0 INITIAL CODING 09 JUL 1990
37
C.VERSION: 1.1 Handle different FES sizes. 24 Sep 1990
38
C.VERSION: 1.2 Remove VMS extensions. 14 Apr 1992
39
C------------------------------------------------------------------
40
SUBROUTINE ISTFES(CHANL,BUFF,FILE,DSKFMT,DSPFLG,
44
INTEGER CHANL ! IN: tape channel number
45
CHARACTER*(*) BUFF ! IN: buffer with the ascii header
46
CHARACTER*(*) FILE ! IN: disk file name
47
INTEGER DSKFMT ! IN: image format (0:float, 1:Byte)
48
INTEGER DSPFLG ! IN: display flag
49
INTEGER NRECO ! IN: number of records
50
INTEGER NBYTE ! IN: number of bytes
51
INTEGER STATUS ! OUT: status (0 normal return)
53
INTEGER DTYPE, NO, SIZE, FELM, NL, NR, LEN, I, J
54
INTEGER NAXIS(1), NPIX(2), DUM(1)
58
DOUBLE PRECISION START(2), STEP(2)
59
CHARACTER*72 IDENT, CUNIT
60
INCLUDE 'MID_INCLUDE:ST_DEF.INC'
61
INCLUDE 'MID_INCLUDE:ST_DAT.INC'
62
DATA CUNIT/'FESCNT PIXEL PIXEL '/
72
C ... decode full header, print it and put info in common area
74
CALL ISTFHD(CHANL,BUFF,DSPFLG,STATUS)
75
IF (STATUS.NE.0) RETURN
76
IF (DSKFMT.LT.0) RETURN ! only displays header
78
C ... create the frame
85
CALL STFCRE(FILE,DTYPE,F_O_MODE,F_IMA_TYPE,SIZE,NO,STATUS)
86
IF (STATUS.NE.0) RETURN
88
C ... loop to read tape and write into disk
91
IF (DSKFMT.EQ.0) THEN ! write with conversion
93
CALL ISTRBY(CHANL,IBUFF,NR,LEN,STATUS)
94
IF (NR.NE.LEN .OR. STATUS.NE.0) RETURN
98
CALL STFPUT(NO,FELM,NR,RBUFF,STATUS)
99
IF (STATUS.NE.0) RETURN
102
ELSE ! write without conversion
104
CALL ISTRB1(CHANL,IBUFF,NR,LEN,STATUS)
105
IF (NR.NE.LEN .OR. STATUS.NE.0) RETURN
106
CALL STFPUT(NO,FELM,NR,IBUFF,STATUS)
107
IF (STATUS.NE.0) RETURN
112
C ... write image descriptors
125
IDENT = BUFF(145:210)
126
CALL STDWRI(NO,'NAXIS',NAXIS,1,1,DUM,STATUS)
127
CALL STDWRI(NO,'NPIX',NPIX,1,2,DUM,STATUS)
128
CALL STDWRD(NO,'START',START,1,2,DUM,STATUS)
129
CALL STDWRD(NO,'STEP',STEP,1,2,DUM,STATUS)
130
CALL STDWRR(NO,'LHCUTS',CUTS,1,4,DUM,STATUS)
131
CALL STDWRC(NO,'IDENT',1,IDENT,1,72,DUM,STATUS)
132
CALL STDWRC(NO,'CUNIT',1,CUNIT,1,48,DUM,STATUS)
134
C ... write label descriptors
136
CALL ISTDES(NO,BUFF,STATUS)
137
CALL STFCLO(NO,STATUS)