1
C @(#)irstilt.for 19.1 (ES0-DMD) 02/25/03 14:23:43
2
C===========================================================================
3
C Copyright (C) 1995 European Southern Observatory (ESO)
5
C This program is free software; you can redistribute it and/or
6
C modify it under the terms of the GNU General Public License as
7
C published by the Free Software Foundation; either version 2 of
8
C the License, or (at your option) any later version.
10
C This program is distributed in the hope that it will be useful,
11
C but WITHOUT ANY WARRANTY; without even the implied warranty of
12
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
C GNU General Public License for more details.
15
C You should have received a copy of the GNU General Public
16
C License along with this program; if not, write to the Free
17
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
20
C Corresponding concerning ESO-MIDAS should be addressed as follows:
21
C Internet e-mail: midas@eso.org
22
C Postal address: European Southern Observatory
23
C Data Management Division
24
C Karl-Schwarzschild-Strasse 2
25
C D 85748 Garching bei Muenchen
27
C===========================================================================
29
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++
31
C.COPYRIGHT (C) 1992 European Southern Observatory
33
C.AUTHOR E. Oliva, Firenze-Arcetri
34
C.KEYWORDS Spectroscopy, IRSPEC
36
C.PURPOSE Execute command ...
44
C.VERSION 1.0 Creation 02.09.1992 E. Oliva
46
C-------------------------------------------------------
49
IMPLICIT REAL(A-H,O-Z)
52
CHARACTER*60 FRAMEI,FRAMEO
55
INTEGER*8 INPNTR,OUPNTR
57
DOUBLE PRECISION START(2),STEP(2),DCW
59
COMMON/ISTPAR/COSG_SIG(2),SING0,CSI0
60
COMMON /VMR/ MADRID(1)
62
INCLUDE 'MID_INCLUDE:ST_DEF.INC'
63
INCLUDE 'MID_INCLUDE:ST_DAT.INC'
70
C GET NAME OF INPUT FRAME AND MAP IT
72
CALL STKRDC('framei',1,1,60,IRET,FRAMEI,KUNIT,KNUL,ISTAT)
73
CALL CLNFRA(FRAMEI,FRAMEI,0)
74
CALL STIGET(FRAMEI,D_R4_FORMAT,F_I_MODE,F_IMA_TYPE,MAXDIM,
75
, NAXIS,NPIX,START,STEP,
76
, IDENT,CUNIT,INPNTR,NIN,ISTAT)
78
+ CALL STETER(1,'Input frame must be 2-D')
80
C GET NAME OF OUTPUT FRAME AND MAP IT
82
CALL STKRDC('frameo',1,1,60,IRET,FRAMEO,KUNIT,KNUL,ISTAT)
83
CALL CLNFRA(FRAMEO,FRAMEO,0)
84
CALL STIPUT(FRAMEO,D_R4_FORMAT,F_O_MODE,F_IMA_TYPE,
85
, NAXIS,NPIX,START,STEP,
86
, IDENT,CUNIT,OUPNTR,NOU,ISTAT)
88
C Get values of gamma0,csi0,grarul
89
C and compute COSG_SIG(1:2)=cos(gamma0)*1000/grarul
92
CALL STKRDR('Igamma0',1,1,IRET,GAMMA0,KUNIT,KNUL,ISTAT)
94
CALL STKRDR('Igrarul',1,2,IRET,GRARUL,KUNIT,KNUL,ISTAT)
96
COSG_SIG(I)=COS(GAMMA0)*1000/GRARUL(I)
98
CALL STKRDR('Icsi0',1,1,IRET,R4,KUNIT,KNUL,ISTAT)
101
C Get key which contain the reference row # (i.e. the #
102
C of the row which is left untouched
104
CALL STKRDI('rowref',1,1,IRET,IRREF,KUNIT,KNUL,ISTAT)
106
C GET NAME OF KEY WHICH MIGHT CONTAIN THE VALUE OF THE TANGENT
107
C OF THE TILT ANGLE (CSI) ENTERED BY THE USER.
108
C IF = 0 TAKE THE VALUES OF CW, C GRAT # AND ORDER # C FROM THE
109
C FILE DESCRIPTORS AND COMPUTE CSI ACCORDING TO THE PROPER
110
C FORMULA (SEE FUNCTION VALUE_TILT).
112
CALL STKRDR('angle',1,1,IRET,CSI,KUNIT,KNUL,ISTAT)
114
C Get values of grating#
119
CALL STKRDI('ngrat',1,1,IRET,IGRAT,KUNIT,KNUL,ISTAT)
120
CALL STKRDI('order',1,1,IRET,IORDER,KUNIT,KNUL,ISTAT)
121
CALL STKRDD('wlcen',1,1,IRET,DCW,KUNIT,KNUL,ISTAT)
123
CSI=VALUE_TILT(CW,IGRAT,IORDER)
126
C CALL ROUTINE WHICH CORRECT SLIT TILT BY MEANS OF LINEAR REBINNING
129
CALL RECTIFY(MADRID(INPNTR),MADRID(OUPNTR),
130
, NPIX(1),NPIX(2),CSI,IRREF)
132
C RELEASE FILES, UPDATE KEYWORDS AND EXIT
139
SUBROUTINE RECTIFY(A,B,NX,NY,CSI,IRREF)
141
C RECTIFY THE SLIT, I.E. LEAVE THE SCAN-LINE #IRREF OF THE
142
C IMAGE UNTOUCHED AND SHIFT (=LINEAR REBIN....) THE OTHERS
143
C BY CSI*DISTANCE FROM CENTRAL COLUMN.
145
IMPLICIT REAL(A-H,O-Z)
146
IMPLICIT INTEGER(I-N)
148
DIMENSION A(NX,NY),B(NX,NY)
150
C SET OUTPUT IMAGE TO ZERO
160
SHIFT=CSI*FLOAT(ICROW-IY)
164
IF(A1.LT.0.) IA1=IA1-1
169
IF(IA1.GT.(NX-1)) THEN
187
FUNCTION VALUE_TILT(WAVE,NGRAT,IORDER)
189
IMPLICIT REAL(A-H,O-Z)
190
IMPLICIT INTEGER(I-N)
192
COMMON/ISTPAR/COSG_SIG(2),SING0,CSI0
197
+(ATAN(2.*SING0/SQRT((2.*COSG_SIG(NGRAT)/ORDER/WAVE)**2-1.))-CSI0)
198
WRITE(OUTPUT,100) CSI
199
100 FORMAT('Assumed value of tan(tilt) : ',F7.4)
200
CALL STTPUT(OUTPUT,ISTAT)