From 8595b710e3be4b2bf01d51a1c55842510b82ff87 Mon Sep 17 00:00:00 2001 From: Aron Ahmadia Date: Tue, 4 Jun 2013 00:19:49 -0400 Subject: [PATCH] first pass at making a pipeline --- python_pipeline.py | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 python_pipeline.py diff --git a/python_pipeline.py b/python_pipeline.py new file mode 100644 index 0000000..5865f05 --- /dev/null +++ b/python_pipeline.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# 3.0 + +# + +%pylab inline +import numpy as np + +f = open('Lumi.2760.csv') +g = f.readlines() +f.close() + +h = np.empty((8,12)) + +for i in range(8): + h[i] = g[i+1].split(',')[1:] + +imshow(h) +colorbar() + +f = open('20130524 2760 1 2 3 later.txt') +g = f.readlines() +f.close() + +plate_no = 2760 + +for idx in range(len(g)): + plate_str = 'Plate:\t'+str(plate_no) + if plate_str in g[idx]: + break +print idx + +def get_bgal_data(data, idx): + start_idx = idx + 2 + h = np.empty((8,12)) + h[0] = data[start_idx].strip().replace('\t',' ').split(' ')[1:] + for i in range(1,8): + h[i] = data[start_idx+i].strip().replace('\t',' ').split(' ') + return h + +bgal_data = get_bgal_data(g, idx) + + +imshow(bgal_data) +colorbar() + +norm_data = h/(bgal_data-0.07) +imshow(norm_data) +