Oops, use numpy arrays instead of lists for the last commit.
authorW. Trevor King <wking@drexel.edu>
Fri, 2 Mar 2012 19:11:08 +0000 (14:11 -0500)
committerW. Trevor King <wking@drexel.edu>
Fri, 2 Mar 2012 19:11:17 +0000 (14:11 -0500)
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'

calibcant/analyze.py

index 0b4c347a68c5b1f31a56a34e35ce67d716291b64..1033dcc3b692865f9b87f56d7018fad882dc7ad5 100644 (file)
@@ -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)