|
12 | 12 | { |
13 | 13 | "cell_type": "code", |
14 | 14 | "execution_count": null, |
15 | | - "metadata": {}, |
| 15 | + "metadata": { |
| 16 | + "ExecuteTime": { |
| 17 | + "end_time": "2026-05-06T03:30:43.079757Z", |
| 18 | + "start_time": "2026-05-06T03:30:41.963960Z" |
| 19 | + } |
| 20 | + }, |
16 | 21 | "outputs": [], |
17 | 22 | "source": [ |
18 | 23 | "# Import Packages and setup\n", |
|
35 | 40 | { |
36 | 41 | "cell_type": "code", |
37 | 42 | "execution_count": null, |
38 | | - "metadata": {}, |
| 43 | + "metadata": { |
| 44 | + "ExecuteTime": { |
| 45 | + "end_time": "2026-05-06T03:30:43.322047Z", |
| 46 | + "start_time": "2026-05-06T03:30:43.080885Z" |
| 47 | + } |
| 48 | + }, |
39 | 49 | "outputs": [], |
40 | 50 | "source": [ |
41 | 51 | "from huggingface_hub import hf_hub_download\n", |
|
84 | 94 | { |
85 | 95 | "cell_type": "code", |
86 | 96 | "execution_count": null, |
87 | | - "metadata": {}, |
| 97 | + "metadata": { |
| 98 | + "ExecuteTime": { |
| 99 | + "end_time": "2026-05-06T03:30:44.358652Z", |
| 100 | + "start_time": "2026-05-06T03:30:43.323163Z" |
| 101 | + } |
| 102 | + }, |
88 | 103 | "outputs": [], |
89 | 104 | "source": [ |
90 | 105 | "obs = sc2.Observation(data, weights=weights, psf=psf, channels=channels, name=\"HSC\")" |
|
114 | 129 | { |
115 | 130 | "cell_type": "code", |
116 | 131 | "execution_count": null, |
117 | | - "metadata": {}, |
| 132 | + "metadata": { |
| 133 | + "ExecuteTime": { |
| 134 | + "end_time": "2026-05-06T03:30:44.928542Z", |
| 135 | + "start_time": "2026-05-06T03:30:44.382265Z" |
| 136 | + } |
| 137 | + }, |
118 | 138 | "outputs": [], |
119 | 139 | "source": [ |
120 | 140 | "norm = sc2.plot.AsinhAutomaticNorm(obs)\n", |
|
132 | 152 | { |
133 | 153 | "cell_type": "code", |
134 | 154 | "execution_count": null, |
135 | | - "metadata": {}, |
| 155 | + "metadata": { |
| 156 | + "ExecuteTime": { |
| 157 | + "end_time": "2026-05-06T03:30:46.307450Z", |
| 158 | + "start_time": "2026-05-06T03:30:44.941167Z" |
| 159 | + } |
| 160 | + }, |
136 | 161 | "outputs": [], |
137 | 162 | "source": [ |
138 | 163 | "model_frame = sc2.Frame.from_observations(obs)\n", |
|
159 | 184 | { |
160 | 185 | "cell_type": "code", |
161 | 186 | "execution_count": null, |
162 | | - "metadata": {}, |
| 187 | + "metadata": { |
| 188 | + "ExecuteTime": { |
| 189 | + "end_time": "2026-05-06T03:30:47.519240Z", |
| 190 | + "start_time": "2026-05-06T03:30:46.321171Z" |
| 191 | + } |
| 192 | + }, |
163 | 193 | "outputs": [], |
164 | 194 | "source": [ |
165 | 195 | "obs.match(model_frame)\n", |
|
180 | 210 | { |
181 | 211 | "cell_type": "code", |
182 | 212 | "execution_count": null, |
183 | | - "metadata": {}, |
| 213 | + "metadata": { |
| 214 | + "ExecuteTime": { |
| 215 | + "end_time": "2026-05-06T03:30:50.770854Z", |
| 216 | + "start_time": "2026-05-06T03:30:47.529312Z" |
| 217 | + } |
| 218 | + }, |
184 | 219 | "outputs": [], |
185 | 220 | "source": [ |
186 | 221 | "with sc2.Scene(model_frame) as scene:\n", |
|
201 | 236 | { |
202 | 237 | "cell_type": "code", |
203 | 238 | "execution_count": null, |
204 | | - "metadata": {}, |
| 239 | + "metadata": { |
| 240 | + "ExecuteTime": { |
| 241 | + "end_time": "2026-05-06T03:30:51.111693Z", |
| 242 | + "start_time": "2026-05-06T03:30:50.789270Z" |
| 243 | + } |
| 244 | + }, |
205 | 245 | "outputs": [], |
206 | 246 | "source": [ |
207 | 247 | "# we know source 0 is a star:\n", |
|
223 | 263 | { |
224 | 264 | "cell_type": "code", |
225 | 265 | "execution_count": null, |
226 | | - "metadata": {}, |
| 266 | + "metadata": { |
| 267 | + "ExecuteTime": { |
| 268 | + "end_time": "2026-05-06T03:30:52.309994Z", |
| 269 | + "start_time": "2026-05-06T03:30:51.112795Z" |
| 270 | + } |
| 271 | + }, |
227 | 272 | "outputs": [], |
228 | 273 | "source": [ |
229 | 274 | "sc2.plot.scene(\n", |
|
261 | 306 | { |
262 | 307 | "cell_type": "code", |
263 | 308 | "execution_count": null, |
264 | | - "metadata": {}, |
| 309 | + "metadata": { |
| 310 | + "ExecuteTime": { |
| 311 | + "end_time": "2026-05-06T03:30:52.628502Z", |
| 312 | + "start_time": "2026-05-06T03:30:52.347148Z" |
| 313 | + } |
| 314 | + }, |
265 | 315 | "outputs": [], |
266 | 316 | "source": [ |
267 | 317 | "scene_array = scene() # evaluate the model\n", |
|
278 | 328 | { |
279 | 329 | "cell_type": "code", |
280 | 330 | "execution_count": null, |
281 | | - "metadata": {}, |
| 331 | + "metadata": { |
| 332 | + "ExecuteTime": { |
| 333 | + "end_time": "2026-05-06T03:30:52.673113Z", |
| 334 | + "start_time": "2026-05-06T03:30:52.637963Z" |
| 335 | + } |
| 336 | + }, |
282 | 337 | "outputs": [], |
283 | 338 | "source": [ |
284 | 339 | "print(\"Avg. chi^2:\", obs.goodness_of_fit(scene_array))" |
|
294 | 349 | { |
295 | 350 | "cell_type": "code", |
296 | 351 | "execution_count": null, |
297 | | - "metadata": {}, |
| 352 | + "metadata": { |
| 353 | + "ExecuteTime": { |
| 354 | + "end_time": "2026-05-06T03:30:53.573610Z", |
| 355 | + "start_time": "2026-05-06T03:30:52.675168Z" |
| 356 | + } |
| 357 | + }, |
298 | 358 | "outputs": [], |
299 | 359 | "source": [ |
300 | 360 | "from functools import partial\n", |
|
345 | 405 | { |
346 | 406 | "cell_type": "code", |
347 | 407 | "execution_count": null, |
348 | | - "metadata": {}, |
| 408 | + "metadata": { |
| 409 | + "ExecuteTime": { |
| 410 | + "end_time": "2026-05-06T03:31:06.350088Z", |
| 411 | + "start_time": "2026-05-06T03:30:59.216421Z" |
| 412 | + } |
| 413 | + }, |
349 | 414 | "outputs": [], |
350 | 415 | "source": [ |
351 | 416 | "maxiter = 1000\n", |
|
365 | 430 | { |
366 | 431 | "cell_type": "code", |
367 | 432 | "execution_count": null, |
368 | | - "metadata": {}, |
| 433 | + "metadata": { |
| 434 | + "ExecuteTime": { |
| 435 | + "end_time": "2026-05-06T03:31:07.790719Z", |
| 436 | + "start_time": "2026-05-06T03:31:07.711428Z" |
| 437 | + } |
| 438 | + }, |
369 | 439 | "outputs": [], |
370 | 440 | "source": [ |
371 | | - "plt.semilogy(scene_.fit_info['losses'])\n", |
| 441 | + "plt.semilogy(scene_.fit_info['loss'])\n", |
372 | 442 | "plt.ylabel('Loss')\n", |
373 | 443 | "plt.xlabel('Iteration')\n", |
374 | 444 | "plt.show()\n", |
|
387 | 457 | { |
388 | 458 | "cell_type": "code", |
389 | 459 | "execution_count": null, |
390 | | - "metadata": {}, |
| 460 | + "metadata": { |
| 461 | + "ExecuteTime": { |
| 462 | + "end_time": "2026-05-06T03:31:09.561022Z", |
| 463 | + "start_time": "2026-05-06T03:31:09.189173Z" |
| 464 | + } |
| 465 | + }, |
391 | 466 | "outputs": [], |
392 | 467 | "source": [ |
393 | 468 | "sc2.plot.scene(\n", |
|
426 | 501 | { |
427 | 502 | "cell_type": "code", |
428 | 503 | "execution_count": null, |
429 | | - "metadata": {}, |
| 504 | + "metadata": { |
| 505 | + "ExecuteTime": { |
| 506 | + "end_time": "2026-05-06T03:31:12.759044Z", |
| 507 | + "start_time": "2026-05-06T03:31:12.531067Z" |
| 508 | + } |
| 509 | + }, |
430 | 510 | "outputs": [], |
431 | 511 | "source": [ |
432 | 512 | "# Get models for source 1\n", |
|
458 | 538 | { |
459 | 539 | "cell_type": "code", |
460 | 540 | "execution_count": null, |
461 | | - "metadata": {}, |
| 541 | + "metadata": { |
| 542 | + "ExecuteTime": { |
| 543 | + "end_time": "2026-05-06T03:31:18.908174Z", |
| 544 | + "start_time": "2026-05-06T03:31:16.632802Z" |
| 545 | + } |
| 546 | + }, |
462 | 547 | "outputs": [], |
463 | 548 | "source": [ |
464 | 549 | "sc2.plot.sources(\n", |
|
479 | 564 | "metadata": {}, |
480 | 565 | "source": [ |
481 | 566 | "The model of object 0 assumes the simple Gaussian shape of the model PSF, which is the internal representation of a point source.\n", |
482 | | - "But it's noticeable that all other sources show pixel patterns that don't seem right. Some of them pick up flux from other sources (especially source 1) or noise (sources 4-6). What we see here is the limitation of non-parametric models: they can fit anything, but the likelihood may not have enough information to constrain all of these degrees of freedom. More/stronger constraints or priors can help, and we will describe their use in [a separate tutorial](howto/priors).\n", |
| 567 | + "But it's noticeable that all other sources show pixel patterns that don't seem right. Some of them pick up flux from other sources (especially source 1) or noise (sources 4-6). What we see here is the limitation of non-parametric models: they can fit anything, but the likelihood may not have enough information to constrain all of these degrees of freedom. More/stronger constraints or priors can help, and we will describe their use in [a separate tutorial](howto/priors). Another option is the addition of a model-free regularizer, e.g. {py:class}`~scarlet2.PairSimilarity`, which we demonstrate in the [LSBG tutorial](howto/lsb).\n", |
483 | 568 | "\n", |
484 | 569 | "### Source Measurements\n", |
485 | 570 | "\n", |
|
0 commit comments