<jupyter_start><jupyter_text>Get the geometry of the IceCube detector*Using the geometry.pdf file from the old test data site. See details in the testing directory**Before running*   ```$ cd ../testing/code/odf_tarball/; source env.sh; cd ../../../rawdata```*I can't get that to work on Windows for some reason.*<jupyter_code>from geo_reader import read as read_geo

%load_ext autoreload
%autoreload 2<jupyter_output><empty_output><jupyter_text>*Read in the data, following the code in pylab_2D_viewer.py*<jupyter_code>geof = open("geometry.odf","rb")
geo = read_geo(geof)
x = [pos[0] for om,pos in geo.items() if om[0] ]
y = [pos[1] for om,pos in geo.items() if om[0] ]
z = [pos[2] for om,pos in geo.items() if om[0] ]<jupyter_output><empty_output><jupyter_text>*Write to a csv file*<jupyter_code>import csv
csvfile = open("IceCubeGeometry.csv", 'wt')	
csvwriter = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
for i in range(len(x)):
    csvwriter.writerow([x[i],y[i],z[i]])
csvfile.close()<jupyter_output><empty_output><jupyter_text>*Write to a "raw" file*<jupyter_code>csvfile = open("IceCubeGeometry.raw", 'wt')	
csvwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
for i in range(len(x)):
    csvwriter.writerow([x[i],y[i],z[i], 1., 2., 3., 4., 5., 6.])
csvfile.close()<jupyter_output><empty_output><jupyter_text>*In Uniview, I'm noticing that the top parts don't really line up correctly for all points, and in some cases there are two points for a given line below (which also don't line up well).  I will fix this below and recreate the file.  I am also creating a tops file so that I can easily draw lines in Uniview*<jupyter_code>import pandas as pd
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
%matplotlib notebook
g = pd.read_csv('IceCubeGeometry.csv', header=None, names=['x','y','z','f1','f2','f3','f4','f5','f6'])
print(min(g['z']), max(g['z']), max(g['z'])-min(g['z']))
top = g.loc[g['z'] >= 1900]
bot = g.loc[g['z'] < 1900]
z = bot['z']
#maxBot = bot.loc[z > 490]
maxBot = bot.loc[(z > -495) & (z < -478)]

maxBot = maxBot.assign(zNew=np.full_like(maxBot['z'].values,1950.))
bot = bot.assign(zNew=bot['z'].values)

f,ax = plt.subplots()
bins = np.linspace(-550,550, 2000)
foo = ax.hist(z, bins=bins)
foo = ax.hist(maxBot['z'].values, bins=bins, histtype='step')
ax.set_xlim(-550,-400)
csvfile = open("IceCubeGeometryTop.raw", 'wt')	
csvwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
x = maxBot['x'].values
y = maxBot['y'].values
z = maxBot['zNew'].values
for i in range(len(x)):
    csvwriter.writerow([x[i],y[i],z[i], 1., 2., 3., 4., 5., 6.])
csvfile.close()

#new raw data with fixed top line
frames = [bot, maxBot]
df = pd.concat(frames)
csvfile = open("IceCubeGeometry.raw", 'wt')	
csvwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
x = df['x'].values
y = df['y'].values
z = df['zNew'].values
for i in range(len(x)):
    csvwriter.writerow([x[i],y[i],z[i], 1., 2., 3., 4., 5., 6.])
csvfile.close()<jupyter_output><empty_output><jupyter_text>*A simple 3D scatter plot to check the data*<jupyter_code>g = pd.read_csv('IceCubeGeometry.raw', sep=' ', header=None, names=['x','y','z','f1','f2','f3','f4','f5','f6'])
x = g['x'].values
y = g['y'].values
z = g['z'].values

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(x, y, z)

ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19509444601071327, 'fraction_numerical': 0.023118127995489145, 'mean_word_length': 5.758095238095238, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '454739', 'license': 'MIT', 'n_tokens_mistral': 1489, 'n_tokens_neox': 1393, 'n_words': 335, 'path': 'rawdata/getIceCubeGeom.ipynb', 'repo_name': 'ageller/UniviewIceCube', 'size': '3547'}