* Last processed by NICE on 12-Jun-2000 15:54:00
* Customized for :  IEEE, LINUX, UNIX, MOTIF, F77
C makplan_norm.f
*
      SUBROUTINE MNORM(MAPD,MAPW,ALIMIT,ALOWLT,BLANKING,NPOINT,CPJY)
*
      REAL*4   MAPD(1),MAPW(1)
      REAL*8   ALIMIT,ALOWLT
      REAL*4   BLANKING, CPJY
      INTEGER  NPOINT,I
*
      DO I=1,NPOINT
         IF (ABS(MAPD(I)-BLANKING) .GE. 0.5) THEN
            IF (MAPW(I).GE.ALIMIT .AND. MAPW(I).GE.ALOWLT) THEN
               MAPD(I) = MAPD(I)/MAPW(I)/CPJY
            ELSE
               MAPD(I) = BLANKING
               MAPW(I) = 0
            ENDIF
         ENDIF
      ENDDO
      RETURN
      END
*
      SUBROUTINE NORM_WEIGHT(MAPW,NPOINT,TAPER,XINC,YINC,TELESCOPE)
*
      REAL*4   MAPW(1)
      INTEGER  NPOINT
      INTEGER  TAPER
      INTEGER  I
      REAL     XINC,YINC                 ! pixel size in arcsec
      CHARACTER*(*) TELESCOPE
*
      REAL     SIZE_FACTOR
      SIZE_FACTOR = XINC*YINC/4.         ! factor 0.15, 0.17 computed for 2"*2"
      IF  (TELESCOPE(1:3).EQ.'CSO') THEN
         SIZE_FACTOR = SIZE_FACTOR*(857/243.*10./30.)**2   !
      ENDIF
*
      IF (TAPER.EQ.0) THEN               ! parabolic
         DO I=1,NPOINT
            MAPW(I) = MAPW(I)*0.15*SIZE_FACTOR
         ENDDO
      ELSEIF (TAPER.EQ.1) THEN           ! gaussian
         DO I=1,NPOINT
            MAPW(I) = MAPW(I)*0.15*SIZE_FACTOR
         ENDDO
      ELSEIF (TAPER.EQ.2) THEN           ! linear
         DO I=1,NPOINT
            MAPW(I) = MAPW(I)*0.17*SIZE_FACTOR
         ENDDO
      ELSEIF (TAPER.EQ.3) THEN           ! no taper
         DO I=1,NPOINT
            MAPW(I) = MAPW(I)*0.20*SIZE_FACTOR
         ENDDO
      ENDIF
      RETURN
      END
*
      SUBROUTINE NORM3(MAPD,MAPW,ALIMIT,ALOWLT,BLANKING,NPOINT)
*
      REAL*4   MAPD(1),MAPW(1)
      REAL*8   ALIMIT,ALOWLT
      REAL*4   BLANKING
      INTEGER  NPOINT,I
*
      DO I=1,NPOINT
         IF (ABS(MAPD(I)-BLANKING) .GE. 0.5) THEN
            IF (MAPW(I).GE.ALIMIT .AND. MAPW(I).GE.ALOWLT) THEN
               MAPD(I) = MAPD(I)*1000.
            ELSE
               MAPD(I) = BLANKING
               MAPW(I) = 0
            ENDIF
         ENDIF
      ENDDO
      RETURN
      END
*
      SUBROUTINE NORM_ABS(MAPD,MAPW,ALIMIT,ALOWLT,BLANKING,NPOINT,
     $CPJY)
*
      REAL*4   MAPD(1),MAPW(1)
      REAL*8   ALIMIT,ALOWLT
      REAL*4   BLANKING, CPJY
      INTEGER  NPOINT,I
*
      DO I=1,NPOINT
         IF (ABS(MAPD(I)-BLANKING) .GE. 0.5) THEN
            IF (ABS(MAPW(I)).GE.ALIMIT.AND.MAPW(I).GE.ALOWLT) THEN
               MAPD(I) = MAPD(I)/MAPW(I)/CPJY
            ELSE
               MAPD(I) = BLANKING
               MAPW(I) = 0
            ENDIF
         ENDIF
      ENDDO
      RETURN
      END
