source: fact/tools/pyscripts/sandbox/dneise/compare_mapping/compare@ 20115

Last change on this file since 20115 was 13403, checked in by neise, 13 years ago
initial commit
  • Property svn:executable set to *
File size: 828 bytes
Line 
1#!/usr/bin/python -tti
2#
3# Dominik Neise
4#
5import sys
6import numpy as np
7from plotters import Plotter
8
9def hard2chid(hardid):
10 hardid = int(hardid)
11 einer = hardid%10
12 hardid -= einer
13 zehner = hardid%100/10
14 hardid -= zehner*10
15 hunderter = hardid%1000/100
16 hardid -= hunderter*100
17 tausender = hardid%10000/1000
18
19 chid = tausender*360 + hunderter*36 + zehner*9 + einer
20 return chid
21
22leftpath = sys.argv[1]
23rightpath =sys.argv[2]
24
25left = np.loadtxt(leftpath)
26right = np.loadtxt(rightpath)
27
28right = list(right)
29for i,ri in enumerate(right):
30 right[i] = list(ri)
31
32for i in right:
33 i.append( hard2chid(i[1]) )
34
35right = sorted( right, key=lambda i: i[-1])
36
37right = np.array(right)
38
39pleft = Plotter('pleft', x=left[:,1])
40pright= Plotter('pright',x=right[:,8])
41pleft(left[:,2])
42pright(-right[:,9])
Note: See TracBrowser for help on using the repository browser.