From: W. Trevor King Date: Fri, 20 Apr 2012 17:58:35 +0000 (-0400) Subject: Notice if lengths of bumps, temps, or vibs changes in analyze_all. X-Git-Tag: 0.8~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fe8161d4415d5fc662a429a45a973de73d4c4a41;p=calibcant.git Notice if lengths of bumps, temps, or vibs changes in analyze_all. 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. --- diff --git a/calibcant/analyze.py b/calibcant/analyze.py index 839a51b..b6807f8 100644 --- a/calibcant/analyze.py +++ b/calibcant/analyze.py @@ -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,