1
! @(#)lnffit.prg 19.1 (ES0-DMD) 02/25/03 14:24:46
2
! @(#)lnffit.prg 19.1 (ESO) 02/25/03 14:24:46
3
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
4
!.COPYRIGHT (C) 1993 European Southern Observatory
6
!.AUTHORS Pascal Ballester (ESO/Garching)
7
! Cristian Levin (ESO/La Silla)
8
!.KEYWORDS Spectroscopy, Long-Slit
10
! Fitting for generating the response curve.
13
!.VERSION 1.0 Package Creation 17-MAR-1993
14
!-------------------------------------------------------
16
CROSSREF PLOT FIT DEG SMO TABLE IMAGE VISU
18
define/param P1 {PLOTYP} C "Enter type of plot : "
19
define/param P2 {FITYP} C "Enter type of fit : "
20
define/param P3 {FITD} N "Degree of fit : "
21
define/param P4 {SMOOTH} N "Smoothing factor : "
22
define/param P5 {RESPTAB} C "Response table : "
23
define/param P6 {RESPONSE} C "Response image : "
24
define/param P7 {RESPLOT} C "Plot intermediate results (YES/NO):"
29
SET/LONG PLOTYP={P1} FITYP={P2} FITD={P3}
30
SET/LONG SMOOTH={P4} RESPTAB={P5} RESPLOT={P7} RESPONSE={P6}
32
define/local index/I/1/1 0
33
index = M$INDEX(P5,".tbl")
34
if INDEX .LE. 0 set/long resptab={P5}.tbl
36
define/local nwaves/i/1/1 0
37
define/local wstart/r/1/1 0.0
38
define/local wstep/r/1/1 0.0
40
write/keyw nwaves/i/1/1 '{RESPTAB},nwaves'
41
write/keyw wstart/r/1/1 '{RESPTAB},wstart'
42
write/keyw wstep/r/1/1 '{RESPTAB},wstep'
44
DEFINE/LOCAL PARAMS/C/1/30 " " ALL
45
DEFINE/LOCAL COLUMN/C/1/10 " " ALL
47
IF FITYP(1:1) .EQ. "S" WRITE/KEYW PARAMS "SPLINE {SMOOTH},{FITD}"
48
IF FITYP(1:1) .EQ. "P" WRITE/KEYW PARAMS "POLY {FITD}"
50
IF PLOTYP(1:1) .EQ. "R" WRITE/KEYW COLUMN :RATIO
51
IF PLOTYP(1:1) .EQ. "M" WRITE/KEYW COLUMN :COLOUR
53
CREATE/IMAGE &f 1,'nwaves' 'wstart','wstep'
54
CONVERT/TABLE &r = {RESPTAB} :WAVE {COLUMN} &f {PARAMS}
56
IF RESPLOT(1:1) .NE. "Y" GOTO OUT
61
RESET/GRAPH PMODE=1 FONT=1
62
PLOT/TABLE {RESPTAB} :WAVE {COLUMN}
68
IF PLOTYP(1:1) .EQ. "R" COPY/II &r {RESPONSE}
69
IF PLOTYP(1:1) .EQ. "M" COMPUTE/IMAGE {RESPONSE} = 10.**(-0.4*&r)