|
452 | 452 | "* A position field (`\"P\"`) for angular clustering and galaxy-galaxy lensing;\n",
|
453 | 453 | "* A shear field (`\"G\"`) for cosmic shear and galaxy-galaxy lensing.\n",
|
454 | 454 | "\n",
|
455 |
| - "We also specify that the shear field should flip the sign of the \"G2\" column by adding a minus sign." |
| 455 | + "We also specify that the shear field should flip the sign of the \"G2\" column by adding a minus sign.\n", |
| 456 | + "\n", |
| 457 | + "Finally, we define the optional names of the weight functions (`\"V\"`, `\"W\"`) of the fields. These will be used further down below to compute mixing matrices for the fields." |
456 | 458 | ]
|
457 | 459 | },
|
458 | 460 | {
|
|
465 | 467 | "lonlat = ('RIGHT_ASCENSION', 'DECLINATION')\n",
|
466 | 468 | "\n",
|
467 | 469 | "fields = {\n",
|
468 |
| - " 'P': Positions(*lonlat),\n", |
469 |
| - " 'G': Shears(*lonlat, 'G1', '-G2', 'WEIGHT'),\n", |
| 470 | + " 'P': Positions(*lonlat, weight=\"V\"),\n", |
| 471 | + " 'G': Shears(*lonlat, 'G1', '-G2', 'WEIGHT', weight=\"W\"),\n", |
470 | 472 | "}"
|
471 | 473 | ]
|
472 | 474 | },
|
|
520 | 522 | {
|
521 | 523 | "data": {
|
522 | 524 | "application/vnd.jupyter.widget-view+json": {
|
523 |
| - "model_id": "2a0ea2d6fc02466fb00059925c44032e", |
| 525 | + "model_id": "63d6558897214c0fbad71ed81e70f7db", |
524 | 526 | "version_major": 2,
|
525 | 527 | "version_minor": 0
|
526 | 528 | },
|
|
534 | 536 | {
|
535 | 537 | "data": {
|
536 | 538 | "text/html": [
|
537 |
| - "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">/Users/ntessore/code/heracles-ec/heracles/heracles/fields.py:247: UserWarning: position and visibility maps have \n", |
| 539 | + "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">/Users/ntessore/code/heracles-ec/heracles/heracles/fields.py:254: UserWarning: position and visibility maps have \n", |
538 | 540 | "different NSIDE\n",
|
539 | 541 | " warnings.warn(\"position and visibility maps have different NSIDE\")\n",
|
540 | 542 | "</pre>\n"
|
541 | 543 | ],
|
542 | 544 | "text/plain": [
|
543 |
| - "/Users/ntessore/code/heracles-ec/heracles/heracles/fields.py:247: UserWarning: position and visibility maps have \n", |
| 545 | + "/Users/ntessore/code/heracles-ec/heracles/heracles/fields.py:254: UserWarning: position and visibility maps have \n", |
544 | 546 | "different NSIDE\n",
|
545 | 547 | " warnings.warn(\"position and visibility maps have different NSIDE\")\n"
|
546 | 548 | ]
|
|
690 | 692 | {
|
691 | 693 | "data": {
|
692 | 694 | "application/vnd.jupyter.widget-view+json": {
|
693 |
| - "model_id": "73b9269235fb47b9b79d26f456f8962e", |
| 695 | + "model_id": "ed443fdc7af948e1b3dfeb1e6740b8a9", |
694 | 696 | "version_major": 2,
|
695 | 697 | "version_minor": 0
|
696 | 698 | },
|
|
923 | 925 | {
|
924 | 926 | "data": {
|
925 | 927 | "application/vnd.jupyter.widget-view+json": {
|
926 |
| - "model_id": "7eea7c123c304cfeb5f2150ab6db9012", |
| 928 | + "model_id": "2d17b05fc35f4e95aadb24b0e1fe989c", |
927 | 929 | "version_major": 2,
|
928 | 930 | "version_minor": 0
|
929 | 931 | },
|
|
1027 | 1029 | {
|
1028 | 1030 | "data": {
|
1029 | 1031 | "application/vnd.jupyter.widget-view+json": {
|
1030 |
| - "model_id": "32abfabf091a441b9c0b716b3d476aae", |
| 1032 | + "model_id": "1cccc3fe4f304b4fa8b25ecc5da7972f", |
1031 | 1033 | "version_major": 2,
|
1032 | 1034 | "version_minor": 0
|
1033 | 1035 | },
|
|
1114 | 1116 | }
|
1115 | 1117 | ],
|
1116 | 1118 | "source": [
|
1117 |
| - "mms = mixing_matrices(cls_mm, l1max=lmax, l2max=lmax, l3max=lmax_mm)" |
| 1119 | + "mms = mixing_matrices(fields, cls_mm, l1max=lmax, l2max=lmax, l3max=lmax_mm)" |
1118 | 1120 | ]
|
1119 | 1121 | },
|
1120 | 1122 | {
|
1121 | 1123 | "cell_type": "markdown",
|
1122 | 1124 | "metadata": {},
|
1123 | 1125 | "source": [
|
1124 |
| - "The mixing matrices are returned in a toc dict with slightly different names: They use a two letter code that indicates which angular power spectra are mixed by a given matrix:\n", |
| 1126 | + "The mixing matrices are returned in a toc dict with familiar names: They correspond to the _output_ angular power spectra after mixing by a given matrix:\n", |
1125 | 1127 | "\n",
|
1126 |
| - "* `00` for `(P, P) → (P, P)`;\n", |
1127 |
| - "* `0+` for `(P, E) → (P, E)` and `(P, B) → (P, B)`;\n", |
1128 |
| - "* `++` for `(E, E) → (E, E)` and `(B, B) → (B, B)`;\n", |
1129 |
| - "* `--` for `(E, E) → (B, B)` and `(B, B) → (E, E)`;\n", |
1130 |
| - "* `+-` for `(E, B) → (E, B)`.\n", |
| 1128 | + "* `P, P` for `(P, P) → (P, P)`;\n", |
| 1129 | + "* `P, G_E` for `(P, G_E) → (P, G_E)`, as well as `(P, G_B) → (P, G_B)`;\n", |
| 1130 | + "* `G_E, G_E` for `(G_E, G_E) → (G_E, G_E)`, as well as `(G_B, G_B) → (G_B, G_B)`;\n", |
| 1131 | + "* `G_B, G_B` for `(G_E, G_E) → (G_B, G_B)`, as well as `(G_B, G_B) → (G_E, G_E)`;\n", |
| 1132 | + "* `G_E, G_B` for `(G_E, G_B) → (G_E, G_B)`.\n", |
1131 | 1133 | "\n",
|
1132 |
| - "For more details, see the paper by Brown, Castro & Taylor (2005). Note that the `+-` mixing matrix here is not the $W^{+-}$ matrix from said paper." |
| 1134 | + "For more details, see e.g. the paper by Brown, Castro & Taylor (2005)." |
1133 | 1135 | ]
|
1134 | 1136 | },
|
1135 | 1137 | {
|
|
1140 | 1142 | {
|
1141 | 1143 | "data": {
|
1142 | 1144 | "text/plain": [
|
1143 |
| - "[('00', 0, 0),\n", |
1144 |
| - " ('0+', 0, 0),\n", |
1145 |
| - " ('00', 0, 1),\n", |
1146 |
| - " ('0+', 0, 1),\n", |
1147 |
| - " ('00', 0, 2),\n", |
1148 |
| - " ('0+', 0, 2),\n", |
1149 |
| - " ('00', 0, 3),\n", |
1150 |
| - " ('0+', 0, 3),\n", |
1151 |
| - " ('00', 0, 4),\n", |
1152 |
| - " ('0+', 0, 4),\n", |
1153 |
| - " ('00', 0, 5),\n", |
1154 |
| - " ('0+', 0, 5),\n", |
1155 |
| - " ('00', 0, 6),\n", |
1156 |
| - " ('0+', 0, 6),\n", |
1157 |
| - " ('00', 0, 7)]" |
| 1145 | + "[('P', 'P', 0, 0),\n", |
| 1146 | + " ('P', 'G_E', 0, 0),\n", |
| 1147 | + " ('P', 'P', 0, 1),\n", |
| 1148 | + " ('P', 'G_E', 0, 1),\n", |
| 1149 | + " ('P', 'P', 0, 2),\n", |
| 1150 | + " ('P', 'G_E', 0, 2),\n", |
| 1151 | + " '...',\n", |
| 1152 | + " ('G_E', 'G_B', 8, 9),\n", |
| 1153 | + " ('P', 'P', 9, 9),\n", |
| 1154 | + " ('P', 'G_E', 9, 9),\n", |
| 1155 | + " ('G_E', 'G_E', 9, 9),\n", |
| 1156 | + " ('G_B', 'G_B', 9, 9),\n", |
| 1157 | + " ('G_E', 'G_B', 9, 9)]" |
1158 | 1158 | ]
|
1159 | 1159 | },
|
1160 | 1160 | "execution_count": 37,
|
|
1163 | 1163 | }
|
1164 | 1164 | ],
|
1165 | 1165 | "source": [
|
1166 |
| - "list(mms.keys())[:15]" |
| 1166 | + "list(mms.keys())[:6] + ['...'] + list(mms.keys())[-6:]" |
1167 | 1167 | ]
|
1168 | 1168 | },
|
1169 | 1169 | {
|
|
1234 | 1234 | }
|
1235 | 1235 | ],
|
1236 | 1236 | "source": [
|
1237 |
| - "plt.imshow(mms['++', i, i], cmap='binary',\n", |
| 1237 | + "plt.imshow(mms['G_E', 'G_E', i, i], cmap='binary',\n", |
1238 | 1238 | " norm=mpl.colors.LogNorm(vmin=1e-7))\n",
|
1239 | 1239 | "plt.colorbar(pad=0.025, fraction=0.0465)\n",
|
1240 | 1240 | "plt.show()"
|
|
1569 | 1569 | " cl = camb_cls[f'W{i+1}xW{i+j+1}']\n",
|
1570 | 1570 | "\n",
|
1571 | 1571 | " if s1.source_type == 'counts' and s2.source_type == 'counts':\n",
|
1572 |
| - " theory_cls['P', 'P', i1, i2] = mms['00', i1, i2] @ cl\n", |
| 1572 | + " theory_cls['P', 'P', i1, i2] = mms['P', 'P', i1, i2] @ cl\n", |
1573 | 1573 | " elif s1.source_type == 'lensing' and s2.source_type == 'lensing':\n",
|
1574 |
| - " theory_cls['G_E', 'G_E', i1, i2] = mms['++', i1, i2] @ (cl*fl**2)\n", |
1575 |
| - " theory_cls['G_B', 'G_B', i1, i2] = mms['--', i1, i2] @ (cl*fl**2)\n", |
| 1574 | + " theory_cls['G_E', 'G_E', i1, i2] = mms['G_E', 'G_E', i1, i2] @ (cl*fl**2)\n", |
| 1575 | + " theory_cls['G_B', 'G_B', i1, i2] = mms['G_B', 'G_B', i1, i2] @ (cl*fl**2)\n", |
1576 | 1576 | " elif s1.source_type == 'counts' and s2.source_type == 'lensing':\n",
|
1577 |
| - " theory_cls['P', 'G_E', i1, i2] = mms['0+', i1, i2] @ (cl*fl)\n", |
| 1577 | + " theory_cls['P', 'G_E', i1, i2] = mms['P', 'G_E', i1, i2] @ (cl*fl)\n", |
1578 | 1578 | " theory_cls['P', 'G_B', i1, i2] = np.zeros_like(cl)\n",
|
1579 | 1579 | " elif s1.source_type == 'lensing' and s2.source_type == 'counts':\n",
|
1580 |
| - " theory_cls['P', 'G_E', i2, i1] = mms['0+', i2, i1] @ (cl*fl)\n", |
| 1580 | + " theory_cls['P', 'G_E', i2, i1] = mms['P', 'G_E', i2, i1] @ (cl*fl)\n", |
1581 | 1581 | " theory_cls['P', 'G_B', i2, i1] = np.zeros_like(cl)"
|
1582 | 1582 | ]
|
1583 | 1583 | },
|
|
0 commit comments