annotate hedm_npz_to_tesr.py @ 4:b49a8ef3351d draft

"planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
author ximgchess
date Thu, 01 Apr 2021 18:29:39 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
1 #!/usr/bin/env python3
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
2 # -*- coding: utf-8 -*-
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
3 """
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
4 Created on Mon Nov 19 08:32:06 2018
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
5
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
6 @author: dcp99
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
7 """
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
8
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
9
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
10 #%%
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
11
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
12 import argparse
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
13 import numpy as np
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
14 import re
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
15
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
16 def __main__():
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
17
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
18 parser = argparse.ArgumentParser(
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
19 description='Convert an HEDM_map.npz file to a neper tesr file')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
20 parser.add_argument(
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
21 'input',
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
22 type=argparse.FileType('rb'),
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
23 help='HEDM_map.npz')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
24 parser.add_argument(
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
25 'output',
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
26 type=argparse.FileType('w'),
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
27 help='neper tesr file' )
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
28 parser.add_argument('-s', '--voxel_spacing', type=float, default=0.005, help='voxel spacing')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
29 parser.add_argument('-x', '--x_name', default='^.*X.*$', help='X array name')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
30 parser.add_argument('-y', '--y_name', default='^.*Y.*$', help='Y array name')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
31 parser.add_argument('-z', '--z_name', default='^.*Z.*$', help='Z array name')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
32 parser.add_argument('-g', '--grain_map', default='^.*grain.*$', help='grain map name')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
33 parser.add_argument('-d', '--debug', action='store_true', help='Debug')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
34 args = parser.parse_args()
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
35 data=np.load(args.input)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
36 grain_map = Xs = Ys = Zs = None
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
37 for f in data.files:
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
38 if re.match(args.grain_map, f):
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
39 grain_map = data[f]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
40 elif re.match(args.x_name, f):
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
41 Xs = data[f]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
42 elif re.match(args.y_name, f):
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
43 Ys = data[f]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
44 elif re.match(args.z_name, f):
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
45 Zs = data[f]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
46 voxel_spacing = args.voxel_spacing
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
47
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
48 #CREATE ASSEMBLED DATA -- LIST OF [VOXEL COORDINATES (X,Y,Z),GRAIN ID]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
49
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
50 coordinate_list=np.vstack((Xs.ravel(),Ys.ravel(),Zs.ravel()))
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
51 assembled_data=np.hstack((coordinate_list.T,np.atleast_2d(grain_map.ravel()).T))
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
52
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
53 #%% SORT BY ROWS Z AND THEN Y
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
54
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
55 assembled_data=assembled_data[assembled_data[:,2].argsort()]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
56 total_size=int(grain_map.shape[0]*grain_map.shape[1]*grain_map.shape[2])
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
57
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
58 stack_size=int(grain_map.shape[0]*grain_map.shape[1])
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
59 for ii in np.arange(int(total_size/stack_size)):
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
60 tmp_args=assembled_data[ii*stack_size:(ii+1)*stack_size,1].argsort()
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
61 assembled_data[ii*stack_size:(ii+1)*stack_size,:]=assembled_data[ii*stack_size+tmp_args,:]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
62
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
63 stack_size=grain_map.shape[1]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
64 for ii in np.arange(int(total_size/stack_size)):
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
65 tmp_args=assembled_data[ii*stack_size:(ii+1)*stack_size,0].argsort()
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
66 assembled_data[ii*stack_size:(ii+1)*stack_size,:]=assembled_data[ii*stack_size+tmp_args,:]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
67
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
68 #%%
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
69
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
70 np.set_printoptions(threshold=np.inf)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
71 l1 = '***tesr'
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
72 l2 = ' **format'
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
73 l3 = ' 2.0 ascii'
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
74 l4 = ' **general'
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
75 l5 = ' 3'
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
76 l6 = ' ' + str(grain_map.shape[1]) + ' ' + str(grain_map.shape[0]) + ' ' + str(grain_map.shape[2])
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
77 l7 = ' ' + str(voxel_spacing) + ' ' + str(voxel_spacing) + ' ' + str(voxel_spacing)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
78 l8 = ' **cell';
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
79 l9 = ' ' + str(np.max(grain_map).astype('int'))
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
80 l10 = ' *id';
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
81 l11 = ' ' + str(np.arange(1,np.max(grain_map)+1).astype('int'))[1:-1]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
82 l12 = ' **data'
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
83 #l13 = ' ' + str(assembled_data[:,3].astype('int'))[1:-1]
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
84 l14 = '***end'
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
85
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
86 #%%
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
87 output = args.output
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
88 output.write('%s\n' % l1)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
89 output.write('%s\n' % l2)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
90 output.write('%s\n' % l3)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
91 output.write('%s\n' % l4)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
92 output.write('%s\n' % l5)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
93 output.write('%s\n' % l6)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
94 output.write('%s\n' % l7)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
95 output.write('%s\n' % l8)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
96 output.write('%s\n' % l9)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
97 output.write('%s\n' % l10)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
98 output.write('%s\n' % l11)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
99 output.write('%s\n' % l12)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
100 output.write(' ')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
101 np.savetxt(output,np.atleast_2d(assembled_data[:,3]).T,fmt='%d')
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
102 #output.write('%s\n' % l13)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
103 output.write('%s\n' % l14)
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
104 output.close()
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
105
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
106
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
107 if __name__ == "__main__":
b49a8ef3351d "planemo upload for repository https://github.com/ximg-chess/galaxytools/tools/hedm_npz_to_tesr commit 0db0d2633f65e2ceca2e34c8899a52b18965d059"
ximgchess
parents:
diff changeset
108 __main__()