|
444 | 444 | ] |
445 | 445 | }, |
446 | 446 | { |
447 | | - "metadata": {}, |
448 | 447 | "cell_type": "code", |
449 | | - "source": "darks = electrons.darks.despiked", |
450 | 448 | "id": "7b482a566ba8ae28", |
| 449 | + "metadata": {}, |
| 450 | + "source": [ |
| 451 | + "darks = electrons.darks.despiked" |
| 452 | + ], |
451 | 453 | "outputs": [], |
452 | 454 | "execution_count": null |
453 | 455 | }, |
454 | 456 | { |
455 | | - "metadata": {}, |
456 | 457 | "cell_type": "code", |
457 | | - "source": "dark = darks.mean(darks.axis_time)", |
458 | 458 | "id": "1667176b2b7fa5e2", |
| 459 | + "metadata": {}, |
| 460 | + "source": [ |
| 461 | + "dark = darks.mean(darks.axis_time)" |
| 462 | + ], |
459 | 463 | "outputs": [], |
460 | 464 | "execution_count": null |
461 | 465 | }, |
|
472 | 476 | { |
473 | 477 | "cell_type": "code", |
474 | 478 | "id": "e02eff69", |
475 | | - "metadata": { |
476 | | - "scrolled": false |
477 | | - }, |
| 479 | + "metadata": {}, |
478 | 480 | "source": [ |
479 | 481 | "fig, ax = na.plt.subplots(\n", |
480 | 482 | " axis_rows=axis_channel,\n", |
|
574 | 576 | { |
575 | 577 | "cell_type": "code", |
576 | 578 | "id": "94c2f8c1", |
577 | | - "metadata": { |
578 | | - "scrolled": false |
579 | | - }, |
| 579 | + "metadata": {}, |
580 | 580 | "source": [ |
581 | 581 | "hist = na.histogram(\n", |
582 | | - " residual.taps.outputs, \n", |
| 582 | + " residual.taps.outputs,\n", |
583 | 583 | " axis=axis_txy,\n", |
584 | 584 | " bins=dict(values=51),\n", |
585 | 585 | " min=-20 * u.electron,\n", |
|
765 | 765 | "cell_type": "raw", |
766 | 766 | "id": "9d4a66db", |
767 | 767 | "metadata": { |
768 | | - "raw_mimetype": "text/restructuredtext" |
| 768 | + "editable": true, |
| 769 | + "raw_mimetype": "text/restructuredtext", |
| 770 | + "slideshow": { |
| 771 | + "slide_type": "" |
| 772 | + }, |
| 773 | + "tags": [] |
769 | 774 | }, |
770 | 775 | "source": [ |
771 | 776 | "Compute the `Pearson correlation coefficient <https://en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_\n", |
|
786 | 791 | { |
787 | 792 | "cell_type": "code", |
788 | 793 | "id": "51302e0b", |
789 | | - "metadata": {}, |
| 794 | + "metadata": { |
| 795 | + "editable": true, |
| 796 | + "slideshow": { |
| 797 | + "slide_type": "" |
| 798 | + }, |
| 799 | + "tags": [] |
| 800 | + }, |
790 | 801 | "source": [ |
791 | 802 | "scipy.stats.pearsonr(\n", |
792 | 803 | " x=where_spike.ndarray,\n", |
|
801 | 812 | "cell_type": "raw", |
802 | 813 | "id": "1cda4f3f", |
803 | 814 | "metadata": { |
804 | | - "raw_mimetype": "text/restructuredtext" |
| 815 | + "editable": true, |
| 816 | + "raw_mimetype": "", |
| 817 | + "slideshow": { |
| 818 | + "slide_type": "" |
| 819 | + }, |
| 820 | + "tags": [] |
805 | 821 | }, |
806 | 822 | "source": [ |
807 | 823 | "As we can see, the spikes are slightly correlated with the image.\n", |
808 | 824 | "This means that there are some small fraction of pixels wrongly identified as spikes." |
809 | 825 | ] |
810 | 826 | }, |
| 827 | + { |
| 828 | + "cell_type": "raw", |
| 829 | + "id": "88c64473-2a29-4e51-8fc7-f68f444fe19c", |
| 830 | + "metadata": { |
| 831 | + "editable": true, |
| 832 | + "raw_mimetype": "text/x-rst", |
| 833 | + "slideshow": { |
| 834 | + "slide_type": "" |
| 835 | + }, |
| 836 | + "tags": [] |
| 837 | + }, |
| 838 | + "source": [ |
| 839 | + "To match oberservations, we need to undo an electronic flip of the image incident on the ESIS CCDs about the `detector_y` axis." |
| 840 | + ] |
| 841 | + }, |
| 842 | + { |
| 843 | + "cell_type": "code", |
| 844 | + "id": "b05a4b3e849e0451", |
| 845 | + "metadata": {}, |
| 846 | + "source": [ |
| 847 | + "flipped_outputs = despiked.outputs[dict(detector_y=slice(None, None, -1))]" |
| 848 | + ], |
| 849 | + "outputs": [], |
| 850 | + "execution_count": null |
| 851 | + }, |
811 | 852 | { |
812 | 853 | "cell_type": "raw", |
813 | 854 | "id": "5e090187", |
814 | 855 | "metadata": { |
815 | | - "raw_mimetype": "text/restructuredtext" |
| 856 | + "editable": true, |
| 857 | + "raw_mimetype": "text/restructuredtext", |
| 858 | + "slideshow": { |
| 859 | + "slide_type": "" |
| 860 | + }, |
| 861 | + "tags": [] |
816 | 862 | }, |
817 | 863 | "source": [ |
818 | 864 | "The last thing to do is to convert the output to an instance of :class:`esis.data.Level_1`.\n", |
|
826 | 872 | "source": [ |
827 | 873 | "level_1 = esis.data.Level_1(\n", |
828 | 874 | " inputs=despiked.inputs,\n", |
829 | | - " outputs=despiked.outputs,\n", |
| 875 | + " outputs=flipped_outputs,\n", |
830 | 876 | " axis_time=axis_time,\n", |
831 | 877 | " axis_channel=axis_channel,\n", |
832 | 878 | " axis_x=axis_x,\n", |
|
874 | 920 | "name": "python", |
875 | 921 | "nbconvert_exporter": "python", |
876 | 922 | "pygments_lexer": "ipython3", |
877 | | - "version": "3.11.1" |
| 923 | + "version": "3.12.12" |
878 | 924 | } |
879 | 925 | }, |
880 | 926 | "nbformat": 4, |
|
0 commit comments