critical density
        :return: value in M_sol/Mpc^3
160338
def rho_crit(self):
        
        h = self.cosmo.H(0).value / 100.
        return 3 * h ** 2 / (8 * np.pi * const.G) * 10 ** 10 * const.Mpc / const.M_sun
284425
def _mdens(self,m):
        """"""
        return (self.a/m)**self.alpha/(1.+m/self.a)**(self.betaminusalpha)
535080
private static boolean checkCriticalValue(double score, int h, double aLevel, int p, int q) { //p and q are used only in ARIMA Models (p,0,q).
        double probability=ContinuousDistributions.chisquareCdf(score,h - p - q);

        boolean rejectH0=false;

        double a=aLevel;
        if(probability>=(1-a)) {
            rejectH0=true;
        }

        return rejectH0;
    }
681569
def D_s(self, H_0, Om0, Ode0=None):
        
        lensCosmo = self._get_cosom(H_0, Om0, Ode0)
        return lensCosmo.D_s
49575
def volume(self) -> float:
        
        m = self._matrix
        return float(abs(dot(np.cross(m[0], m[1]), m[2])))
515883
def _get_SRF_sigma(self, imt_per):
        
        if imt_per < 0.6:
            srf = 0.8
        elif 0.6 <= imt_per < 1:
            srf = self._interp_function(0.7, 0.8, 1, 0.6, imt_per)
        elif 1 <= imt_per <= 10:
            srf = self._interp_function(0.6, 0.7, 10, 1, imt_per)
        else:
            srf = 1

        return srf
97769
private static boolean checkCriticalValue(double score, int n, double aLevel) {
        boolean rejected=false;

        double criticalValue = Double.MAX_VALUE;
        
        double aLevelKey = aLevel;
        if(!CRITICAL_VALUES.containsKey(aLevelKey)) { //if the particular aLevel is not a default one take the closest one
            double significanceValue = 0.0;
            for(Map.Entry<Object, AssociativeArray> entry : CRITICAL_VALUES.entrySet()) {
                significanceValue = TypeInference.toDouble(entry.getKey());
                //AssociativeArray scoreList = entry.getValue();
                
                if(significanceValue<=aLevel) { //add the closest one
                    aLevelKey=significanceValue; 
                    break;
                }
            }
            
            if(!CRITICAL_VALUES.containsKey(aLevelKey)) { //it is possible that we still have not found a proper aLevel. This happens when the requested aLevel is close to 0.99999... In that case we take the largest (last)
                aLevelKey = significanceValue; //get the last available significance value on the CRITICAL_VALUES array
            }
        }

        
        if(CRITICAL_VALUES.containsKey(aLevelKey)) { //the aLevelKey is one of the standards, we can use the tables
            if(CRITICAL_VALUES.get(aLevelKey).containsKey(n)) { //if the n value exists within the table use the exact percentage
                criticalValue = CRITICAL_VALUES.get(aLevelKey).getDouble(n);
            }
            else {
                //the n is too large, use the approximation
                criticalValue=CRITICAL_VALUES.get(aLevelKey).getDouble(0);
                criticalValue/=Math.sqrt(n);
            }
        }


        if(score>criticalValue) {
            rejected=true; 
        }

        return rejected;
    }
1302506
def density(self, r, rho0, Ra, Rs):
        
        Ra, Rs = self._sort_ra_rs(Ra, Rs)
        rho = rho0 / ((1 + (r / Ra) ** 2) * (1 + (r / Rs) ** 2))
        return rho
579159
def crt(self, mp, mq):
        
        u = (mq - mp) * self.p_inverse % self.q
        return mp + (u * self.p)
1051168
private static boolean checkCriticalValue(double score, int n, int k, double aLevel) {
        double probability=ContinuousDistributions.fCdf(score,k-1,n-k);

        boolean rejectH0=false;

        if(probability<=aLevel || probability>=(1-aLevel)) {
            rejectH0=true;
        }

        return rejectH0;
    }
61954
def bm3_big_F(p, v, v0):
    
    f = bm3_small_f(v, v0)
    return cal_big_F(p, f)
394987
def _M(self, k, t, tips=None, gaps=None):
        """"""
        if self._distributionmodel:
            return self.model.M(k, t, tips, gaps)
        else:
            return self.model.M(t, tips, gaps)
892393
def roche_misaligned_critical_requiv(q, F, d, s, scale=1.0):
    
    volume_critical = libphoebe.roche_misaligned_critical_volume(q, F, d, s)
    logger.debug("libphoebe.roche_misaligned_critical_volume(q={}, F={}, d={}, s={}) => {}".format(q, F, d, s, volume_critical))

    requiv_critical = scale * (volume_critical * 3./4 * 1./np.pi)**(1./3)
    # logger.debug("roche.roche_misaligned_critical_requiv = {}".format(requiv_critical))

    return requiv_critical
595372
def get_densities(self, spin=None):
        
        if self.densities is None:
            result = None
        elif spin is None:
            if Spin.down in self.densities:
                result = self.densities[Spin.up] + self.densities[Spin.down]
            else:
                result = self.densities[Spin.up]
        else:
            result = self.densities[spin]
        return result
1039880
def density(self, value):
        
        self._density = float(value)
        self._cache.delete('mass_properties')
212611
def _getModelPosterior(self,min):
        
        Sigma = self._getLaplaceCovar(min)
        n_params = self.vd.getNumberScales()
        ModCompl = 0.5*n_params*sp.log(2*sp.pi)+0.5*sp.log(sp.linalg.det(Sigma))
        RV = min['LML']+ModCompl
        return RV
1076430
def _sigma_pi_midE(self, Tp):
        
        m_p = self._m_p
        Qp = (Tp - self._Tth) / m_p
        multip = -6e-3 + 0.237 * Qp - 0.023 * Qp ** 2
        return self._sigma_inel(Tp) * multip