It seems like the 'max' ignition-type case is not working as intended.
|
def get_ignition_delay(time, target, target_name, ignition_type): |
if ignition_type == 'max':
# Get indices of peaks
peak_inds = detect_peaks(target, edge=None, mph=1.e-9*np.max(target))
# Get index of largest peak (overall ignition delay)
max_ind = peak_inds[np.argmax(target[peak_inds])]
#ign_delays = time[peak_inds[np.where((time[peak_inds[peak_inds <= max_ind]]) > 0.0)]]
ign_delays = time[peak_inds[peak_inds <= max_ind]]
I'm not sure if ign_delays is meant to include all of the peaks up to and including the max peak?
Later on in:
|
def process_results(self): |
if max_temperature >= init_temperature + 50.:
ignition_delays = get_ignition_delay(time.magnitude, target,
self.properties.ignition_target,
self.properties.ignition_type
)
self.meta['simulated-ignition-delay'] = (ignition_delays[0] - time_comp) * units.second
The first value in ignition_delays is always used, so the delay for the max peak doesn't actually end up being selected unless it happens to also be the first peak. From looking at the code, it seems like the same issue may be occurring for the 'd/dt max' ignition type as well, but this hasn't yet come up in testing.
It seems like the 'max' ignition-type case is not working as intended.
PyTeCK/pyteck/simulation.py
Line 96 in bba7984
I'm not sure if
ign_delaysis meant to include all of the peaks up to and including the max peak?Later on in:
PyTeCK/pyteck/simulation.py
Line 496 in bba7984
The first value in
ignition_delaysis always used, so the delay for the max peak doesn't actually end up being selected unless it happens to also be the first peak. From looking at the code, it seems like the same issue may be occurring for the 'd/dt max' ignition type as well, but this hasn't yet come up in testing.