Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 6db99872 authored by hartmann_m's avatar hartmann_m
Browse files

Update filegen.py

parent 5835c771
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import pandas as pd import pandas as pd
import fileinput
...@@ -45,42 +46,37 @@ df.columns = ["x", "y", "z", "xp","yp","zp"] ...@@ -45,42 +46,37 @@ df.columns = ["x", "y", "z", "xp","yp","zp"]
df['x'] = df['x'].div(10) df['x'] = df['x'].div(10)
df['y'] = df['y'].div(10) df['y'] = df['y'].div(10)
df['z'] = df['z'].div(10) df['z'] = df['z'].div(10)
data = ['DS2 L']
df3 = pd.DataFrame(data)
df=df.append(df3)
df2 = df[["xp", "yp","zp"]] df2 = df[["xp", "yp","zp"]]
df = df.drop('xp', 1) df = df.drop('xp', 1)
df = df.drop('yp', 1) df = df.drop('yp', 1)
df = df.drop('zp', 1) df = df.drop('zp', 1)
df=df.append(df2) df=df.append(df2)
df.style.set_properties(**{'text-align': 'left'}) df = df.round(11)
df.insert(0, 'BlS1', '')
df.insert(1, 'BlS2', '')
df.insert(2, 'BlS3', '')
df.insert(3, 'BlS4', '')
df.insert(4, 'BlS5', '')
df.to_csv('flat.txt', sep=' ', index=False, header=None) df.to_csv('flat.txt', sep=' ', index=False, header=None)
lines = ['SDEF PAR=h POS=D1 VEC=FPOS D2 DIR=-1 ERG=590 wgt=1', 'SP1 1 35999r','SI1 L']
lines = ['SDEF PAR=h POS=D1 VEC=FPOS D2 DIR=-1 ERG=590 wgt=1', 'SP1 1 35999r','SI1 L ']
direction = ['DS2 L']
with open("flat.txt", 'r+') as file: with open("flat.txt", 'r+') as file:
readcontent = file.read() readcontent = file.read()
all_lines=file.readlines()
file.seek(0, 0) file.seek(0, 0)
for i in lines: for i in lines:
file.write(str(i) + "\n") file.write(str(i) + "\n")
file.write(' '.join(i.split()))
file.write(readcontent) file.write(readcontent)
exp = 36003
with open ('flat.txt','r') as b:
lines = b.readlines()
with open('flat.txt','w') as b:
for i,line in enumerate(lines):
if i == exp:
b.write('DS2 L'+"\n")
b.write(line)
plt.hist(particles[:,3]);
#plt.hist2d(particles[:,0], particles[:,2], bins = 50);
#plt.hist2d(particles[:,3], particles[:,5], bins = 50);
#plt.hist(particles[:,0]);
plt.show()
print(particles[:,3])
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