1
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
2
!.IDENTIFICATION plothst.prg
3
!.PURPOSE Plot a histogram of image pixel or table values
5
! PLOT/HISTOGRAM table col-ref [scal_x,scal_y,off_x,off_y]
6
! [bin,[min,[max]]] [exc] [log] [opt]
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
14
!----------------------------------------------------------------------
16
define/local cmnd/c/1/20 "{mid$cmnd(1:20)}" !save initial command
18
!if mid$sess(7:7) .eq. " " .or. mid$sess(7:7) .eq. "-" then
20
! write/keyw mid$cmnd/c/1/20 "{cmnd(1:20)}" !reset MID$CMND
23
branch p2(1:1) :,# tables,tables ! test for column reference
26
define/param p1 ? IMA "Enter table or frame name:"
27
define/param p3 "YY" C ! excess bin plotted
31
define/local lola/i/1/1 0 !check, if HISTOGRAM descr. there
32
lola = m$existd(in_a,"HISTOGRAM")
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})
42
statistics/image {in_a} ? #256 ! build up histogram first
43
write/keyw mid$cmnd/c/1/20 "{cmnd(1:20)}"
46
if mid$cmnd(1:1) .eq. "P" then
47
define/param p2 0.,0.,-999,-999 NUM
51
define/param p2 0.0 NUMBER
52
write/keyw inputr/r/1/1 {p2}
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}
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
74
write/keyw inputc/c/1/2 {p5}
75
write/keyw inputc/c/3/3 {p6}
76
write/keyw inputr/r/2/3 {p7}
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}
84
k1 = m$index(strike,",")-1
88
r1 = "{strike(1:{k1})}"
90
strike = "{strike({k1}:>)}"
91
k1 = m$index(strike,",")-1
95
r2 = "{strike(1:{k1})}"
97
r3 = "{strike({k1}:>)}"
101
if mid$cmnd(1:1) .eq. "P" then
102
define/param p3 0.,0.,-999,-999 NUM
106
define/param p3 0.0 NUMBER
107
write/keyw inputr/r/1/1 {p3}
110
@ t2stattbl {p1} {p2} {r1} {r2} {r3}
115
write/keyw plcdata/c/1/60 "{p1},HISTOGRAM"
116
write/keyw plcdata/c/61/20 "DESCRIPTOR"