From: W. Trevor King Date: Fri, 2 Mar 2012 19:11:08 +0000 (-0500) Subject: Oops, use numpy arrays instead of lists for the last commit. X-Git-Tag: 0.8~30 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=904f98c200a40abb6f86304c3ae912a01b9bac11;p=calibcant.git Oops, use numpy arrays instead of lists for the last commit. This avoids: Traceback (most recent call last): File ".../calibcant/analyze.py", line 189, in calib_analyze ps_m = bumps.mean() # ps for photo-sensitivity AttributeError: 'list' object has no attribute 'mean' --- diff --git a/calibcant/analyze.py b/calibcant/analyze.py index 0b4c347..1033dcc 100644 --- a/calibcant/analyze.py +++ b/calibcant/analyze.py @@ -396,11 +396,14 @@ def calib_analyze_all(filename, group='/', maximum_relative_error=1e-5, bumps,temperatures,vibrations,calibration_config,k,k_s = calib_load( filename, group+'calibration/') if bumps is None: - bumps = [None]*calibration_config['num-bumps'] + bumps = _numpy.zeros( + (calibration_config['num-bumps'],), dtype=float) if temperatures is None: - temperatures = [None]*calibration_config['num-temperatures'] + temperatures = _numpy.zeros( + (calibration_config['num-temperatures'],), dtype=float) if vibrations is None: - vibrations = [None]*calibration_config['num-vibrations'] + vibrations = _numpy.zeros( + (calibration_config['num-vibrations'],), dtype=float) changed_bump = changed_temperature = changed_vibration = False for i in range(calibration_config['num-bumps']): bump_group = '%sbump/%d/' % (group, i)