* Last processed by NICE on 12-Jun-2000 15:54:00 * Customized for : IEEE, LINUX, UNIX, MOTIF, F77 * makplan_azcon.f C C SUBROUTINE AZCON(ROW_D,ROW_W,DATAR,XCOORD,NP_SUBSCAN,IFUN) C C************************************************************** C This subroutine convolves the data from datar, so as to * C filter and regrid the data in azimuth, and places the * C resultant subscan into the array row_d C C C Input: C datar : raw data area C xgrid : x coordinates = XCOORD C np_subscan : number of records * number of dumps C func : convolving function ( ~ sin(x)/x ) C C Output: C row_d : filtered data C row_w : sum of weight C C************************************************************** * C INCLUDE 'const.inc' INCLUDE 'parameter.inc' INCLUDE 'makplan.inc' C C REAL*4 ROW_D(1) ! regridded row : data (output) REAL*4 ROW_W(1) ! regridded row : weight (output) C REAL*4 DATAR(1) ! raw data for this subscan REAL*4 XCOORD(1) ! relative position in azimuth for this C INTEGER NP_SUBSCAN ! number of points in the subscan C C REAL*8 FUNWID,TOTWID INTEGER IFIRST,ILAST,I,J,IFUNC,IFUN REAL*8 POS, MAGI, DIAMETER REAL*8 X,Z * * Raz row DO I=1,NCOL ROW_D(I) = 0 ROW_W(I) = 0 ENDDO C C C C The unit length of the new grid is XINC C Compute function window width in the new system unit : C funwid = lambda/(1.67*diam_telescope)/xinc C funwid = 1.34 if freq=230ghz, diam_telescope=30m and xinc=4arcsec C C MAGI = 0 IF (IFUN.EQ.1) MAGI = 1.6806492007530D0 ! Parabolic IF (IFUN.EQ.2) MAGI = 1.6982249549743D0 ! Gaussian IF (IFUN.EQ.3) MAGI = 1.8363197305085D0 ! Linear IF (MAGI.EQ.0) MAGI = 1.6574002064571D0 ! No taper * DIAMETER = 30 IF (TELESCOPE(1:3).EQ.'CSO') DIAMETER = 10 IF (TELESCOPE(1:3).EQ.'HHT') DIAMETER = 10 FUNWID = VLIGHT/FREQUENCY /(MAGI*DIAMETER) $/(XINC*SEC_TO_RAD) C IF ( FUNWID.LT.1.D0) FUNWID = 1.D0 C TOTWID = 4D0 * FUNWID ! total window width C C C Add contribution of each point of subscan to the pixels of the new grid C This contribution is multiplied by a weight depending on the distance C DO I = 1, NP_SUBSCAN IF (ABS(DATAR(I)-BLANKING).GT.0.5D0) THEN ! test blanking C * compute pos = coordinates of subscan point in the new grid POS = (XCOORD(I)/10.+ABS(XMIN))/XINC + 1.D0 C IFIRST = POS - TOTWID + 1.D0 ! first point of new grid to consider ILAST = POS + TOTWID ! last point of new grid to consider C IF (IFIRST.LT.1) IFIRST = 1 IF (ILAST .GT.NCOL) ILAST = NCOL C DO J = IFIRST, ILAST X = DBLE(J) - POS ! distance between "j" and subscan poi X = ABS(X)/FUNWID ! convert in function unit IFUNC = NINT(5D1*X) + 1 Z = FUNC(IFUNC) C ROW_D(J) = ROW_D(J) + DATAR(I)*Z! data*weight ROW_W(J) = ROW_W(J) + Z ! weight ENDDO C ENDIF ENDDO C C Divide by the total weight C DO J = 1, NCOL IF (ROW_W(J) .GT. 1.D-10) THEN ROW_D(J) = ROW_D(J) / ROW_W(J) ELSE ROW_D(J) = BLANKING ROW_W(J) = 0 ENDIF ENDDO C C END