コード例 #1
0
ファイル: compute_lut_sz.py プロジェクト: wolfidan/cosmo_pol
def _compute_gautschi_canting(list_of_std):
    """
        Computes the quadrature points and weights for a list of standard
        deviations for the Gaussian distribution of canting angles
        Args:
            list_of_std: list of standard deviations for which a
                quadrature rule must be computed (one set of points and weights
                per standard deviation)
        Returns:
            A tuple, containing two lists, one with the quadrature points
            for every stdev, one with the quadrature weights for every
            stdev
    """
    scatt = Scatterer(radius=5.0)
    gautschi_pts = []
    gautschi_w = []
    for l in list_of_std:
        scatt.or_pdf = orientation.gaussian_pdf(std=l)
        scatt.orient = orientation.orient_averaged_fixed
        scatt._init_orient()
        gautschi_pts.append(scatt.beta_p)
        # Check if sum of weights if 1, if not set it to 1
        scatt.beta_w /= np.sum(scatt.beta_w)
        gautschi_w.append(scatt.beta_w)

    return (gautschi_pts, gautschi_w)
コード例 #2
0
def compute_gautschi_canting(list_of_std):
    scatt = Scatterer(radius = 5.0)
    
    gautschi_pts = []
    gautschi_w = []
    for l in list_of_std:
        scatt.or_pdf = orientation.gaussian_pdf(std=l)
        scatt.orient = orientation.orient_averaged_fixed
        scatt._init_orient()
        gautschi_pts.append(scatt.beta_p)
        gautschi_w.append(scatt.beta_w)
        
    return(gautschi_pts,gautschi_w)