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

« back to all changes in this revision

Viewing changes to contrib/invent/libsrc/corpsf.for

  • 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
C @(#)corpsf.for        19.1 (ES0-DMD) 02/25/03 13:25:32
 
2
C===========================================================================
 
3
C Copyright (C) 1995 European Southern Observatory (ESO)
 
4
C
 
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.
 
9
C
 
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.
 
14
C
 
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, 
 
18
C MA 02139, USA.
 
19
C
 
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 
 
26
C                       GERMANY
 
27
C===========================================================================
 
28
C
 
29
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
30
C
 
31
C
 
32
C
 
33
C
 
34
C
 
35
C-----------------------------------------------------------------------
 
36
      SUBROUTINE CORPSF(LPXL, LSBP, LL, CPSF, IPSF,
 
37
     &                  CRMD, BPSF, DPSF)
 
38
C
 
39
      IMPLICIT  NONE
 
40
      INCLUDE   'MID_REL_INCL:INVENT.INC/NOLIST'
 
41
C
 
42
      INTEGER   LPXL
 
43
      INTEGER   LSBP
 
44
      INTEGER   LL
 
45
      REAL      CPSF((-LPXL):LPXL,(-LPXL):LPXL,(-LSBP):LSBP,
 
46
     &               (-LSBP):LSBP,NOSP)
 
47
      INTEGER   IPSF((-LSBP):LSBP,(-LSBP):LSBP)
 
48
      REAL      CRMD(3)
 
49
      REAL      BPSF((-LL):LL,(-LL):LL)
 
50
      REAL      DPSF((-LL):LL,(-LL):LL)
 
51
C
 
52
      INTEGER   I, II
 
53
      INTEGER   IT, IK
 
54
      INTEGER   ISTAT
 
55
      INTEGER   ITMP
 
56
      INTEGER   J
 
57
      INTEGER   JL
 
58
      INTEGER   K
 
59
      INTEGER   L
 
60
C
 
61
      REAL      AIT
 
62
C     REAL      SIGMA
 
63
C
 
64
      REAL   TEMP(NOSP)
 
65
C
 
66
      CHARACTER*80   OUTPUT
 
67
C
 
68
      IT = 0
 
69
      DO 10 L = -LSBP , LSBP
 
70
          DO 20 K = -LSBP , LSBP
 
71
              ITMP = IPSF(K,L)
 
72
              IT = IT + ITMP
 
73
              DO 30 J = -LPXL , LPXL
 
74
                  JL = J * (2*LSBP+1) - L
 
75
                  DO 40 I = -LPXL , LPXL
 
76
                      IK = I * (2*LSBP+1) - K
 
77
                      DO 50 II = 1 , ITMP
 
78
                          TEMP(II) = CPSF(I,J,K,L,II)
 
79
   50                 CONTINUE
 
80
                      IF ( ITMP .GT. 2 ) THEN
 
81
                          CALL MODE( TEMP , ITMP , CRMD , BPSF(IK,JL) ,
 
82
     &                               DPSF(IK,JL) )
 
83
                          IF ( ITMP .EQ. 3 ) THEN
 
84
                              DPSF(IK,JL) = 1.5 * DPSF(IK,JL)
 
85
                          ENDIF
 
86
                      ELSE IF ( ITMP .EQ. 2 ) THEN
 
87
                          BPSF(IK,JL) = ( TEMP(1) + TEMP(2) ) / 2.0
 
88
                          DPSF(IK,JL) = MAX(0.1,ABS(TEMP(1)-TEMP(2)))
 
89
                      ELSE IF ( ITMP .EQ. 1 ) THEN
 
90
                          BPSF(IK,JL) = TEMP(1)
 
91
                          DPSF(IK,JL) = 1.0
 
92
                      ELSE
 
93
                          BPSF(IK,JL) = 0.0
 
94
                          DPSF(IK,JL) = 10.0
 
95
                      ENDIF
 
96
   40             CONTINUE
 
97
   30         CONTINUE
 
98
   20     CONTINUE
 
99
   10 CONTINUE
 
100
      AIT = FLOAT(IT) / FLOAT((2*LSBP+1)**2)
 
101
      WRITE( OUTPUT , '(A,A,F7.2)' ) 'Average number of standard stars '
 
102
     &               ,'per subpixel =',AIT
 
103
      CALL STTPUT( OUTPUT , ISTAT )
 
104
C
 
105
      RETURN
 
106
C
 
107
      END