1
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
! Midas command procedure norm1d.prg
5
! D. Baade, ST-ECF, Garching version 1.0 281085
7
! execute the command :
8
! normalize/spectrum inimage fitimage [mode] [table] [batch_flag]
10
! inimage: input 1-dim frame
11
! fitimage: fit to the continuum
12
! mode: GCURSOR - create new table FIT1D, input from graphics cursor
13
! ADD - add new points to table FIT1D
14
! DELETE - delete points from table FIT1D
15
! TABLE - get positions and bin widths from "table", integrate
16
! in "inimage" over corresponding bins
17
! batch_flag if equal to Y suppress all plots
20
!-------------------------------------------------------------------------------
22
define/param p1 ? IMAGE "Enter input image:"
23
define/param p2 ? IMAGE "Enter output image:"
25
define/param p4 TABLE C
28
branch p3(1:1) T,A,D TABLE,ADD,DELETE
30
GCURSOR: !start from scratch is the default
32
write/out " >>> Use graphics cursor to enter data <<<"
36
ADD: !add points to previoulsy created table FIT1D
38
overplot/table FIT1D :X_AXIS :Y_AXIS
42
DELETE: !delete points from previously created table FIT1D
44
overplot/table FIT1D :X_AXIS :Y_AXIS
45
ident/gcurs FIT1D :X_AXIS :X_AXIS :Y_AXIS 3
48
TABLE: !integrate over bins in inmage
49
if p5(1:1) .ne. "Y" plot/row {p1}
50
write/keyw nfimage/c/1/60 {p1}
51
write/keyw nftable/c/1/60 "FIT1D"
52
-copy {p4}.tbl FIT1D.tbl
53
create/column FIT1D :Y_AXIS
55
if p5(1:1) .ne. "Y" overplot/table FIT1D :X_AXIS :Y_AXIS
59
FIT: ! do the spline fit
60
sort/table FIT1D :X_AXIS
61
convert/table {p2} = FIT1D :X_AXIS :Y_AXIS {P1} SPLINE
62
if p5(1:1) .ne. "Y" overplot/row {p2}