|
804 | 804 | "id": "232f4189-d6f3-49f2-b5ce-4c65a0360de4", |
805 | 805 | "metadata": {}, |
806 | 806 | "source": [ |
807 | | - "Retrieve the `patch` and the objects' x and y coordinates." |
| 807 | + "Retrieve the `patch`, the objects' x and y coordinates, and the r-band Point Spread Function (PSF) flux (with uncertainty)." |
808 | 808 | ] |
809 | 809 | }, |
810 | 810 | { |
|
815 | 815 | "outputs": [], |
816 | 816 | "source": [ |
817 | 817 | "use_columns = ['objectId', 'patch',\n", |
818 | | - " 'r_centroid_x', 'r_centroid_y']\n", |
| 818 | + " 'r_centroid_x', 'r_centroid_y',\n", |
| 819 | + " 'r_psfFlux', 'r_psfFluxErr']\n", |
819 | 820 | "objects = butler.get('object', tract=dataId.get('tract'),\n", |
820 | 821 | " parameters={'columns': use_columns})" |
821 | 822 | ] |
|
839 | 840 | "print(\"Number of objects: \", len(tx))" |
840 | 841 | ] |
841 | 842 | }, |
| 843 | + { |
| 844 | + "cell_type": "markdown", |
| 845 | + "id": "ac155358-63e0-424a-aa3e-e2bb674356b7", |
| 846 | + "metadata": {}, |
| 847 | + "source": [ |
| 848 | + "Since there are many objects, filter objects by their Signal-to-Noise ratio (S/N) to make the following scatter plot more clear. " |
| 849 | + ] |
| 850 | + }, |
| 851 | + { |
| 852 | + "cell_type": "code", |
| 853 | + "execution_count": null, |
| 854 | + "id": "ca27a145-8b32-4647-bd94-3f13a4766fc3", |
| 855 | + "metadata": {}, |
| 856 | + "outputs": [], |
| 857 | + "source": [ |
| 858 | + "sel = objects['r_psfFlux'] / objects['r_psfFluxErr'] > 300\n", |
| 859 | + "objects = objects[sel]\n", |
| 860 | + "tx = np.where(objects['patch'] == dataId.get('patch'))[0]\n", |
| 861 | + "print(\"Number of objects: \", len(tx))" |
| 862 | + ] |
| 863 | + }, |
842 | 864 | { |
843 | 865 | "cell_type": "markdown", |
844 | 866 | "id": "8cd049b7-b478-4cea-943b-a7e9dc75dc90", |
|
863 | 885 | " for i in tx:\n", |
864 | 886 | " afw_display.dot('o', objects[i]['r_centroid_x'],\n", |
865 | 887 | " objects[i]['r_centroid_y'],\n", |
866 | | - " size=20, ctype='orange')\n", |
| 888 | + " size=30, ctype='orange')\n", |
867 | 889 | "plt.show()\n", |
868 | 890 | "remove_figure(fig)" |
869 | 891 | ] |
|
904 | 926 | "dataId = visit_image_refs[0].dataId\n", |
905 | 927 | "\n", |
906 | 928 | "use_columns = ['sourceId', 'visit',\n", |
907 | | - " 'x', 'y']\n", |
| 929 | + " 'x', 'y',\n", |
| 930 | + " 'psfFlux', 'psfFluxErr']\n", |
908 | 931 | "\n", |
909 | 932 | "sources = butler.get('source', dataId=dataId,\n", |
910 | 933 | " parameters={'columns': use_columns})\n", |
911 | 934 | "\n", |
912 | 935 | "print(\"Number of sources: \", len(sources))" |
913 | 936 | ] |
914 | 937 | }, |
| 938 | + { |
| 939 | + "cell_type": "markdown", |
| 940 | + "id": "0f14f134-308c-4ead-b759-70d610d03718", |
| 941 | + "metadata": {}, |
| 942 | + "source": [ |
| 943 | + "Filter the sources by S/N." |
| 944 | + ] |
| 945 | + }, |
| 946 | + { |
| 947 | + "cell_type": "code", |
| 948 | + "execution_count": null, |
| 949 | + "id": "c34db8eb-09fd-487f-b6f7-a7320851e2df", |
| 950 | + "metadata": {}, |
| 951 | + "outputs": [], |
| 952 | + "source": [ |
| 953 | + "sel = sources['psfFlux'] / sources['psfFluxErr'] > 300\n", |
| 954 | + "sources = sources[sel]" |
| 955 | + ] |
| 956 | + }, |
915 | 957 | { |
916 | 958 | "cell_type": "markdown", |
917 | 959 | "id": "a94cacd5-1b60-4943-9c88-381c87f14490", |
|
936 | 978 | " for i in sources:\n", |
937 | 979 | " afw_display.dot('o', i['x'],\n", |
938 | 980 | " i['y'],\n", |
939 | | - " size=3, ctype='orange')\n", |
| 981 | + " size=30, ctype='orange')\n", |
940 | 982 | "plt.show()\n", |
941 | 983 | "remove_figure(fig)" |
942 | 984 | ] |
|
0 commit comments