|
28 | 28 | from specparam.plts.utils import check_ax |
29 | 29 |
|
30 | 30 | def plot_peak_height(model, peak_ind, spacing, operation, ax=None): |
31 | | - """Annotat plot by drawing the computed peak height.""" |
| 31 | + """Annotate plot by drawing the computed peak height.""" |
32 | 32 |
|
33 | 33 | # Get the frequency value of the data closest to the specified peak |
34 | 34 | f_ind = nearest_ind(model.data.freqs, |
@@ -204,31 +204,33 @@ def plot_peak_height(model, peak_ind, spacing, operation, ax=None): |
204 | 204 |
|
205 | 205 | ################################################################################################### |
206 | 206 | # |
207 | | -# As expected, we can see that the four differet combinations of spacing and operation can |
| 207 | +# As expected, we can see that the four different combinations of spacing and operation can |
208 | 208 | # lead to 4 different answers for the peak height. |
209 | 209 | # |
210 | | -# We can also go one step further, and examing (un)logging the results. |
| 210 | +# We can also go one step further, and examine (un)logging the results, to explore if |
| 211 | +# changing the spacing of the computed results aligns with any of the original calculations. |
211 | 212 | # |
212 | 213 |
|
213 | 214 | ################################################################################################### |
214 | 215 |
|
215 | | -# Check logging / unlogging measures: lines up with above |
| 216 | +# Check logging / unlogging measures: un-logged log sub is same as linear division |
216 | 217 | print('Unlog log sub : {:+08.4f}'.format(unlog(peak_heights['log_sub']))) |
217 | | -print('Log of lin div : {:+08.4f}'.format(np.log10(peak_heights['lin_div']))) |
218 | 218 |
|
219 | 219 | ################################################################################################### |
220 | 220 |
|
221 | | -# Check logging / unlogging measures: does not line up with above |
222 | | -print('Unlog log div : {:+08.4f}'.format(unlog(peak_heights['log_div']))) |
223 | | -print('Log of lin sub : {:+08.4f}'.format(np.log10(peak_heights['lin_sub']))) |
| 221 | +# Check logging / unlogging measures: logged linear-division is the same as log subtraction |
| 222 | +print('Log of lin div : {:+08.4f}'.format(np.log10(peak_heights['lin_div']))) |
224 | 223 |
|
225 | 224 | ################################################################################################### |
226 | 225 | # |
227 | | -# As expected, unlogging the log-subtraction is equivalent to the linear division, and |
228 | | -# (vice-versa) logging the linear division is equivalent to the log-subtraction. |
| 226 | +# In the above examples we see that changing the spacing of some results does line up with |
| 227 | +# some of the previously computed estimates. As expected based on the log rules, unlogging |
| 228 | +# the log-subtraction is equivalent to the linear division, and (vice-versa) logging the |
| 229 | +# linear division is equivalent to the log-subtraction. |
229 | 230 | # |
230 | | -# However, unlogging the log-division or logging the linear-subtraction do not lead to |
231 | | -# answers that align with any of the previous measures. |
| 231 | +# This also means that you cannot convert directly between spacing keeping the same operation, |
| 232 | +# for example, you cannot convert to the linear-subtraction result by unlogging |
| 233 | +# the log-subtraction result. |
232 | 234 | # |
233 | 235 | # To summarize: |
234 | 236 | # |
|
0 commit comments