You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""" Function which formats matrix for a particular subject and particular block (thresholds, upper-tris it) so that we can make a graph object out of it
40
+
41
+
Parameters:
42
+
-----------
43
+
data = full data array
44
+
s = subject
45
+
b = block
46
+
lk = lookup table for study
47
+
co = cost value to threshold at
48
+
"""
49
+
50
+
cmat=data[sc,c,s]
51
+
th=cost2thresh2(co,s,sc,c,lk,[]) #get the right threshold
52
+
53
+
#cmat = replace_diag(cmat) #replace diagonals with zero
"""A definition for loading the lookup table and finding the threshold associated with a particular cost for a particular subject in a particular block
435
+
436
+
inputs:
437
+
cost: cost value for which we need the associated threshold
438
+
sub: subject number
439
+
bl: block number
440
+
lk: lookup table (block x subject x cost
441
+
last: last threshold value
442
+
443
+
output:
444
+
th: threshold value for this cost"""
445
+
446
+
#print cost,sub,bl
447
+
448
+
ind=np.where(lk[sc,c,sub][1]==cost)
449
+
th=lk[sc,c,sub][0][ind]
450
+
451
+
iflen(th)>1:
452
+
th=th[0] #if there are multiple thresholds, go down to the lower cost ####Is this right?!!!####
453
+
print'multiple thresh'
454
+
eliflen(th)<1:
455
+
th=last#if there is no associated thresh value because of repeats, just use the previous one
456
+
print'use previous thresh'
457
+
else:
458
+
th=th[0]
459
+
460
+
#print th
461
+
returnth
409
462
410
463
defnetwork_ind(ntwk_type,n_nodes):
411
464
"""Reads in a network type, number of nodes total and returns the indices of that network"""
0 commit comments