source: trunk/fsource/spotmask.for @ 4934

Last change on this file since 4934 was 3106, checked in by vondreele, 8 years ago

new fortran routine for processing spot masks
fix to SConstruct - remove -m64

File size: 762 bytes
Line 
1      SUBROUTINE SPOTMASK(N,X,Y,M,SPOTS,MASK)
2
3Cf2py intent(in) N
4Cf2py intent(in) X
5Cf2py depend(N) X
6Cf2py intent(in) Y
7Cf2py depend(N) Y
8Cf2py intent(in) M
9Cf2py intent(in) SPOTS
10Cf2py depend(M) SPOTS
11Cf2py intent(in,out) MASK
12
13      IMPLICIT NONE
14      INTEGER*4    N,M
15      REAL*4       X(0:N-1),Y(0:N-1)
16      REAL*8       SPOTS(0:M-1,0:2)
17      LOGICAL*1    MASK(0:1024*1024-1)
18
19      INTEGER*4    I,K
20      REAL*4       XYRAD2,XINTERS
21     
22      DO K=0,N-1
23        MASK(K) = .FALSE.
24        DO I=0,M-1
25          XYRAD2 = (X(K)-SPOTS(I,0))**2+(Y(K)-SPOTS(I,1))**2
26          IF ( XYRAD2 .LE. SPOTS(I,2) ) THEN
27                  MASK(K) = .NOT.MASK(K)
28          END IF
29        END DO
30      END DO
31
32      RETURN
33      END
Note: See TracBrowser for help on using the repository browser.