<jupyter_start><jupyter_text>Single individual with daily activity pattern<jupyter_code>day_steps=24*30
dt=1.0/day_steps
N=int(60*day_steps) # run for 60 days

sigma=np.zeros((N,2))
sigma[:,1]=1
sigma[:,0]=1

revert= 12*np.ones((N,2))
T = np.arange(N)/day_steps
b=5
window_len=50
w=np.ones(window_len,'d')
active = 1-0.5*1.0*(signal.square(2 * np.pi *T,duty=0.4) - signal.square(2 * np.pi *T,duty=0.7))
active2 = 1 + np.sqrt((1+b**2)/(1+np.cos(2 * np.pi *T)**2*b**2)) *np.cos(2 * np.pi *T)# - signal.square(2 * np.pi/365. *T,duty=0.7))

filtwidth=20
active = gaussian_filter1d(active, filtwidth)

#active = np.ones_like(active)
#smoothed=np.convolve(w/w.sum(),active,mode='valid')
#active[window_len//2-1:-window_len//2]=smoothed
sigma[:,0]=active
sigma[:,1]=active

mean_p = np.zeros((N,2))
X=generateOU(N,dt,mean_p,revert,sigma)

plt.plot(T,X[::1,0])
plt.title('OU process - X coordinate')
plt.show()

plt.plot(T,X[::1,1])
plt.title('OU process - Y coordinate')
plt.show()

plt.plot(X[::1,0],X[::1,1])
plt.title('OU process - XY')
plt.show()

plt.plot(T,active)
plt.title('OU process - timescale parameter')
plt.show()
dataset = pd.DataFrame({'Animal':np.zeros_like(T),
                        'Date':pd.to_datetime(T, unit='D', origin=pd.Timestamp('2018-01-01')),
                        'Time':pd.to_datetime(pd.to_datetime(T, unit='D', origin=pd.Timestamp('2018-01-01')), format='%H:%M').time,
                        'Latitude':X[::,0],
                        'Longitude':X[::,1],'Lengthscale':revert[::,1]**-1,'Noise':active**2/(2*revert[:,0])})

dataset.to_csv('../data/periodic.csv')

sigma[window_len//2-1:-window_len//2,0].shape
plt.plot(active)
plt.plot(active2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.23284457478005866, 'fraction_numerical': 0.05395894428152493, 'mean_word_length': 4.63036303630363, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '458902', 'license': 'MIT', 'n_tokens_mistral': 778, 'n_tokens_neox': 725, 'n_words': 91, 'path': 'synthetic_data/generate_periodic.ipynb', 'repo_name': 'ctorney/moveNSGP', 'size': '1705'}