def digitize(path, file, tree): """""" output = R.TFile.Open(str(Path(path).stem + ".digi.root"), "RECREATE") output.cd() digitized = digitize_tree(output, path, copytree(file, tree), tree.GetName()) digitized.Write() for (key, name) in map(lambda k: (k, k.GetName()), file.GetListOfKeys()): if name != tree.GetName(): file.cd() obj = key.ReadObj() output.cd() obj.Write() output.cd() digitize_tag = R.TNamed("DIGITIZED", "TRUE") digitize_tag.Write() output.Close()
def write_meta(self, key, value): self.__t_file_out.cd() ROOT.TNamed(key, value).Write()
t_tree_ppd_out.geocentric_d = t_tree_ppd_in.geocentric_d t_tree_ppd_out.ship_time_sec = t_tree_ppd_in.ship_time_sec t_tree_ppd_out.utc_time_sec = t_tree_ppd_in.utc_time_sec t_tree_ppd_out.utc_time_str = str(t_tree_ppd_in.utc_time_str) t_tree_ppd_out.flag_of_pos = t_tree_ppd_in.flag_of_pos t_tree_ppd_out.det_z_ra = t_tree_ppd_in.det_z_ra t_tree_ppd_out.det_z_dec = t_tree_ppd_in.det_z_dec t_tree_ppd_out.det_x_ra = t_tree_ppd_in.det_x_ra t_tree_ppd_out.det_x_dec = t_tree_ppd_in.det_x_dec t_tree_ppd_out.earth_ra = t_tree_ppd_in.earth_ra t_tree_ppd_out.earth_dec = t_tree_ppd_in.earth_dec t_tree_ppd_out.fill() t_file_in.close() t_file_out.cd() t_tree_ppd_out.write() ROOT.TNamed('m_dattype', 'PLATFORM PARAMETERS DATA of LEVEL 1').Write() ROOT.TNamed('m_version', SW_NAME + " " + SW_VERSION).Write() ROOT.TNamed('m_gentime', datetime.now(tzlocal()).isoformat()).Write() ROOT.TNamed('m_dcdfile', basename(args.filename)).Write() ROOT.TNamed('m_shipspan', m_shipspan.GetTitle()).Write() ROOT.TNamed('m_utc_span', m_utc_span.GetTitle()).Write() t_file_out.close() print '=====================================================================' print 'shiptime span: { ' + m_shipspan.GetTitle() + ' }' print 'UTC time span: { ' + m_utc_span.GetTitle() + ' }' print '====================================================================='