Skip to content

Commit

Permalink
python 3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiang87 committed Oct 3, 2018
1 parent 8aa6d35 commit 84a9bcc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def slot_dependency_glob(pattern, jobname):
# Use a mean bias file to determine the maximum number of active
# pixels for the image quality statistics.
bias_files = slot_dependency_glob('*_mean_bias_*.fits', 'fe55_raft_analysis')
total_num, rolloff_mask = sensorTest.pixel_counts(bias_files.values()[0])
total_num, rolloff_mask = sensorTest.pixel_counts(list(bias_files.values())[0])

# Exposure time (in seconds) for 95th percentile dark current shot
# noise calculation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run_fe55_task(sensor_id):
'%s_fe55_apflux_parallel.png' % file_prefix,
pixel_coord='y')

except StandardError as eobj:
except Exception as eobj:
print("Exception raised while creating pixel statistics plots:")
print(str(eobj))
print("Skipping these plots.")
Expand Down
2 changes: 1 addition & 1 deletion harnessed_jobs/qa_plots_raft/v0/producer_qa_plots_raft.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def dirname_dependencyGlob(ccd_vendor, **kwds):
Return the directory path with the FITS output files for the
specified jobname.
"""
if kwds.has_key('jobname'):
if 'jobname' in kwds:
kwds['jobname'] = siteUtils.getProcessName(kwds['jobname'])
file0 = dependency_glob('S*/%(ccd_vendor)s*.fits' % locals(), **kwds)[0]
# Apply os.path.dirname twice to omit both slot folder and file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def run_qe_task(sensor_id):
try:
plots.flat_fields(os.path.dirname(lambda_files[0]),
annotation='e-/pixel, gain-corrected, bias-subtracted')
except StandardError as eobj:
except Exception as eobj:
print("Exception raised while creating flat fields:")
print(str(eobj))

Expand Down
5 changes: 3 additions & 2 deletions python/correlated_noise.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import glob
from collections import namedtuple, defaultdict
import itertools
Expand Down Expand Up @@ -236,7 +237,7 @@ def set_ticks(ax, slots, amps=16):
= correlated_noise(bias_files, make_plots=True, plot_corr=False,
title='Run 5808D, ETU1, S00')
for amp, stats in etu1_stats.items():
print amp, stats
print(amp, stats)
plt.figure(f1.number)
plt.savefig('ETU1_S00_noise_corr.png')

Expand All @@ -245,6 +246,6 @@ def set_ticks(ax, slots, amps=16):
= correlated_noise(bias_files, make_plots=True, plot_corr=False,
title='Run 6288, RTM-005, S00')
for amp, stats in rtm005_stats.items():
print amp, stats
print(amp, stats)
plt.figure(f1.number)
plt.savefig('RTM-005_S00_noise_corr.png')

0 comments on commit 84a9bcc

Please sign in to comment.