|
125 | 125 | "import pyvo\n", |
126 | 126 | "from pyvo.dal.adhoc import DatalinkResults, SodaQuery\n", |
127 | 127 | "\n", |
| 128 | + "import astropy\n", |
128 | 129 | "from astropy import units as u\n", |
129 | 130 | "from astropy.coordinates import SkyCoord, Angle\n", |
130 | 131 | "from astropy.io import fits\n", |
|
1054 | 1055 | "\n", |
1055 | 1056 | "High redshift galaxies are typically small in size. For this exercise, use aperture photometry with a relatively small aperture diameter (9 pixels) in order to obtain high S/N measurements and exclude neighbors.\n", |
1056 | 1057 | "\n", |
1057 | | - "#### 3.1.1 Ammending a typical search because of the rarity of z~3 galaxies in the mock data.\n", |
| 1058 | + "#### 3.1.1 Amending a typical search because of the rarity of z~3 galaxies in the mock data.\n", |
1058 | 1059 | "The mock galaxies that go into DP0.2 are created using the LSST Catalog Simulator (<a href=https://www.lsst.org/scientists/simulations/catsimcatSim>catSim</a>), and are based on an empirical model of the evolution of galaxies outlined in <a href=\"https://arxiv.org/abs/1907.06530\">Korytov et al. 2019</a>. The input model is based on realistic number densities, fluxes, and redshift distributions across cosmic time, and utilizes the UniverseMachine methodology to assign empirical properties (see <a href=\"https://arxiv.org/abs/1806.07893\">Behroozi et al. 2019</a>). \n", |
1059 | 1060 | "\n", |
1060 | 1061 | "Typically at any redshift, bright galaxies are rarer than faint galaxies, which are much more common. And typically in any patch of the sky, nearby galaxies will be much more common above the detection limit of a survey than distant $z\\sim3$ galaxies. This means that $z\\sim3$ galaxies that are bright enough to meet the criteria we want (G$ < 24.5$) will require a large search area to identify a statistical sample. So, in this example, we will first identify a parent sample of bright (G < 24.5) galaxies over a very large area (4 degrees) to ensure the parent sample contains enough rare distant galaxies.\n", |
|
1231 | 1232 | "results3.to_table()" |
1232 | 1233 | ] |
1233 | 1234 | }, |
| 1235 | + { |
| 1236 | + "cell_type": "markdown", |
| 1237 | + "id": "ac0043c2-8aa1-4fa3-8d0c-2bb2271214b9", |
| 1238 | + "metadata": {}, |
| 1239 | + "source": [ |
| 1240 | + "Perform an inner join between `results3` with `results` using the `obj_objectId` and `objectId` columns to ensure the correct rows from `results3` are matched with the correct rows from `results` in the rest of this section." |
| 1241 | + ] |
| 1242 | + }, |
| 1243 | + { |
| 1244 | + "cell_type": "code", |
| 1245 | + "execution_count": null, |
| 1246 | + "id": "40eace2f-6234-4fcd-85cc-4d0a7f984e34", |
| 1247 | + "metadata": {}, |
| 1248 | + "outputs": [], |
| 1249 | + "source": [ |
| 1250 | + "joined_results = astropy.table.join(results3.to_table(), results.to_table(), \n", |
| 1251 | + " keys_left='obj_objectId',\n", |
| 1252 | + " keys_right='objectId',\n", |
| 1253 | + " join_type='inner')\n", |
| 1254 | + "\n", |
| 1255 | + "joined_results" |
| 1256 | + ] |
| 1257 | + }, |
1234 | 1258 | { |
1235 | 1259 | "cell_type": "markdown", |
1236 | 1260 | "id": "77bda4aa-398c-47e3-957c-0d77c7b35f4c", |
|
1242 | 1266 | { |
1243 | 1267 | "cell_type": "code", |
1244 | 1268 | "execution_count": null, |
1245 | | - "id": "799441f5-cb29-42a9-94cb-9c345ff1818f", |
| 1269 | + "id": "08cce99e-f0cd-4110-b9ae-38ee24dcdff9", |
1246 | 1270 | "metadata": {}, |
1247 | 1271 | "outputs": [], |
1248 | 1272 | "source": [ |
|
1252 | 1276 | " fig, axs = plt.subplots(1, len(filt), figsize=(25, 25))\n", |
1253 | 1277 | "\n", |
1254 | 1278 | " for j, ax in enumerate(fig.axes):\n", |
1255 | | - " dataId_deep = {'patch': results['patch'][whlbg][i],\n", |
1256 | | - " 'tract': results['tract'][whlbg][i],\n", |
| 1279 | + " \n", |
| 1280 | + " dataId_deep = {'patch': joined_results['patch'][i].item(),\n", |
| 1281 | + " 'tract': joined_results['tract'][i].item(),\n", |
1257 | 1282 | " 'band': filt[j]}\n", |
1258 | | - " cutout = make_image_cutout(service, results['coord_ra'][whlbg][i],\n", |
1259 | | - " results['coord_dec'][whlbg][i],\n", |
| 1283 | + " cutout = make_image_cutout(service, joined_results['coord_ra'][i].item(),\n", |
| 1284 | + " joined_results['coord_dec'][i].item(),\n", |
1260 | 1285 | " cutout_size=0.001, imtype='deepCoadd',\n", |
1261 | 1286 | " dataId=dataId_deep,\n", |
1262 | 1287 | " filename='cutout_' + filt[j] + '_'\n", |
|
1266 | 1291 | " vmin=0, vmax=0.7, norm='linear', origin='lower')\n", |
1267 | 1292 | " ax.set_xticks([])\n", |
1268 | 1293 | " ax.set_yticks([])\n", |
1269 | | - " ax.text(.1, .9, filt[j]+'-band z=' + str(results3['ts_redshift'][i]),\n", |
| 1294 | + " ax.text(.1, .9, filt[j]+'-band z=' + str(joined_results['ts_redshift'][i].item()),\n", |
1270 | 1295 | " color='white')\n", |
1271 | 1296 | " \n", |
1272 | 1297 | " del dataId_deep, cutout" |
|
0 commit comments