Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump Probability with Greyscale Images #24

Merged
merged 11 commits into from
Jun 15, 2023
Prev Previous commit
Next Next commit
add another grey example
  • Loading branch information
TomTranter committed May 14, 2020
commit ac146ee77d11480f810d4e0d8bdd8afcf68b7f00
30 changes: 30 additions & 0 deletions multi_grey.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 24 10:51:10 2020

@author: Tom
"""

import pytrax as pt
import numpy as np
import matplotlib.pyplot as plt
plt.close('all')

if __name__ == '__main__':
im = np.ones([1000, 1000])
# Number of time steps and walkers
num_t = 10000
num_w = 800
stride = 1
grey_vals = np.logspace(-1, 1, 10)
tau = []
for grey_val in grey_vals:
grey = im.copy()
grey = grey.astype(float)
grey[grey == 1.0] = grey_val
rw = pt.RandomWalk(grey, seed=False)
rw.run(num_t, num_w, same_start=False, stride=stride, num_proc=1)
rw.plot_msd()
tau.append(rw.data['axis_0_tau'])
plt.figure()
plt.loglog(grey_vals, tau)