1
C @(#)necripcor.for 19.1 (ESO-DMD) 02/25/03 14:20:25
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 Massachusetts Ave, Cambridge,
20
C Correspondence 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: Copyright (c) 1991 European Southern Observatory,
34
C.VERSION: 1.0 23-JULY-1991
36
C.LANGUAGE: F77+ESOext
44
C ECHELLE, CASPEC, BLAZE FUNCTION
48
C compute the ECHELLE constants to set successive orders at the same level
58
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
64
INTEGER NAXISA,NPIXA(2),IAV,STAT,ACTVAL,MAXORD
66
INTEGER KNULL,KUNIT(1),BOUND(3)
71
PARAMETER (MAXORD=500)
74
CHARACTER CUNIT*64,IDENTA*72
77
INTEGER ORDSTA(MAXORD),ORDEND(MAXORD)
81
DOUBLE PRECISION STEPA(2),STARTA(2),WSTART(MAXORD)
83
INCLUDE 'MID_INCLUDE:st_def.inc'
85
INCLUDE 'MID_INCLUDE:st_dat.inc'
88
CALL STKRDC('IN_A',1,1,60,IAV,FRAMEA,KUNIT,KNULL,STAT)
90
CALL STIGET(FRAMEA,D_R4_FORMAT,F_IO_MODE,F_IMA_TYPE,
91
+ 2,NAXISA,NPIXA,STARTA,STEPA,IDENTA,CUNIT,
94
IF (NPIXA(2).LT.MAXORD) THEN
95
CALL STDRDD(IMNOA,'WSTART',1,NPIXA(2),ACTVAL,WSTART,
97
CALL STDRDI(IMNOA,'NPTOT',1,NPIXA(2),ACTVAL,NPTOT,
99
CALL STDRDI(IMNOA,'ORDSTA',1,NPIXA(2),ACTVAL,ORDSTA,
101
CALL STDRDI(IMNOA,'ORDEND',1,NPIXA(2),ACTVAL,ORDEND,
104
CALL STETER(10,'Buffer overflow in RIPPLE.')
107
CALL STKRDI('INPUTI',1,3,IAV,BOUND,KUNIT,KNULL,STAT)
109
CALL NORM(MADRID(PNTRA),NPIXA(1),NPIXA(2),STARTA(1),STEPA(1),
110
+ WSTART,BOUND,CONST,ORDSTA,ORDEND)
116
C ======================Normalization Routine====================
118
SUBROUTINE NORM(INPFRAM,NX,NY,START,STEP,
119
+ WST,BOUND,CONST,ORDSTA,ORDEND)
123
INTEGER NX,NY,BOUND(3),ROW,COL
124
INTEGER PIXSTA,PIXEND,NPIX,MIDORD
125
INTEGER ORDSTA(NY),ORDEND(NY)
129
REAL SN,SN1,CONST(NY),FACTOR
131
DOUBLE PRECISION WST(NY),START,STEP,LAMBST,LAMBED
139
C --- Determine lambda start, lambda end and pixel width in overlap.
141
PIXSTA = ORDSTA(ROW+1) + BOUND(1) + 1
142
LAMBST = WST(ROW+1)+(PIXSTA-1)*STEP ! Lambda Start
144
PIXEND = ORDEND(ROW) - BOUND(2)
145
LAMBED = WST(ROW)+(PIXEND-1)*STEP ! Lambda End
147
NPIX = (LAMBED-LAMBST)/STEP ! Assume linear step in wavelength
148
C TYPE*,'Order, nb pix., delta wav.',ROW,NPIX,LAMBST,LAMBED
150
C --- Estimate normalization constant.
155
DO 40 COL = PIXEND , PIXEND-NPIX, -1
156
SN = SN + INPFRAM(COL,ROW)
159
DO 50 COL = PIXSTA, PIXSTA+NPIX
160
SN1 = SN1 + INPFRAM(COL,ROW+1)
168
C --- Constant for the central order is set to 1. and the frames
169
C --- are normalized.
173
DO 90 ROW = NY-1,1,-1
175
CONST(ROW) = CONST(ROW)*CONST(ROW+1)
180
FACTOR = CONST(MIDORD)
184
CONST(ROW) = CONST(ROW)/FACTOR
185
C TYPE*,'Order,const.',ROW,CONST(ROW)
191
PIXSTA = ORDSTA(ROW) + BOUND(1) + 1
192
PIXEND = ORDEND(ROW) - BOUND(2)
194
DO 75 COL = 1 , PIXSTA-1
196
INPFRAM(COL,ROW) = 0.
200
DO 80 COL = PIXSTA,PIXEND
202
INPFRAM(COL,ROW) = INPFRAM(COL,ROW) * CONST(ROW)
206
DO 85 COL = PIXEND+1,NX
208
INPFRAM(COL,ROW) = 0.