-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimageprinter.py
More file actions
34 lines (30 loc) · 773 Bytes
/
imageprinter.py
File metadata and controls
34 lines (30 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 14 13:30:44 2015
This will make a new image every few seconds
@author: zag
"""
import numpy as np
import time
data = np.loadtxt('319bec_avg.txt')
#data = np.loadtxt('sgimage.txt')
def add_noise(data):
x,y = data.shape
add = np.random.randn(x,y)/20
return data + add
#k = 1
for k in range(2000):
time.sleep(5)
np.savetxt('newimage.txt',add_noise(data))
print('Printed image {0}'.format(k))
#k +=1
def make_name(k):
"""note k start at 313"""
return 'C:\\Users\\zag\\Documents\\BECMonitor\\testData\\' + str(k)+'bec_avg.txt'
'''
for k in range(313,659):
time.sleep(5)
data = np.loadtxt(make_name(k))
np.savetxt('newimage.txt',data)
print('Printed image {0}'.format(k))
'''