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

« back to all changes in this revision

Viewing changes to applic/proc/genran.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 procedure genran.prg to implement CREATE/RANDOM_IMAGE
 
4
!  K. Banse     ESO - Garching  030707
 
5
!
 
6
!  execute via @a genran outfr ndim wcoo func_type coeffs seed
 
7
!  or          @a genran outfr = refima func_type coeffs seed
 
8
!
 
9
!  ndim = NAXIS,NPIX(1),NPIX(2),NPIX(3)
 
10
!  wcoo = START(1),...,STEP(3)
 
11
!  func_type = U(niform),U_opt       coeffs = lower,upper limits
 
12
!       U_opt = F(ibonnacci) for the lagged Fibonacci random generator
 
13
!       U_opt = S(tandard) for a standard normalized random generator
 
14
!                    G(aussian)      coeffs = mean,sigma
 
15
!  n.i.y.            E(xponential)
 
16
!  n.i.y.            L(ognormal)
 
17
!  n.i.y.            B(inomial)
 
18
!  n.i.y.            P(oisson)       coeffs = mean
 
19
!  n.i.y.            C(auchy)
 
20
!
 
21
!  seed = seed for the random generators
 
22
!  same seed yields same result in successive runs
 
23
!
 
24
!.VERSION
 
25
! 030714        last modif
 
26
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
27
!
 
28
define/param p1 ? ima "Enter result frame: "
 
29
write/keyw out_a {p1}
 
30
!
 
31
if p2(1:1) .ne. "=" then                ! dimensions given explicitly
 
32
   define/param p2 2,64,64 N  "Enter Naxis,Npix(1),Npix(2),... : "
 
33
   if {p2} .eq. 1 then
 
34
      define/param p3 0.,1. N "Enter Start(1),Step(1): "
 
35
   elseif {p2} .eq. 2 then
 
36
      define/param p3 0.,0.,1.,1. N "Enter Start(1),Start(2),Step(1),Step(2): "
 
37
   else
 
38
      define/param p3 0.,0.,0.,1.,1.,1. N -
 
39
      "Enter Start(1),Start(2),Start(3),Step(1),Step(2),Step(3): "
 
40
   endif
 
41
   define/local id/i/1/4 {p2}
 
42
   define/local rd/d/1/6 {p3}
 
43
   in_a = "+ "                          ! make sure, IN_A is set to "+"
 
44
else                                    ! REFIMA option
 
45
   define/param p3 ? ima "Enter reference frame: "
 
46
   write/keyw in_a {p3}
 
47
endif
 
48
!
 
49
outputi(1) = m$secs()/1237
 
50
!
 
51
define/param p4 UNIFORM C "Enter function type: "
 
52
define/param p5 0.,1. N "Enter coefficients: "
 
53
define/param p6 {outputi(1)} N "Enter seed value: "
 
54
!
 
55
write/keyw HISTORY "create/random "
 
56
define/local rcoeff/r/1/2 {p5}
 
57
define/local seed/i/1/1 {p6}
 
58
run MID_EXE:genran.exe
 
59