src/ztransform.c
float rtoz(float r, 
					 float omega0,
					 float omegal0)
{
	unsigned long i,ip1;
	float sr,z;

	if(!zrf_initialized || omega0!=zrf_omega0 || omegal0!=zrf_omegal0) 
		init_zrf(omega0, omegal0);

	k_locate(zrf_r, ZRF_NUM, r, &i);
	if(i==ZRF_NUM || i==ZRF_NUM-1) i=ZRF_NUM-2;
	if(i==-1) i=0;
	ip1=i+1;
	sr=r-zrf_r[i];
	z=zrf_z[i]+sr*(zrf_z[ip1]-zrf_z[i])/(zrf_r[ip1]-zrf_r[i]);
	return(z);
}
/* Converts comoving distance r in km/s to redshift z */
Converts comoving distance r in km/s to redshift z
Converts comoving distance r in km / s to redshift z
float rtoz(float r, 
					 float omega0,
					 float omegal0)
{
	unsigned long i,ip1;
	float sr,z;
	if(!zrf_initialized || omega0!=zrf_omega0 || omegal0!=zrf_omegal0) 
		init_zrf(omega0, omegal0);
	k_locate(zrf_r, ZRF_NUM, r, &i);
	if(i==ZRF_NUM || i==ZRF_NUM-1) i=ZRF_NUM-2;
	if(i==-1) i=0;
	ip1=i+1;
	sr=r-zrf_r[i];
	z=zrf_z[i]+sr*(zrf_z[ip1]-zrf_z[i])/(zrf_r[ip1]-zrf_r[i]);
	return(z);
}
float rtoz ( float r , float omega0 , float omegal0 ) { unsigned long i , ip1 ; float sr , z ; if ( ! zrf_initialized || omega0 != zrf_omega0 || omegal0 != zrf_omegal0 ) init_zrf ( omega0 , omegal0 ) ; k_locate ( zrf_r , ZRF_NUM , r , & i ) ; if ( i == ZRF_NUM || i == ZRF_NUM - 1 ) i = ZRF_NUM - 2 ; if ( i == -1 ) i = 0 ; ip1 = i + 1 ; sr = r - zrf_r [ i ] ; z = zrf_z [ i ] + sr * ( zrf_z [ ip1 ] - zrf_z [ i ] ) / ( zrf_r [ ip1 ] - zrf_r [ i ] ) ; return ( z ) ; }
Converts comoving distance r in km/s to redshift z
Converts comoving distance r in km / s to redshift z