|
402 | 402 | "metadata": {},
|
403 | 403 | "outputs": [],
|
404 | 404 | "source": [
|
405 |
| - "table = workflow.compute(time_of_flight.TimeOfFlightLookupTable).squeeze()\n", |
| 405 | + "table = workflow.compute(time_of_flight.TimeOfFlightLookupTable)\n", |
406 | 406 | "\n",
|
407 | 407 | "# Overlay mean on the figure above\n",
|
408 | 408 | "table[\"distance\", 13].plot(ax=fig2.ax, color=\"C1\", ls=\"-\", marker=None)"
|
409 | 409 | ]
|
410 | 410 | },
|
411 | 411 | {
|
412 |
| - "attachments": {}, |
413 | 412 | "cell_type": "markdown",
|
414 | 413 | "id": "27",
|
415 | 414 | "metadata": {},
|
| 415 | + "source": [ |
| 416 | + "The full table covers a range of distances, and looks like" |
| 417 | + ] |
| 418 | + }, |
| 419 | + { |
| 420 | + "cell_type": "code", |
| 421 | + "execution_count": null, |
| 422 | + "id": "28", |
| 423 | + "metadata": {}, |
| 424 | + "outputs": [], |
| 425 | + "source": [ |
| 426 | + "table.plot()" |
| 427 | + ] |
| 428 | + }, |
| 429 | + { |
| 430 | + "attachments": {}, |
| 431 | + "cell_type": "markdown", |
| 432 | + "id": "29", |
| 433 | + "metadata": {}, |
416 | 434 | "source": [
|
417 | 435 | "### Computing a time-of-flight coordinate\n",
|
418 | 436 | "\n",
|
|
422 | 440 | {
|
423 | 441 | "cell_type": "code",
|
424 | 442 | "execution_count": null,
|
425 |
| - "id": "28", |
| 443 | + "id": "30", |
426 | 444 | "metadata": {},
|
427 | 445 | "outputs": [],
|
428 | 446 | "source": [
|
|
432 | 450 | },
|
433 | 451 | {
|
434 | 452 | "cell_type": "markdown",
|
435 |
| - "id": "29", |
| 453 | + "id": "31", |
436 | 454 | "metadata": {},
|
437 | 455 | "source": [
|
438 | 456 | "Histogramming the data for a plot should show a profile with 6 bumps that correspond to the frames:"
|
|
441 | 459 | {
|
442 | 460 | "cell_type": "code",
|
443 | 461 | "execution_count": null,
|
444 |
| - "id": "30", |
| 462 | + "id": "32", |
445 | 463 | "metadata": {},
|
446 | 464 | "outputs": [],
|
447 | 465 | "source": [
|
|
450 | 468 | },
|
451 | 469 | {
|
452 | 470 | "cell_type": "markdown",
|
453 |
| - "id": "31", |
| 471 | + "id": "33", |
454 | 472 | "metadata": {},
|
455 | 473 | "source": [
|
456 | 474 | "### Converting to wavelength\n",
|
|
461 | 479 | {
|
462 | 480 | "cell_type": "code",
|
463 | 481 | "execution_count": null,
|
464 |
| - "id": "32", |
| 482 | + "id": "34", |
465 | 483 | "metadata": {},
|
466 | 484 | "outputs": [],
|
467 | 485 | "source": [
|
|
481 | 499 | },
|
482 | 500 | {
|
483 | 501 | "cell_type": "markdown",
|
484 |
| - "id": "33", |
| 502 | + "id": "35", |
485 | 503 | "metadata": {},
|
486 | 504 | "source": [
|
487 | 505 | "### Comparing to the ground truth\n",
|
|
493 | 511 | {
|
494 | 512 | "cell_type": "code",
|
495 | 513 | "execution_count": null,
|
496 |
| - "id": "34", |
| 514 | + "id": "36", |
497 | 515 | "metadata": {},
|
498 | 516 | "outputs": [],
|
499 | 517 | "source": [
|
|
510 | 528 | },
|
511 | 529 | {
|
512 | 530 | "cell_type": "markdown",
|
513 |
| - "id": "35", |
| 531 | + "id": "37", |
514 | 532 | "metadata": {},
|
515 | 533 | "source": [
|
516 | 534 | "## Multiple detector pixels\n",
|
|
526 | 544 | {
|
527 | 545 | "cell_type": "code",
|
528 | 546 | "execution_count": null,
|
529 |
| - "id": "36", |
| 547 | + "id": "38", |
530 | 548 | "metadata": {},
|
531 | 549 | "outputs": [],
|
532 | 550 | "source": [
|
|
544 | 562 | },
|
545 | 563 | {
|
546 | 564 | "cell_type": "markdown",
|
547 |
| - "id": "37", |
| 565 | + "id": "39", |
548 | 566 | "metadata": {},
|
549 | 567 | "source": [
|
550 | 568 | "Our raw data has now a `detector_number` dimension of length 2.\n",
|
|
555 | 573 | {
|
556 | 574 | "cell_type": "code",
|
557 | 575 | "execution_count": null,
|
558 |
| - "id": "38", |
| 576 | + "id": "40", |
559 | 577 | "metadata": {},
|
560 | 578 | "outputs": [],
|
561 | 579 | "source": [
|
|
570 | 588 | },
|
571 | 589 | {
|
572 | 590 | "cell_type": "markdown",
|
573 |
| - "id": "39", |
| 591 | + "id": "41", |
574 | 592 | "metadata": {},
|
575 | 593 | "source": [
|
576 | 594 | "Computing time-of-flight is done in the same way as above.\n",
|
|
580 | 598 | {
|
581 | 599 | "cell_type": "code",
|
582 | 600 | "execution_count": null,
|
583 |
| - "id": "40", |
| 601 | + "id": "42", |
584 | 602 | "metadata": {},
|
585 | 603 | "outputs": [],
|
586 | 604 | "source": [
|
|
614 | 632 | },
|
615 | 633 | {
|
616 | 634 | "cell_type": "markdown",
|
617 |
| - "id": "41", |
| 635 | + "id": "43", |
618 | 636 | "metadata": {},
|
619 | 637 | "source": [
|
620 | 638 | "## Handling time overlap between subframes\n",
|
|
634 | 652 | {
|
635 | 653 | "cell_type": "code",
|
636 | 654 | "execution_count": null,
|
637 |
| - "id": "42", |
| 655 | + "id": "44", |
638 | 656 | "metadata": {},
|
639 | 657 | "outputs": [],
|
640 | 658 | "source": [
|
|
665 | 683 | },
|
666 | 684 | {
|
667 | 685 | "cell_type": "markdown",
|
668 |
| - "id": "43", |
| 686 | + "id": "45", |
669 | 687 | "metadata": {},
|
670 | 688 | "source": [
|
671 | 689 | "We can now see that there is no longer a gap between the two frames at the center of each pulse (green region).\n",
|
|
677 | 695 | {
|
678 | 696 | "cell_type": "code",
|
679 | 697 | "execution_count": null,
|
680 |
| - "id": "44", |
| 698 | + "id": "46", |
681 | 699 | "metadata": {},
|
682 | 700 | "outputs": [],
|
683 | 701 | "source": [
|
|
696 | 714 | },
|
697 | 715 | {
|
698 | 716 | "cell_type": "markdown",
|
699 |
| - "id": "45", |
| 717 | + "id": "47", |
700 | 718 | "metadata": {},
|
701 | 719 | "source": [
|
702 | 720 | "The data in the lookup table contains both the mean time-of-flight for each distance and time-of-arrival bin,\n",
|
|
713 | 731 | {
|
714 | 732 | "cell_type": "code",
|
715 | 733 | "execution_count": null,
|
716 |
| - "id": "46", |
| 734 | + "id": "48", |
717 | 735 | "metadata": {},
|
718 | 736 | "outputs": [],
|
719 | 737 | "source": [
|
720 |
| - "table = workflow.compute(time_of_flight.TimeOfFlightLookupTable).squeeze()\n", |
| 738 | + "table = workflow.compute(time_of_flight.TimeOfFlightLookupTable)\n", |
721 | 739 | "table.plot() / (sc.stddevs(table) / sc.values(table)).plot(norm=\"log\")"
|
722 | 740 | ]
|
723 | 741 | },
|
724 | 742 | {
|
725 | 743 | "cell_type": "markdown",
|
726 |
| - "id": "47", |
| 744 | + "id": "49", |
727 | 745 | "metadata": {},
|
728 | 746 | "source": [
|
729 | 747 | "The workflow has a parameter which is used to mask out regions where the standard deviation is above a certain threshold.\n",
|
|
737 | 755 | {
|
738 | 756 | "cell_type": "code",
|
739 | 757 | "execution_count": null,
|
740 |
| - "id": "48", |
| 758 | + "id": "50", |
741 | 759 | "metadata": {},
|
742 | 760 | "outputs": [],
|
743 | 761 | "source": [
|
744 | 762 | "workflow[time_of_flight.LookupTableRelativeErrorThreshold] = 0.01\n",
|
745 | 763 | "\n",
|
746 |
| - "workflow.compute(time_of_flight.TimeOfFlightLookupTable).squeeze().plot()" |
| 764 | + "workflow.compute(time_of_flight.TimeOfFlightLookupTable).plot()" |
747 | 765 | ]
|
748 | 766 | },
|
749 | 767 | {
|
750 | 768 | "cell_type": "markdown",
|
751 |
| - "id": "49", |
| 769 | + "id": "51", |
752 | 770 | "metadata": {},
|
753 | 771 | "source": [
|
754 | 772 | "We can now see that the central region is masked out.\n",
|
|
763 | 781 | {
|
764 | 782 | "cell_type": "code",
|
765 | 783 | "execution_count": null,
|
766 |
| - "id": "50", |
| 784 | + "id": "52", |
767 | 785 | "metadata": {},
|
768 | 786 | "outputs": [],
|
769 | 787 | "source": [
|
|
0 commit comments