~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to stdred/spec/proc/norm1d.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
2
!
 
3
! Midas command procedure  norm1d.prg
 
4
!
 
5
! D. Baade, ST-ECF, Garching           version 1.0               281085
 
6
!
 
7
! execute the command :
 
8
! normalize/spectrum inimage fitimage [mode] [table] [batch_flag]
 
9
!
 
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
 
18
!
 
19
! 040114        last modif
 
20
!-------------------------------------------------------------------------------
 
21
!
 
22
define/param p1 ? IMAGE "Enter input image:"
 
23
define/param p2 ? IMAGE "Enter output image:"
 
24
define/param p3 G C
 
25
define/param p4 TABLE C
 
26
define/param p5 N ?
 
27
!
 
28
branch p3(1:1) T,A,D  TABLE,ADD,DELETE
 
29
 
30
GCURSOR:                !start from scratch is the default
 
31
plot/row {p1}
 
32
write/out "                       >>> Use graphics cursor to enter data <<<"
 
33
get/gcurs FIT1D
 
34
goto FIT
 
35
!
 
36
ADD:                    !add points to previoulsy created table FIT1D
 
37
plot/row {p1}
 
38
overplot/table FIT1D :X_AXIS :Y_AXIS
 
39
get/gcurs FIT1D ADD
 
40
goto FIT
 
41
!
 
42
DELETE:                 !delete points from previously created table FIT1D
 
43
plot/row {p1}
 
44
overplot/table FIT1D :X_AXIS :Y_AXIS
 
45
ident/gcurs FIT1D :X_AXIS :X_AXIS :Y_AXIS 3
 
46
goto FIT
 
47
!
 
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
 
54
run STD_EXE:INTEGBIN
 
55
if p5(1:1) .ne. "Y" overplot/table FIT1D :X_AXIS :Y_AXIS
 
56
!
 
57
! common section
 
58
 
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}
 
63