/// <summary>
        /// Returns the steady state reflectance for the specified optical properties
        /// at source detector separations rhos.
        /// The radial distance rho is scaled to the reference space to evaluate rho_ref.
        /// If rho_ref is on the reference surface the reference rho-time resolved
        /// reflectance is scaled and the isoprametric Nurbs curve is integrated
        /// analitically  over time. To evaluate the integral of the reflectance out of
        /// the time range it evaluates the linear approximation of the logarithm of
        /// the tail of the curve and integrates it from tMax to infinity.
        /// If rho_ref is out of range the method returns 0.
        /// </summary>
        /// <param name="ops">optical properties</param>
        /// <param name="rhos">source detector separation</param>
        /// <returns>space resolved reflectance</returns>
        public override IEnumerable <double> ROfRho(IEnumerable <OpticalProperties> ops, IEnumerable <double> rhos)
        {
            double scalingFactor;
            double rho_ref;
            double integralValue;

            foreach (var op in ops)
            {
                scalingFactor = GetScalingFactor(op, 2);

                foreach (var rho in rhos)
                {
                    rho_ref = rho * op.Musp / _opReference.Musp;
                    double exponentialTerm = op.Mua * v * _opReference.Musp / op.Musp;

                    if (rho_ref <= _rdGenerator.SpaceValues.MaxValue && rho_ref >= 0)
                    {
                        integralValue  = _rdGenerator.EvaluateNurbsCurveIntegral(rho_ref, exponentialTerm);
                        integralValue += ExtrapolateIntegralValueOutOfRange(_rdGenerator, rho_ref, op);
                        integralValue  = CheckIfValidOutput(integralValue);
                        yield return(integralValue * scalingFactor);
                    }
                    else
                    {
                        yield return(0.0);
                    }
                }
            }
        }
        /// <summary>
        /// Returns the spatial frequancy resolved reflectance at fx applying the scaling on
        /// the reference fx-time resolved reflectance.
        /// Than integrates analitically the isoprametric NURBS curve over time if fx is on the
        /// surface.
        /// If fx is out of range it returns 0.
        /// </summary>
        /// <param name="ops">optical properties</param>
        /// <param name="fxs">spatial frequency</param>
        /// <returns>spatial frequency resolved reflectance</returns>
        public override IEnumerable <double> ROfFx(IEnumerable <OpticalProperties> ops, IEnumerable <double> fxs)
        {
            double fx_ref;
            double integralValue;

            foreach (var op in ops)
            {
                foreach (var fx in fxs)
                {
                    fx_ref = fx * _opReference.Musp / op.Musp;
                    double exponentialterm = op.Mua * v * _opReference.Musp / op.Musp;

                    if (fx_ref <= _sfdGenerator.SpaceValues.MaxValue && fx_ref >= 0.0)
                    {
                        integralValue = _sfdGenerator.EvaluateNurbsCurveIntegral(fx_ref, exponentialterm);
                        integralValue = CheckIfValidOutput(integralValue);
                        yield return(integralValue);
                    }
                    else
                    {
                        yield return(0.0);
                    }
                }
            }

            //foreach (var op in ops)
            //{
            //    double[] time = _sfdGenerator.NativeTimes;
            //    for (int i = 0; i < time.Length; i++)
            //    {
            //        time[i] = time[i] * _opReference.Musp / op.Musp;
            //    }
            //    var deltaT = GetDeltaT(time);
            //    foreach (var fx in fxs)
            //    {
            //        double integralValue = 0.0;
            //        var ROfT = ROfFxAndTime(op.AsEnumerable(), fx.AsEnumerable(), time).ToArray();
            //        for (int i = 0; i < ROfT.Length; i++)
            //        {
            //            integralValue += ROfT[i] * deltaT[i];
            //        }
            //        yield return integralValue;
            //    }
            //}
        }