File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,25 @@ def main(outputfile, inputdir):
71
71
df = pd .DataFrame (event_headers [event_columns ])
72
72
to_h5py (df , outputfile , key = 'corsika_events' , mode = 'a' )
73
73
74
+
74
75
print ('saving runwise information' )
75
76
runs = pd .DataFrame (np .array (run_headers )[run_header_columns ])
76
- runs ['n_events' ] = np .array (run_ends )['n_events' ]
77
+
78
+ # some runs might have failed and thus no run end block
79
+ for run_end in run_ends :
80
+ if run_end is not None :
81
+ dtype = run_end .dtype
82
+ break
83
+ else :
84
+ raise IOError ('All run_end blocks are None, all runs failed.' )
85
+
86
+ dummy = np .array ([(b'RUNE' , np .nan , np .nan )], dtype = dtype )[0 ]
87
+ run_ends = [r if r is not None else dummy for r in run_ends ]
88
+ run_ends = np .array (run_ends )
89
+
90
+ print ('Number of failed runs:' , np .count_nonzero (np .isnan (run_ends ['n_events' ])))
91
+
92
+ runs ['n_events' ] = run_ends ['n_events' ]
77
93
78
94
to_h5py (runs , outputfile , key = 'corsika_runs' , mode = 'a' )
79
95
print ('done' )
Original file line number Diff line number Diff line change 3
3
4
4
setup (
5
5
name = 'irf' ,
6
- version = '0.5.1 ' ,
6
+ version = '0.5.2 ' ,
7
7
description = 'Functions to do instrument response functions for FACT' ,
8
8
url = 'http://github.com/fact-project/irf' ,
9
9
author = 'Kai Brügge, Maximilian Nöthe' ,
You can’t perform that action at this time.
0 commit comments