Skip to content

Commit

Permalink
bugfix for Rapp19_Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed May 3, 2014
1 parent 4158598 commit 9f3d95b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
9 changes: 5 additions & 4 deletions pyana/examples/gp_panel.py
Expand Up @@ -18,11 +18,12 @@ def gp_panel(version, skip):
inDir, outDir = getWorkDirs()
inDir = os.path.join(inDir, version)
data = {}
for file in os.listdir(inDir):
energy = re.compile('\d+').search(file).group()
for infile in os.listdir(inDir):
if infile == "cocktail_contribs": continue
energy = re.compile('\d+').search(infile).group()
if skip is not None and energy == skip: continue
data_type = re.sub('%s\.dat' % energy, '', file)
file_url = os.path.join(inDir, file)
data_type = re.sub('%s\.dat' % energy, '', infile)
file_url = os.path.join(inDir, infile)
data_import = np.loadtxt(open(file_url, 'rb'))
data_import = data_import[data_import[:,0] < 1.1]
if data_type == 'cocktail': data_import[:,2:] = 0.
Expand Down
6 changes: 3 additions & 3 deletions pyana/examples/gp_ptspec.py
Expand Up @@ -74,15 +74,15 @@ def gp_ptspec():
dpt_dict_key = getSubplotTitle(mee_name, mee_range)
if dpt_dict_key not in dpt_dict:
ndsets = nen*2
if mee_name == 'LMR': ndsets += 2 # TODO: currently only 39/62 medium avail.
if mee_name == 'LMR': ndsets += 3 # TODO: currently only 19/39/62 medium avail.
dpt_dict[dpt_dict_key] = [ [None]*ndsets, [None]*ndsets, [None]*ndsets ]
enidx = fenergies.index(energy)
dsidx = 0
if data_type != 'cocktail': # data or medium
dsidx += nen
if mee_name == 'LMR': # account for medium calc
if data_type == 'data': dsidx += 2 + enidx
else: dsidx += (energy=='62')
if data_type == 'data': dsidx += 3 + enidx
else: dsidx += (energy=='19')*0 + (energy=='39')*1 + (energy=='62')*2
else: dsidx += enidx # no medium calc avail. in this mass region
else: dsidx += enidx # cocktail
dpt_dict[dpt_dict_key][0][dsidx] = data[filebase] # data
Expand Down
9 changes: 5 additions & 4 deletions pyana/examples/gp_rdiff.py
Expand Up @@ -33,11 +33,12 @@ def gp_rdiff(version, nomed, noxerr, diffRel):
inDir, outDir = getWorkDirs()
inDir = os.path.join(inDir, version)
data, cocktail, medium = OrderedDict(), OrderedDict(), OrderedDict()
for file in os.listdir(inDir):
energy = re.compile('\d+').search(file).group()
data_type = re.sub('%s\.dat' % energy, '', file)
for infile in os.listdir(inDir):
if infile == "cocktail_contribs": continue
energy = re.compile('\d+').search(infile).group()
data_type = re.sub('%s\.dat' % energy, '', infile)
energy = getEnergy4Key(energy)
file_url = os.path.join(inDir, file)
file_url = os.path.join(inDir, infile)
data_import = np.loadtxt(open(file_url, 'rb'))
if data_type == 'data': data[energy] = data_import[data_import[:,0] < 0.8]
elif data_type == 'cocktail': cocktail[energy] = data_import
Expand Down

0 comments on commit 9f3d95b

Please sign in to comment.