| @@ 677-680 (lines=4) @@ | ||
| 674 | ||
| 675 | else: |
|
| 676 | waiting_differential = True; |
|
| 677 | ||
| 678 | return number_oscillations; |
|
| 679 | ||
| 680 | ||
| 681 | def allocate_sync_ensembles(dynamic, tolerance = 0.1, threshold = 1.0, ignore = None): |
|
| 682 | """! |
|
| 683 | @brief Allocate clusters in line with ensembles of synchronous oscillators where each |
|
| @@ 656-659 (lines=4) @@ | ||
| 653 | """ |
|
| 654 | ||
| 655 | number_oscillations = 0; |
|
| 656 | waiting_differential = False; |
|
| 657 | threshold_passed = False; |
|
| 658 | high_level_trigger = True if (osc_dyn[0][index] > amplitude_threshold) else False; |
|
| 659 | ||
| 660 | for values in osc_dyn: |
|
| 661 | if ( (values[index] >= amplitude_threshold) and (high_level_trigger is False) ): |
|
| 662 | high_level_trigger = True; |
|
| @@ 812-816 (lines=5) @@ | ||
| 809 | ||
| 810 | fig = plt.figure(); |
|
| 811 | ||
| 812 | if (axes is None): |
|
| 813 | # Check for dimensions |
|
| 814 | if ((dimension) == 1 or (dimension == 2)): |
|
| 815 | axes = fig.add_subplot(111); |
|
| 816 | elif (dimension == 3): |
|
| 817 | axes = fig.gca(projection='3d'); |
|
| 818 | else: |
|
| 819 | raise NameError('Drawer supports only 2d and 3d data representation');
|
|
| @@ 791-795 (lines=5) @@ | ||
| 788 | ||
| 789 | @return (ax) Matplotlib axes where drawn clusters are presented. |
|
| 790 | ||
| 791 | """ |
|
| 792 | # Get dimension |
|
| 793 | dimension = 0; |
|
| 794 | if ( (data is not None) and (clusters is not None) ): |
|
| 795 | dimension = len(data[0]); |
|
| 796 | elif ( (data is None) and (clusters is not None) ): |
|
| 797 | dimension = len(clusters[0][0]); |
|
| 798 | else: |
|
| @@ 330-333 (lines=4) @@ | ||
| 327 | ||
| 328 | """! |
|
| 329 | @brief Draw canvas cluster descriptor. |
|
| 330 | ||
| 331 | @param[in] ax (Axis): Axis of the canvas where canvas cluster descriptor should be displayed. |
|
| 332 | @param[in] dimension (uint): Canvas dimension. |
|
| 333 | @param[in] cluster_descr (canvas_cluster_descr): Canvas cluster descriptor that should be displayed. |
|
| 334 | ||
| 335 | @return (fig) Figure where clusters are shown. |
|
| 336 | ||
| @@ 323-327 (lines=5) @@ | ||
| 320 | ax.grid(visible_grid); |
|
| 321 | ||
| 322 | if (display is True): |
|
| 323 | plt.show(); |
|
| 324 | ||
| 325 | return cluster_figure; |
|
| 326 | ||
| 327 | ||
| 328 | """! |
|
| 329 | @brief Draw canvas cluster descriptor. |
|
| 330 | ||