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

« back to all changes in this revision

Viewing changes to prim/proc/plothst.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
!.IDENTIFICATION plothst.prg
 
3
!.PURPOSE        Plot a histogram of image pixel or table values
 
4
!                execute via
 
5
!                PLOT/HISTOGRAM table col-ref [scal_x,scal_y,off_x,off_y] 
 
6
!                               [bin,[min,[max]]] [exc] [log] [opt]
 
7
!                or 
 
8
!                PLOT/HISTOGRAM image [scal_x,scal_y,off_x,off_y] [log] [opt]
 
9
!.AUTHOR         830813 J.D.Ponz
 
10
!.VERSION        860109, 900409, 910225, 920913   K. Banse
 
11
!.VERSION        870601 RHW ??
 
12
!.VERSION:       920224 RHW Offset in x and y included
 
13
! 030722        last modif
 
14
!----------------------------------------------------------------------
 
15
 
16
define/local cmnd/c/1/20 "{mid$cmnd(1:20)}"          !save initial command
 
17
!
 
18
!if mid$sess(7:7) .eq. " " .or. mid$sess(7:7) .eq. "-" then
 
19
!   create/graphics
 
20
!   write/keyw mid$cmnd/c/1/20 "{cmnd(1:20)}"            !reset MID$CMND
 
21
!endif
 
22
!
 
23
branch p2(1:1) :,# tables,tables                 ! test for column reference
 
24
!
 
25
! handle images here
 
26
define/param   p1 ? IMA "Enter table or frame name:"
 
27
define/param   p3 "YY" C                             ! excess bin plotted
 
28
!
 
29
write/keyw    in_a {p1}
 
30
!
 
31
define/local  lola/i/1/1 0                  !check, if HISTOGRAM descr. there
 
32
lola = m$existd(in_a,"HISTOGRAM")
 
33
if lola .eq. 0 then
 
34
   write/out "We have to execute the command STATISTICS/IMAGE first,"
 
35
   write/out "since the descriptor HISTOGRAM does not exist"
 
36
   ! for FITS files we use keywords instead of descr.
 
37
   if m$filtyp(in_a,"?fits") .eq. 1 then
 
38
      define/local fits__histogram/i/1/256 0 all +lower
 
39
      define/local fits__hist_bins/r/1/5 0.0 all +lower
 
40
      write/out (histogram not stored as descr. in {in_a})
 
41
   endif
 
42
   statistics/image {in_a} ? #256                ! build up histogram first
 
43
   write/keyw mid$cmnd/c/1/20 "{cmnd(1:20)}" 
 
44
endif
 
45
!
 
46
if mid$cmnd(1:1) .eq. "P" then    
 
47
   define/param p2 0.,0.,-999,-999 NUM
 
48
   @ plscoff.prg_o {P2}
 
49
   dattim = m$time()
 
50
else
 
51
   define/param p2 0.0 NUMBER
 
52
   write/keyw inputr/r/1/1 {p2}
 
53
endif
 
54
!
 
55
define/param   p4 "LIN"  C                         ! default scales
 
56
define/param   p5 0.0,-999999.,0.0 N               ! standard layout
 
57
write/keyw     inputc/c/1/2 {p3}
 
58
write/keyw     inputc/c/3/3 {p4}
 
59
write/keyw     inputr/r/2/3 {p5}
 
60
!
 
61
run MID_EXE:PLOTHBDF  
 
62
goto common_end
 
63
!
 
64
!
 
65
! handle tables
 
66
TABLES:
 
67
define/param p1 ? TBL "Enter table or frame name:"
 
68
define/param p4 "?,?,?"
 
69
define/param p5 "YY" C                             ! excess bin plotted
 
70
define/param p6 "LIN" C                            ! linear display
 
71
define/param p7 0.0,-999999.,0.0 N                 ! standard layout
 
72
!
 
73
write/keyw  in_a         {p1}
 
74
write/keyw  inputc/c/1/2 {p5}
 
75
write/keyw  inputc/c/3/3 {p6}
 
76
write/keyw  inputr/r/2/3 {p7}
 
77
!
 
78
define/local k1/i/1/1 0
 
79
define/local r1/c/1/20 "?"
 
80
define/local r2/c/1/20 "?"
 
81
define/local r3/c/1/20 "?"
 
82
define/local strike/c/1/60 {p4} 
 
83
!
 
84
k1 = m$index(strike,",")-1
 
85
if k1 .eq. -1 then
 
86
   r1 = "{strike}"
 
87
else
 
88
   r1 = "{strike(1:{k1})}"
 
89
   k1 = k1 + 2
 
90
   strike = "{strike({k1}:>)}"
 
91
   k1 = m$index(strike,",")-1
 
92
   if k1 .eq. -1 then
 
93
      r2 = "{strike}"
 
94
   else
 
95
      r2 = "{strike(1:{k1})}"
 
96
      k1 = k1 + 2
 
97
      r3 = "{strike({k1}:>)}"
 
98
   endif
 
99
endif
 
100
!
 
101
if mid$cmnd(1:1) .eq. "P" then
 
102
   define/param p3 0.,0.,-999,-999 NUM
 
103
   @ plscoff.prg_o {P3}
 
104
   dattim = m$time()
 
105
else
 
106
   define/param p3 0.0 NUMBER
 
107
   write/keyw inputr/r/1/1 {p3}
 
108
endif
 
109
!
 
110
@ t2stattbl {p1} {p2} {r1} {r2} {r3}
 
111
run MID_EXE:PLOTHTBL
 
112
 
113
 
114
common_end:
 
115
write/keyw plcdata/c/1/60  "{p1},HISTOGRAM"
 
116
write/keyw plcdata/c/61/20 "DESCRIPTOR"
 
117
copy/graph
 
118