Changeset 17975 for fact/tools/pyscripts/new_pyfact
- Timestamp:
- 09/26/14 09:30:50 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/new_pyfact/pyfact.py
r17973 r17975 82 82 self._setup_columns() 83 83 84 def __len__(self): 85 """ return the number of events, in case it's a FACT physics data file 86 or simply the number of rows in case it's a slow data (so called aux) file. 87 """ 88 return self.f.GetNumRows() 89 84 90 def _make_header(self): 85 91 """ … … 136 142 self._cols = {} 137 143 self.cols = {} 138 N = self.header['NAXIS2'] 144 145 N = len(self) 139 146 for key,col in self.f.GetColumns(): 140 147 self._cols[key] = np.zeros(col.num, col_type_to_np_type_map[col.type]) … … 151 158 step = 10 152 159 if i % step == 0: 153 print "reading line", i 160 print "reading line", i, 'of', self.header['NAXIS2'] 154 161 155 162 for key in self._cols: … … 226 233 f = RawData(sys.argv[1], sys.argv[2]) 227 234 228 print "number of events:", f.header['NAXIS2']235 print "number of events:", len(f) 229 236 print "date of observation:", f.header['DATE'] 230 237 print "The files has these cols:", f.cols.keys()
Note:
See TracChangeset
for help on using the changeset viewer.