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

« back to all changes in this revision

Viewing changes to prim/proc/rebstat.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
! @(#)rebstat.prg       19.1 (ESO-DMD) 02/25/03 14:09:00
 
2
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!
 
4
! MIDAS procedure rebstat.prg
 
5
! K. Banse      980921, 990117
 
6
! execute via:  REBIN/STATISTICS in out xpix,ypix stat_quantity 
 
7
!
 
8
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
9
!
 
10
define/param p1 ? IMA "Enter input frame: "
 
11
define/param p2 rebstat IMA "Enter output frame: "
 
12
define/param p3 8,8 n "Enter xpix,ypix for new pixel:"
 
13
define/parameter p4 mean ? "Enter statistical value for result image:"
 
14
 
15
define/local myframe/c/1/100 {p1}
 
16
define/local myres/c/1/100 {p2}
 
17
 
18
set/format i1
 
19
define/local tpix/i/1/2 {p3},{p3}               !ensure x + y value
 
20
define/local mynax/i/1/1 1
 
21
mynax = m$value({myframe},naxis)
 
22
if mynax .lt. 2 tpix(2) = 1
 
23
 
24
define/local mycomnd/c/1/80 "REBIN/STATISTICS " ? +lower
 
25
inputc(1:) = myframe // " {myres}"
 
26
outputc(1:1) = " "
 
27
outputc(2:) = "{p3} " // " {p4}"
 
28
mycomnd(1:) = mycomnd(1:17)//inputc//outputc
 
29
 
30
! choose statistics option
 
31
branch  p4(1:3) MIN,MAX,MOM,MOD,MED MINMAX,MINMAX,MOMENT,MODE,MEDIAN
 
32
action(1:2) = "sn"              !that's needed for MEAN, STD
 
33
goto run_it
 
34
minmax:
 
35
action = "mn"
 
36
goto run_it
 
37
moment:
 
38
action = "rn"
 
39
goto run_it
 
40
mode:
 
41
action = "hn"
 
42
goto run_it
 
43
median:
 
44
action = "xn"
 
45
!  
 
46
run_it:
 
47
statist/image {myframe} [{tpix(1)}x{tpix(2)}] ? ? {action(1:2)} -
 
48
              {myres},image,{p4}
 
49
 
50
if mynax .eq. 1 then                    !1-dim input frame
 
51
   {myres},npix(1) = m$value({myres},intvals(3))
 
52
   {myres},start(1) = m$value({myframe},start(1))
 
53
   {myres},step(1) = tpix(1)*m$value({myframe},step(1))
 
54
else
 
55
   {myres},naxis = 2
 
56
   {myres},npix(1) = m$value({myres},intvals(3))
 
57
   {myres},npix(2) = m$value({myres},intvals(4))
 
58
   {myres},start(1) = m$value({myframe},start(1))
 
59
   {myres},start(2) = m$value({myframe},start(2))
 
60
   {myres},step(1) = tpix(1)*m$value({myframe},step(1))
 
61
   {myres},step(2) = tpix(2)*m$value({myframe},step(2))
 
62
endif
 
63