Notice if lengths of bumps, temps, or vibs changes in analyze_all.
authorW. Trevor King <wking@drexel.edu>
Fri, 20 Apr 2012 17:58:35 +0000 (13:58 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 20 Apr 2012 17:58:35 +0000 (13:58 -0400)
For example, if a vibration has a wierd jump that throws off the
average, you can move that vibration from, say, 'vibration/12' to
'vibration/-1'.  This saves the data, but does not use it to calculate
the spring constant.

With the old logic, the shortened array of variances wasn't saved over
the old ones, because none of the analysis for an individual vibration
had changed.

calibcant/analyze.py

index 839a51bb72076125cd8285fa8a184a92c481378a..b6807f882970c4b1c68247188c309f251ac5c5f2 100644 (file)
@@ -214,7 +214,9 @@ def analyze_all(config, data, raw_data, maximum_relative_error=1e-5,
     else:
         f = None
     try:
-        for i,bump in enumerate(raw_data['bump']):        
+        if len(data['raw']['bump']) != len(data['bump']):
+            bumps_changed = True
+        for i,bump in enumerate(raw_data['bump']):
             data['bump'][i],changed = check_bump(
                 index=i, bump=bump, z_axis_config=axis_config,
                 deflection_channel_config=input_config, plot=plot,
@@ -223,6 +225,8 @@ def analyze_all(config, data, raw_data, maximum_relative_error=1e-5,
                 bumps_changed = True
                 bump_group = _h5_create_group(group, 'bump/{}'.format(i))
                 _bump_save(group=bump_group, processed=data['bump'][i])
+        if len(data['raw']['temperature']) != len(data['temperature']):
+            temperatures_changed = True
         for i,temperature in enumerate(raw_data['temperature']):
             data['temperature'][i],changed = check_temperature(
                 index=i, temperature=temperature,
@@ -233,6 +237,8 @@ def analyze_all(config, data, raw_data, maximum_relative_error=1e-5,
                     group, 'temperature/{}'.format(i))
                 _temperature_save(
                     group=temerature_group, processed=data['temperature'][i])
+        if len(data['raw']['vibration']) != len(data['vibration']):
+            vibrations_changed = True
         for i,vibration in enumerate(raw_data['vibration']):
             data['vibration'][i],changed = check_vibration(
                     index=i, vibration=vibration,