C+ C NAME: C CvG2D C PURPOSE: C Convert from g^2 to normalized density nr^2 C CATEGORY: C Tomography C CALLING SEQUENCE: subroutine CvG2D(PWN,N,G2,DD) C INPUTS: C PWN real C N integer # values to be converted C N < 0 : check for bad values (BadR4()) C G2(N) real g^2 values C OUTPUTS: C DD(N) real normalized densities C CALLS: C BadR4 C PROCEDURE: C The relation between g^2 and normalized density: C G2 = DD^(2*PWN) C If N < then bad values in the output array will also be C bad in the output array. C MODIFICATION HISTORY: C MAY-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- real PWN integer N real G2(*) real DD(*) Bad = BadR4() P = 1./(2.*PWN) do I=1,abs(N) if (N .gt. 0 .or. G2(I) .ne. Bad) then DD(I) = G2(I)**P else DD(I) = Bad end if end do return end