コード例 #1
0
ファイル: SHT.py プロジェクト: kte608/MagnetoShim
def factorial(n):
    """Computes the factorial of n"""
    if n == 0:
        return 1

    result = 1
    for i in inclusive_range(2, n):
        result = result * i
    return result
コード例 #2
0
ファイル: SHT_Points.py プロジェクト: cjwiggins/MagnetoShim
def declination_measurement_points(bandwidth):
    """This function returns a list of declination angles in
    radians where measurements should be made if the
    transform has a certain bandwidth"""
    thetas=[pi*(2*j+1)/(4*bandwidth) for j in inclusive_range(0,2*bandwidth-1)]
    return thetas
コード例 #3
0
ファイル: SHT_Points.py プロジェクト: cjwiggins/MagnetoShim
def azimuthal_measurement_points(bandwidth):
    """This function returns a list of azimuthal angles in
    radians where measurements should be made if the
    transform has a certain bandwidth"""
    phis=[2*pi*k/(2*bandwidth) for k in inclusive_range(0,2*bandwidth-1)]
    return phis