Skip to content
Snippets Groups Projects
Commit 5fa7d531 authored by Mark Penney's avatar Mark Penney
Browse files

Update Intervals_Model.py

parent 6bd03c0f
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ Durmax = 145 ...@@ -34,7 +34,7 @@ Durmax = 145
# Truncate samples and return modulo 144 # Truncate samples and return modulo 144
def StartSample(N, Sparam): def StartSample(N, Sparam):
mean, sigma = Sparam mean, sigma = Sparam
Starts = random.normal(mean,sigma, size = N).astype(int) Starts = random.normal(mean,sigma, size = N).astype(int)%(Durmax-1)
return Starts return Starts
...@@ -55,7 +55,7 @@ def Coverage(S,E): ...@@ -55,7 +55,7 @@ def Coverage(S,E):
if S==E: if S==E:
return set() return set()
elif E < S: elif E < S:
SUP = [i for i in range(S, Durmax,1)] SUP = [i for i in range(S, Durmax-1,1)]
EDOWN = [i for i in range(0, E+1)] EDOWN = [i for i in range(0, E+1)]
return set(SUP + EDOWN) return set(SUP + EDOWN)
else: else:
...@@ -72,7 +72,7 @@ def TotDurSample(N, Sparam, durlist): ...@@ -72,7 +72,7 @@ def TotDurSample(N, Sparam, durlist):
S= Ints[i][j][0] S= Ints[i][j][0]
E = Ints[i][j][1] E = Ints[i][j][1]
Cov = Cov.union(Coverage(S,E)) Cov = Cov.union(Coverage(S,E))
out[i] = len(Cov) out[i] = len(Cov)-1
return out return out
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment