コード例 #1
0
    #     return False
    if koncnaResitev1 > nStars:
        return False, False
    '''
    return koncnaResitev1, koncnaResitev0 / resitev1


# divide Lmax scale
numHorSec = 48  # on how many parts should we devide L - how many different Lmax should we take
noIterationsPerMaxL = 50000  # How many points N per each file/maxL - should be as big as possible  ##trenutno 1000, da jih hitreje generira

logPoints = np.linspace(
    2, 10, numHorSec)  # divide on numHorSec equal parts a scale from 2 to 10 -

# for each Lmax create a file with points
for maxL in logPoints:
    array = []
    array1 = []
    type_dist = "loguniform"
    for _ in range(0, noIterationsPerMaxL):
        point, nrsettlements = getPoint(maxL, type_dist)
        if type(point) != type(False):
            array.append(point)
            array1.append(nrsettlements)

    saveData(array, "/inf_" + type_dist + "_" + str(maxL))
    #saveData(array1, "/inf_" + type_dist + "_settlements_" + str(maxL))
    print("File: inf_" + type_dist + "_" + str(maxL) + ".txt created")

print('done')
コード例 #2
0
    # x.append(astrophysicsProbability) #from our distribution calculated distribution
    # y.append(astrophysicsProbability2)  #from our distribution
    return resitev


drawnPoints = 0
numHorSec = 48
noIterationsPerMaxN = 20000
logPoints = np.linspace(0, 4, numHorSec)
allPoints = noIterationsPerMaxN * numHorSec

fixed_n = [1, 10, 100, 1000, 10000]

for maxN in logPoints:
    # for maxN in fixed_n:
    array = []
    for i in range(0, noIterationsPerMaxN):
        point = getPoint(maxN)
        if type(point) != type(False):
            array.append(point)

    saveData(array, "inf" + str(maxN))
    print("File: inf" + str(maxN) + ".txt created. no of points:" +
          str(len(array)))
    drawnPoints = drawnPoints + len(array)
    pointFraction = (drawnPoints * 100) / allPoints
print('done')
print('Drawn points: ' + str(drawnPoints) + '  Which is: ' +
      str(pointFraction) + '%')
コード例 #3
0
    return resitev


# devide Lmax scale
numHorSec = 48  # on how many parts should we devide L - how many different Lmax should we take
noIterationsPerMaxL = 50000  # How many points N per each file/maxL - should be as big as possible  ##trenutno 1000, da jih hitreje generira
logPoints = np.linspace(2, 10, numHorSec)  # devide on numHorSec equal parts a scale from 2 to 10 -
# x = []
# y=[]

# for each Lmax create a file with points
for maxL in logPoints:
    array = []
    for _ in range(0, noIterationsPerMaxL):
        point = getPoint(maxL)
        if type(point) != type(False):
            array.append(point)

    saveData(array, "/inf" + str(maxL))
    print("File: inf" + str(maxL) + ".txt created")
'''
#for checking fLife
x = np.array(x)
y = np.array(y)
plt.hist(x,np.linspace(-3,3,100),facecolor='blue',alpha=0.75)
#plt.show()
plt.hist(y,np.linspace(-3,3,100),facecolor='orange',alpha=0.5)
plt.show()
'''
print('done')
コード例 #4
0
        # return getPoint(maxL)
        return False
    '''

    if resitev < -6:
        return False
    return 10**resitev


# divide Lmax scale
drawnPoints = 0
numHorSec = 20  # on how many parts should we divide L - how many different Lmax should we take
noIterationsPerMaxL = 5000000  # How many points N per each file/maxL - should be as big as possible  ##trenutno 1000, da jih hitreje generira
# logPoints = np.linspace(2, 10, numHorSec)  # divide on numHorSec equal parts a scale from 2 to 10 -
# allPoints = noIterationsPerMaxL * numHorSec

# for each Lmax create a file with points
# for maxL in logPoints:
array = []
for _ in range(0, noIterationsPerMaxL):
    point = getPoint()
    if type(point) != type(False):
        array.append(point)

saveData(array, "/N_Sandberg_no_cut")
# print("File: inf" + str(maxL) + ".txt created. Size: " + str(len(array)))
# drawnPoints = drawnPoints + len(array)
# pointFraction = (drawnPoints * 100) / allPoints
print('done')
# print('Drawn points: ' + str(drawnPoints) + '  Which is: ' + str(pointFraction) + '%')