src/ztransform.c
float z2dm(float z, 
					 float omega0,
					 float omegal0)
{
	unsigned long i, ip1;
	float sz,dm;

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

	k_locate(zrf_z, ZRF_NUM, (float)z, &i);
	if(i==ZRF_NUM || i==ZRF_NUM-1) i=ZRF_NUM-2;
	if(i==-1) i=0;
	ip1=i+1;
	sz=z-zrf_z[i];
	dm=(zrf_dm[i]+sz*(zrf_dm[ip1]-zrf_dm[i])/(zrf_z[ip1]-zrf_z[i]));
	return(dm);
}
/* Converts redshift z into distance modulus dm */
Converts redshift z into distance modulus dm
Converts redshift z into distance modulus dm
float z2dm(float z, 
					 float omega0,
					 float omegal0)
{
	unsigned long i, ip1;
	float sz,dm;
	if(!zrf_initialized || omega0!=zrf_omega0 || omegal0!=zrf_omegal0) 
		init_zrf(omega0, omegal0);
	k_locate(zrf_z, ZRF_NUM, (float)z, &i);
	if(i==ZRF_NUM || i==ZRF_NUM-1) i=ZRF_NUM-2;
	if(i==-1) i=0;
	ip1=i+1;
	sz=z-zrf_z[i];
	dm=(zrf_dm[i]+sz*(zrf_dm[ip1]-zrf_dm[i])/(zrf_z[ip1]-zrf_z[i]));
	return(dm);
}
float z2dm ( float z , float omega0 , float omegal0 ) { unsigned long i , ip1 ; float sz , dm ; if ( ! zrf_initialized || omega0 != zrf_omega0 || omegal0 != zrf_omegal0 ) init_zrf ( omega0 , omegal0 ) ; k_locate ( zrf_z , ZRF_NUM , ( float ) z , & i ) ; if ( i == ZRF_NUM || i == ZRF_NUM - 1 ) i = ZRF_NUM - 2 ; if ( i == -1 ) i = 0 ; ip1 = i + 1 ; sz = z - zrf_z [ i ] ; dm = ( zrf_dm [ i ] + sz * ( zrf_dm [ ip1 ] - zrf_dm [ i ] ) / ( zrf_z [ ip1 ] - zrf_z [ i ] ) ) ; return ( dm ) ; }
Converts redshift z into distance modulus dm
Converts redshift z into distance modulus dm