|
538 | 538 | "metadata": {}, |
539 | 539 | "outputs": [], |
540 | 540 | "source": [ |
541 | | - "# %%opts Scatter [tools=['hover'], toolbar='above',height=400, width=400](color='grey')\n", |
| 541 | + "%%opts Scatter [tools=['hover'], toolbar='above',height=400, width=400](color='grey')\n", |
542 | 542 | "hv.Scatter(data)" |
543 | 543 | ] |
544 | 544 | }, |
|
601 | 601 | "cell_type": "markdown", |
602 | 602 | "metadata": {}, |
603 | 603 | "source": [ |
604 | | - "First, we will use the `astropy.visualization` library to define an asinh stretch and zscale interval and apply them to the calexp object. These are the same transformation that were applied in `03_Image_Display_and_Manipulation` notebook." |
| 604 | + "First, we will use the `astropy.visualization` library to define an asinh stretch and zscale interval and apply them to the calexp object. These are the same transformations that were applied in `03_Image_Display_and_Manipulation` notebook." |
605 | 605 | ] |
606 | 606 | }, |
607 | 607 | { |
|
619 | 619 | "cell_type": "markdown", |
620 | 620 | "metadata": {}, |
621 | 621 | "source": [ |
622 | | - "A note on [Image Indexing, Array Views, and Bounding Boxes](https://pipelines.lsst.io/modules/lsst.afw.image/indexing-conventions.html) in the Rubin Science Pipelines and Data Products. " |
623 | | - ] |
624 | | - }, |
625 | | - { |
626 | | - "cell_type": "markdown", |
627 | | - "metadata": {}, |
628 | | - "source": [ |
629 | | - "Define the (left, bottom, top, right) edges of the sensor image." |
| 622 | + "LSST’s image classes (Image, Mask, MaskedImage, and Exposure) use a pixel indexing convention that is different from both the convention used by `numpy.ndarray` objects and the convention used in FITS images. LSST typically labels the center of the lower left pixel of an image (0, 0). Consequently, we need to flip the image data array, " |
630 | 623 | ] |
631 | 624 | }, |
632 | 625 | { |
|
635 | 628 | "metadata": {}, |
636 | 629 | "outputs": [], |
637 | 630 | "source": [ |
| 631 | + "scaledImage = np.flipud(scaledImage)\n", |
| 632 | + "# bounds_img = (0, calexp.getDimensions()[1], calexp.getDimensions()[0],0)\n", |
638 | 633 | "bounds_img = (0, 0, calexp.getDimensions()[0], calexp.getDimensions()[1])" |
639 | 634 | ] |
640 | 635 | }, |
641 | 636 | { |
642 | 637 | "cell_type": "markdown", |
643 | 638 | "metadata": {}, |
644 | 639 | "source": [ |
645 | | - "We will use the matplotlib convention of placing the origin of an plot in the top left, we need to flip the data." |
646 | | - ] |
647 | | - }, |
648 | | - { |
649 | | - "cell_type": "code", |
650 | | - "execution_count": null, |
651 | | - "metadata": {}, |
652 | | - "outputs": [], |
653 | | - "source": [ |
654 | | - "scaledImage = np.flipud(scaledImage)\n", |
655 | | - "bounds_img = (0, calexp.getDimensions()[1], calexp.getDimensions()[0],0)" |
| 640 | + "Further details can be found at [Image Indexing, Array Views, and Bounding Boxes](https://pipelines.lsst.io/modules/lsst.afw.image/indexing-conventions.html) in the Rubin Science Pipelines and Data Products. " |
656 | 641 | ] |
657 | 642 | }, |
658 | 643 | { |
|
692 | 677 | "source": [ |
693 | 678 | "# Create the Image element.\n", |
694 | 679 | "img = hv.Image(scaledImage, bounds=bounds_img,\n", |
695 | | - " kdims=['x-axis', 'y-axis']).opts(\n", |
| 680 | + " kdims=['x', 'y']).opts(\n", |
696 | 681 | " cmap = \"Greys_r\", xlabel = 'X', ylabel ='Y',\n", |
697 | 682 | " title = dataIdToString(calexpId),\n", |
698 | 683 | " **img_opts)" |
|
981 | 966 | "right.x_range = Range1d(-1.5, 2.5)\n", |
982 | 967 | "right.y_range = Range1d(32., 16.)\n", |
983 | 968 | "right.xaxis.axis_label = 'g - r'\n", |
984 | | - "right.yaxis.axis_label = 'g'\n", |
985 | | - "\n", |
| 969 | + "right.yaxis.axis_label = 'g'" |
| 970 | + ] |
| 971 | + }, |
| 972 | + { |
| 973 | + "cell_type": "code", |
| 974 | + "execution_count": null, |
| 975 | + "metadata": {}, |
| 976 | + "outputs": [], |
| 977 | + "source": [ |
| 978 | + "# Display the grid of plots\n", |
986 | 979 | "p = gridplot([[left, right]])\n", |
987 | 980 | "show(p)" |
988 | 981 | ] |
|
1103 | 1096 | " legend_field=\"truth_type\",\n", |
1104 | 1097 | " color=factor_cmap('truth_type', 'Category10_3',\n", |
1105 | 1098 | " ['galaxy', 'star', 'SNe']))\n", |
1106 | | - "p.add_tools(hover)\n", |
| 1099 | + "p.add_tools(hover)" |
| 1100 | + ] |
| 1101 | + }, |
| 1102 | + { |
| 1103 | + "cell_type": "code", |
| 1104 | + "execution_count": null, |
| 1105 | + "metadata": {}, |
| 1106 | + "outputs": [], |
| 1107 | + "source": [ |
1107 | 1108 | "show(p)" |
1108 | 1109 | ] |
1109 | 1110 | }, |
|
0 commit comments