C+ C NAME: C CvD2G C PURPOSE: C Convert between normalized density nr^2 and g^2 C CATEGORY: C Tomography C CALLING SEQUENCE: subroutine CvD2G(PWN,N,DD,G2) C INPUTS: C PWN real C N integer # values to be converted C N < 0 : check for bad values (BadR4()) C DD(N) real normalized densities C OUTPUTS: C G2(N) real g^2 values 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 DD(*) real G2(*) Bad = BadR4() P = 2*PWN do I=1,abs(N) if (N .gt. 0 .or. DD(I) .ne. Bad) then G2(I) = DD(I)**P else G2(I) = Bad end if end do return end