C+ C NAME: C t3d_grid2_fnc C PURPOSE: C Defines statement function for conversion between heliographic coordinates C and array index and v.v. in tomography program. C PROCEDURE: C nLng, nLat, nRad and nTim are usually pulled out of the t3d array. C C Each of the conversions is a linear transformation from C range [xb,xe] to [yb,ye]. C For all index ranges the start value is 0.5 and the end value is C N+0.5, covered by N steps. C- rfnc(x, xb,xe,yb,ye) = (ye*(x-xb)-yb*(x-xe))/(xe-xb) rCarI(A) = rfnc( A , Cbeg, Cend, 0.5, nLng+0.5 ) rCarA(I) = rfnc( float(I), 0.5, nLng+0.5, Cbeg, Cend ) rModC(A) = Cbeg+mod(mod(A-Cbeg,Cend-Cbeg)+(Cend-Cbeg),Cend-Cbeg) rLngI(A) = rfnc( A , 0.0, 360.0 , 0.5, nLng+0.5 ) rLngA(I) = rfnc( float(I), 0.5, nLng+0.5, 0.0, 360.0 ) rModL(A) = mod( mod( A, 360.0 )+360.0, 360.0 ) rLatI(A) = rfnc( A ,-90.0, 90.0 , 0.5, nLat+0.5 ) rLatA(I) = rfnc( float(I), 0.5, nLat+0.5,-90.0, 90.0 ) rRadI(A) = rfnc( A , Rbeg, Rend , 0.5, nRad+0.5 ) rRadA(I) = rfnc( float(I), 0.5, nRad+0.5, Rbeg, Rend ) rTimI(A) = rfnc( A , Tbeg, Tend , 0.5, nTim+0.5 ) rTimA(I) = rfnc( float(I), 0.5, nTim+0.5, Tbeg, Tend )