1
C @(#)waves.for 19.1 (ES0-DMD) 02/25/03 13:24:48
2
C===========================================================================
3
C Copyright (C) 1995 European Southern Observatory (ESO)
5
C This program is free software; you can redistribute it and/or
6
C modify it under the terms of the GNU General Public License as
7
C published by the Free Software Foundation; either version 2 of
8
C the License, or (at your option) any later version.
10
C This program is distributed in the hope that it will be useful,
11
C but WITHOUT ANY WARRANTY; without even the implied warranty of
12
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
C GNU General Public License for more details.
15
C You should have received a copy of the GNU General Public
16
C License along with this program; if not, write to the Free
17
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
20
C Corresponding concerning ESO-MIDAS should be addressed as follows:
21
C Internet e-mail: midas@eso.org
22
C Postal address: European Southern Observatory
23
C Data Management Division
24
C Karl-Schwarzschild-Strasse 2
25
C D 85748 Garching bei Muenchen
27
C===========================================================================
30
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34
C Program WAVE version 1.00 860706
35
C version 2.00 890424 (pMIDAS)
37
C M. Peron IPG 890901 add include files
38
C P. Ballester IPG 910313 Compil. option -u
42
C Simulated images, test images.
45
C Create background "wave" image, given the amplitude, period, and
46
C dimensions of the image.
50
C Keys: OUT_A/C/1/60 output data array
51
C INPUTR/R/1/1 amplitude
53
C INPUTI/I/2/1 frame dimensions
55
C-----------------------------------------------------------
61
REAL STEPO(3),STARTO(3),CUTS(4)
62
DOUBLE PRECISION DSTEP(3), DSTART(3)
63
INTEGER NPIXO(3),MADRID,KUN,KNUL
68
INTEGER IACT,ISTAT,IDIM,NDIMO
73
INCLUDE 'MID_INCLUDE:ST_DEF.INC/NOLIST'
75
INCLUDE 'MID_INCLUDE:ST_DAT.INC/NOLIST'
83
C ... get name of output frame
85
CALL STKRDC('OUT_A',1,1,60,IACT,OUTIMA,KUN,KNUL,ISTAT)
87
C ... get amplitude, period, and frame dimensions.
89
CALL STKRDR('INPUTR',1,1,IACT,AMPL,KUN,KNUL,ISTAT)
90
CALL STKRDR('INPUTR',2,1,IACT,PERIOD,KUN,KNUL,ISTAT)
91
CALL STKRDI('INPUTI',1,1,IACT,IDIM,KUN,KNUL,ISTAT)
93
C ... map output image
103
IDENTO = ' ARTIFICIAL BACKGROUND WAVE IMAGE'
106
CALL STIPUT(OUTIMA,D_R4_FORMAT,F_O_MODE,F_IMA_TYPE,
107
. NDIMO,NPIXO,DSTART,
108
. DSTEP,IDENTO,CUNITO,JPNTR,IMNO,ISTAT)
110
C ... now do the work
112
CALL PATTERN(MADRID(JPNTR),RMIN,RMAX,AMPL,PERIOD,IDIM,ISTAT)
120
CALL STDWRR(IMNO,'LHCUTS',CUTS,1,4,KUNIT,ISTAT)
124
CALL STFCLO(IMNO,ISTAT)
128
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
133
C F. MURTAGH ST-ECF Version 1.0 860411
137
C Test patterns, simulated images.
143
C RMIN, RMAX = cut values (max. and min. flux values).
145
C----------------------------------------------------------------------
146
SUBROUTINE PATTERN(ARR,RMIN,RMAX,AMPL,PERIOD,IDIM,ISTAT)
151
INTEGER IDIM,ISTAT,NDIM1,NDIM2,I,J
153
REAL RMIN,RMAX,AMPL,PERIOD,ANGLE,PHASE
161
C (Mean, over one period, is 0 flux units per pixel.)
165
ANGLE = (2*3.1415926/PERIOD)*FLOAT(I) - PHASE
166
ARR(I,J) = AMPL*SIN(ANGLE)
170
C ------DETERMINE CUTS (I.E. MAX AND MIN VALUES)---------------------
176
IF (ARR(I,J).LT.RMIN) RMIN = ARR(I,J)
177
IF (ARR(I,J).GT.RMAX) RMAX = ARR(I,J)