|
[yoda-svn] r559 - in trunk: . binblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Mar 4 13:19:10 GMT 2013
Author: buckley Date: Mon Mar 4 13:19:10 2013 New Revision: 559 Log: Adding aida2yoda and aida2flat converter scripts. Added: trunk/bin/aida2flat (contents, props changed) trunk/bin/aida2yoda (contents, props changed) Modified: trunk/ChangeLog trunk/bin/Makefile.am trunk/bin/yoda2aida trunk/bin/yoda2flat Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Mon Mar 4 12:59:19 2013 (r558) +++ trunk/ChangeLog Mon Mar 4 13:19:10 2013 (r559) @@ -1,3 +1,7 @@ +2013-03-04 Andy Buckley <andy.buckley at cern.ch> + + * Adding aida2yoda and aida2flat converter scripts. + 2013-02-02 David Mallows <dave.mallows at gmail.com> * Adding support for Python >= 2.4 (was Python >= 2.6) Modified: trunk/bin/Makefile.am ============================================================================== --- trunk/bin/Makefile.am Mon Mar 4 12:59:19 2013 (r558) +++ trunk/bin/Makefile.am Mon Mar 4 13:19:10 2013 (r559) @@ -1 +1 @@ -dist_bin_SCRIPTS = yoda-config yoda2aida yoda2flat yoda-plot +dist_bin_SCRIPTS = yoda-config yoda2aida yoda2flat aida2yoda aida2flat Added: trunk/bin/aida2flat ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/bin/aida2flat Mon Mar 4 13:19:10 2013 (r559) @@ -0,0 +1,31 @@ +#! /usr/bin/env python + +"""\ +%prog aidafile [flatfile] + +Convert an AIDA data file to a 'flat', human-readable data format. +""" + +import yoda, sys, optparse + +parser = optparse.OptionParser(usage=__doc__) +opts, args = parser.parse_args() + +INFILE = None +OUTFILE = None + +if len(args) == 1: + INFILE = args[0] + if INFILE.endswith(".aida"): + OUTFILE = INFILE.replace(".aida", ".dat") + else: + OUTFILE = INFILE + ".dat" +elif len(args) == 2: + INFILE = args[0] + OUTFILE = args[1] +else: + sys.stderr.write("You must specify the AIDA and FLAT file names\n") + sys.exit(1) + +analysisobjects = yoda.readAIDA(INFILE) +yoda.writeFLAT(analysisobjects, OUTFILE) Added: trunk/bin/aida2yoda ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/bin/aida2yoda Mon Mar 4 13:19:10 2013 (r559) @@ -0,0 +1,31 @@ +#! /usr/bin/env python + +"""\ +%prog aidafile [yodafile] + +Convert an AIDA data file to the YODA data format. +""" + +import yoda, sys, optparse + +parser = optparse.OptionParser(usage=__doc__) +opts, args = parser.parse_args() + +INFILE = None +OUTFILE = None + +if len(args) == 1: + INFILE = args[0] + if INFILE.endswith(".aida"): + OUTFILE = INFILE.replace(".aida", ".yoda") + else: + OUTFILE = INFILE + ".yoda" +elif len(args) == 2: + INFILE = args[0] + OUTFILE = args[1] +else: + sys.stderr.write("You must specify the AIDA and YODA file names\n") + sys.exit(1) + +analysisobjects = yoda.readAIDA(INFILE) +yoda.writeYODA(analysisobjects, OUTFILE) Modified: trunk/bin/yoda2aida ============================================================================== --- trunk/bin/yoda2aida Mon Mar 4 12:59:19 2013 (r558) +++ trunk/bin/yoda2aida Mon Mar 4 13:19:10 2013 (r559) @@ -2,6 +2,8 @@ """\ %prog yodafile [aidafile] + +Convert a YODA data file to the old AIDA data format. """ import yoda, sys, optparse Modified: trunk/bin/yoda2flat ============================================================================== --- trunk/bin/yoda2flat Mon Mar 4 12:59:19 2013 (r558) +++ trunk/bin/yoda2flat Mon Mar 4 13:19:10 2013 (r559) @@ -2,6 +2,8 @@ """\ %prog yodafile [flatfile] + +Convert a YODA data file to a 'flat', more human-readable data format. """ import yoda, sys, optparse
More information about the yoda-svn mailing list |