You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In XLook the type command (and type_p) produced ascii output. A rough prototype is:
defcommand_type(self, command):
""" Produce an ASCII output of the reduced data matching the XLook type format. """ifnotself._check_number_of_arguments(command, 6):
return
(_, start_row_idx, stop_row_idx,
start_col_idx, stop_col_idx, fname) =command.split(' ')
start_row_idx=int(start_row_idx)
stop_row_idx=int(stop_row_idx)
start_col_idx=int(start_col_idx)
stop_col_idx=int(stop_col_idx) +1fname=Path(fname.strip())
# Trim the data to the range we want to write out - rows and columnswrite_data= [self.data[col_idx][start_row_idx: stop_row_idx] forcol_idxinrange(start_col_idx, stop_col_idx)]
write_names=self.data_names[start_col_idx: stop_col_idx]
write_units=self.data_units[start_col_idx: stop_col_idx]
write_col_numbers=list(range(start_col_idx, stop_col_idx))
n_recs=np.shape(self.data[0])[0]
# Add something here to pull out cols with None and the name and unitwithopen(fname, 'w') asf:
# Headerf.write(f'number of records = {n_recs}\n ')
forcol_numinwrite_col_numbers:
f.write(f' col {col_num:>1}')
f.write('\n ')
forcol_nameinwrite_names:
f.write(f'{col_name:>12}')
f.write('\n ')
forcol_unitinwrite_units:
f.write(f'{col_unit:>12}')
f.write('\n ')
forcol_unitinwrite_units:
f.write(f'{n_recs:>7} recs')
f.write('\n')
# Dataforrow_idxinlist(range(len(self.data[0]))):
#f.write(f'{row_idx:10}')f.write(f'{row_idx}\t')
forcolinwrite_col_numbers:
#f.write(f'{self.data[col][row_idx]:10.6}')# Hack to read f.write(f'{self.data[col][row_idx]:.6}\t')
f.write('\n')
The text was updated successfully, but these errors were encountered:
In XLook the type command (and type_p) produced ascii output. A rough prototype is:
The text was updated successfully, but these errors were encountered: