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,
+ index=i, bump=bump, config=config, z_axis_config=axis_config,
deflection_channel_config=input_config, plot=plot,
maximum_relative_error=maximum_relative_error)
if changed and not dry_run:
temperatures_changed = True
for i,temperature in enumerate(raw_data['temperature']):
data['temperature'][i],changed = check_temperature(
- index=i, temperature=temperature,
+ index=i, temperature=temperature, config=config,
maximum_relative_error=maximum_relative_error)
if changed and not dry_run:
temperatures_changed = True
vibrations_changed = True
for i,vibration in enumerate(raw_data['vibration']):
data['vibration'][i],changed = check_vibration(
- index=i, vibration=vibration,
+ index=i, vibration=vibration, config=config,
deflection_channel_config=input_config, plot=plot,
maximum_relative_error=maximum_relative_error)
if changed and not dry_run:
vibrations=data['raw']['vibration'])
return (k, k_s)
-def check_bump(index, bump, maximum_relative_error, **kwargs):
+def check_bump(index, bump, config=None, maximum_relative_error=0, **kwargs):
changed = False
+ try:
+ bump_config = bump['config']['bump']
+ except KeyError:
+ bump_config = config['bump']
sensitivity = _bump_analyze(
- config=bump['config']['bump'], data=bump['raw'], **kwargs)
+ config=bump_config, data=bump['raw'], **kwargs)
if bump.get('processed', None) is None:
changed = True
_LOG.warn('new analysis for bump {}: {}'.format(index, sensitivity))
sensitivity-bump['processed'], rel_error))
return (sensitivity, changed)
-def check_temperature(index, temperature, maximum_relative_error, **kwargs):
+def check_temperature(index, temperature, config=None,
+ maximum_relative_error=0, **kwargs):
changed = False
+ try:
+ temp_config = temperature['config']['temperature']
+ except KeyError:
+ temp_config = config['temperature']
temp = _temperature_analyze(
- config=temperature['config']['temperature'],
+ config=temp_config,
temperature=temperature['raw'], **kwargs)
if temperature.get('processed', None) is None:
changed = True
temp-temperature['processed'], rel_error))
return (temp, changed)
-def check_vibration(index, vibration, maximum_relative_error, **kwargs):
+def check_vibration(index, vibration, config=None, maximum_relative_error=0,
+ **kwargs):
changed = False
+ try:
+ vib_config = vibration['config']['vibration']
+ except KeyError:
+ vib_config = config['vibration']
variance = _vibration_analyze(
- config=vibration['config']['vibration'],
- deflection=vibration['raw'], **kwargs)
+ config=vib_config, deflection=vibration['raw'], **kwargs)
if vibration.get('processed', None) is None:
changed = True
_LOG.warn('new analysis for temperature {}: {}'.format(