|
331 | 331 | "source": [ |
332 | 332 | "# coord = SkyCoord(target_ra, target_dec, unit=\"deg\")\n", |
333 | 333 | "# coord_circle = (coord, 0.05)\n", |
334 | | - "# results = sia_service.search(pos=coord_circle, maxrec=3)\n", |
| 334 | + "# results = sia_service.search(pos=coord_circle, maxrec=use_maxrec)\n", |
335 | 335 | "# results.to_table()" |
336 | 336 | ] |
337 | 337 | }, |
|
361 | 361 | "outputs": [], |
362 | 362 | "source": [ |
363 | 363 | "# bounds = (target_ra-0.05, target_ra+0.05, target_dec-0.05, target_dec+0.05)\n", |
364 | | - "# results = sia_service.search(pos=bounds, maxrec=3)\n", |
| 364 | + "# results = sia_service.search(pos=bounds, maxrec=use_maxrec)\n", |
365 | 365 | "# results.to_table()" |
366 | 366 | ] |
367 | 367 | }, |
|
394 | 394 | "# target_ra+0.05, target_dec-0.05,\n", |
395 | 395 | "# target_ra+0.05, target_dec+0.05,\n", |
396 | 396 | "# target_ra-0.05, target_dec+0.05)\n", |
397 | | - "# results = sia_service.search(pos=polygon, maxrec=3)\n", |
| 397 | + "# results = sia_service.search(pos=polygon, maxrec=use_maxrec)\n", |
398 | 398 | "# results.to_table()" |
399 | 399 | ] |
400 | 400 | }, |
|
421 | 421 | "id": "d04e2397-b075-46d9-bdff-80e0ec0a7321", |
422 | 422 | "metadata": {}, |
423 | 423 | "source": [ |
424 | | - "Query by image type, which in the SIA2 service is the calibration level (`calib_level`).\n", |
| 424 | + "Query by image type, which in the SIA2 service is specified by the calibration level (`calib_level`)\n", |
| 425 | + "and by the data product subtype (`dpsubtype`).\n", |
425 | 426 | "\n", |
426 | | - "Calibration levels are:\n", |
| 427 | + "Calibration levels and data product subtypes names are:\n", |
427 | 428 | " - 1 : `raw`\n", |
428 | 429 | " - 2 : `visit_image`\n", |
429 | 430 | " - 3 : `deep_coadd`, `template_coadd`, `difference_image`" |
|
442 | 443 | "id": "4361b7b0-cee1-44ba-96dd-1829f4b10fa3", |
443 | 444 | "metadata": {}, |
444 | 445 | "source": [ |
445 | | - "Query for `visit_images` by setting `calib_level=2`." |
446 | | - ] |
447 | | - }, |
448 | | - { |
449 | | - "cell_type": "code", |
450 | | - "execution_count": null, |
451 | | - "id": "11fe7623-125e-4afc-94f6-4246e2844662", |
452 | | - "metadata": {}, |
453 | | - "outputs": [], |
454 | | - "source": [ |
455 | | - "results = sia_service.search(pos=circle, calib_level=2, maxrec=5)\n", |
456 | | - "results.to_table()" |
| 446 | + "Query for `visit_images` by setting `calib_level=2` *OR* `dpsubtype='lsst.visit_image'`,\n", |
| 447 | + "since there is only one dataproduct subtype (`visit_image`) for calibration level 2.\n", |
| 448 | + "\n", |
| 449 | + "Return the results as Astropy tables using `.to_table()`.\n", |
| 450 | + "\n", |
| 451 | + "Set `calib_level`." |
457 | 452 | ] |
458 | 453 | }, |
459 | 454 | { |
460 | 455 | "cell_type": "code", |
461 | 456 | "execution_count": null, |
462 | | - "id": "769206dd-3fcb-475c-98bc-190258d9901d", |
| 457 | + "id": "00b558f2-90e8-4266-aa64-65237e462002", |
463 | 458 | "metadata": {}, |
464 | 459 | "outputs": [], |
465 | 460 | "source": [ |
466 | | - "del results" |
467 | | - ] |
468 | | - }, |
469 | | - { |
470 | | - "cell_type": "markdown", |
471 | | - "id": "7e872f8f-0251-4a6d-ac0b-6952c98deaf1", |
472 | | - "metadata": {}, |
473 | | - "source": [ |
474 | | - "#### 3.2.2. Deep coadd images" |
| 461 | + "results = sia_service.search(pos=circle, calib_level=2).to_table()\n", |
| 462 | + "print(len(results))" |
475 | 463 | ] |
476 | 464 | }, |
477 | 465 | { |
478 | 466 | "cell_type": "markdown", |
479 | | - "id": "08b71293-d3ab-49ca-9a95-2566488eec33", |
| 467 | + "id": "76e5918b-0321-4782-a36f-2a5de4ee03fb", |
480 | 468 | "metadata": {}, |
481 | 469 | "source": [ |
482 | | - "Query for `deep_coadd` images by setting `calib_level=3`.\n", |
483 | | - "\n", |
484 | | - "This will also return the `template_coadd` images and `difference_images`." |
| 470 | + "Option to redo the query by setting `dpsubtype` to confirm they return the same number of visit images." |
485 | 471 | ] |
486 | 472 | }, |
487 | 473 | { |
488 | 474 | "cell_type": "code", |
489 | 475 | "execution_count": null, |
490 | | - "id": "f597b4e1-f377-46fd-83cd-2ee6ae5e45bc", |
| 476 | + "id": "11fe7623-125e-4afc-94f6-4246e2844662", |
491 | 477 | "metadata": {}, |
492 | 478 | "outputs": [], |
493 | 479 | "source": [ |
494 | | - "results = sia_service.search(pos=circle, calib_level=3)\n", |
495 | | - "print(len(results))" |
| 480 | + "# results = sia_service.search(pos=circle, dpsubtype='lsst.visit_image').to_table()\n", |
| 481 | + "# print(len(results))" |
496 | 482 | ] |
497 | 483 | }, |
498 | 484 | { |
499 | 485 | "cell_type": "markdown", |
500 | | - "id": "8f62bb47-7a7c-49cd-969a-6d60b5488abe", |
| 486 | + "id": "4c126fe2-8bdb-4888-97e6-12ee4ae5dbaa", |
501 | 487 | "metadata": {}, |
502 | 488 | "source": [ |
503 | | - "Convert the `results` to an `astropy` `table`." |
| 489 | + "Option to show the results table, which will be displayed as truncated." |
504 | 490 | ] |
505 | 491 | }, |
506 | 492 | { |
507 | 493 | "cell_type": "code", |
508 | 494 | "execution_count": null, |
509 | | - "id": "ef4601bd-0936-4a32-b3d9-14a26fe99218", |
| 495 | + "id": "2475d930-0896-4751-b38a-cb8e552f4776", |
510 | 496 | "metadata": {}, |
511 | 497 | "outputs": [], |
512 | 498 | "source": [ |
513 | | - "table = results.to_table()" |
| 499 | + "# results" |
514 | 500 | ] |
515 | 501 | }, |
516 | 502 | { |
517 | | - "cell_type": "markdown", |
518 | | - "id": "9239fea9-0dc7-4586-b1bb-54b2952f4f30", |
| 503 | + "cell_type": "code", |
| 504 | + "execution_count": null, |
| 505 | + "id": "769206dd-3fcb-475c-98bc-190258d9901d", |
519 | 506 | "metadata": {}, |
| 507 | + "outputs": [], |
520 | 508 | "source": [ |
521 | | - "Option to show the full table of results." |
| 509 | + "del results" |
522 | 510 | ] |
523 | 511 | }, |
524 | 512 | { |
525 | | - "cell_type": "code", |
526 | | - "execution_count": null, |
527 | | - "id": "cc57c45c-2c02-447b-bd64-19979959bff2", |
| 513 | + "cell_type": "markdown", |
| 514 | + "id": "7e872f8f-0251-4a6d-ac0b-6952c98deaf1", |
528 | 515 | "metadata": {}, |
529 | | - "outputs": [], |
530 | 516 | "source": [ |
531 | | - "# table" |
| 517 | + "#### 3.2.2. Deep coadd images" |
532 | 518 | ] |
533 | 519 | }, |
534 | 520 | { |
535 | 521 | "cell_type": "markdown", |
536 | | - "id": "fde6bcb0-48c2-4c6b-a476-30ec6be2adde", |
| 522 | + "id": "08b71293-d3ab-49ca-9a95-2566488eec33", |
537 | 523 | "metadata": {}, |
538 | 524 | "source": [ |
539 | | - "Print the number of `deep_coadd`, `template_coadd`, and `difference_images` that were returned." |
| 525 | + "Query for `deep_coadd` images by setting `calib_level=3` and `dpsubtype='lsst.deep_coadd'`.\n", |
| 526 | + "\n", |
| 527 | + "Do not pass `use_maxrec` here, retrieve all the `deep_coadd` images that match the search constraints." |
540 | 528 | ] |
541 | 529 | }, |
542 | 530 | { |
543 | 531 | "cell_type": "code", |
544 | 532 | "execution_count": null, |
545 | | - "id": "da7aa11c-93f2-43bd-9014-b3edc07b34de", |
| 533 | + "id": "f597b4e1-f377-46fd-83cd-2ee6ae5e45bc", |
546 | 534 | "metadata": {}, |
547 | 535 | "outputs": [], |
548 | 536 | "source": [ |
549 | | - "values, counts = np.unique(table['dataproduct_subtype'],\n", |
550 | | - " return_counts=True)\n", |
551 | | - "for value, count in zip(values, counts):\n", |
552 | | - " print(value, count)" |
| 537 | + "results = sia_service.search(pos=circle, calib_level=3, dpsubtype='lsst.deep_coadd').to_table()\n", |
| 538 | + "print(len(results))" |
553 | 539 | ] |
554 | 540 | }, |
555 | 541 | { |
556 | 542 | "cell_type": "markdown", |
557 | | - "id": "5a3bc533-3865-4d63-8593-9f588b19c810", |
| 543 | + "id": "9239fea9-0dc7-4586-b1bb-54b2952f4f30", |
558 | 544 | "metadata": {}, |
559 | 545 | "source": [ |
560 | | - "Subset the resulting images that are deep coadds in the r-band." |
| 546 | + "Option to show the full table of results." |
561 | 547 | ] |
562 | 548 | }, |
563 | 549 | { |
564 | 550 | "cell_type": "code", |
565 | 551 | "execution_count": null, |
566 | | - "id": "62654699-3b7d-4864-9f0e-a854d969d2e3", |
| 552 | + "id": "cc57c45c-2c02-447b-bd64-19979959bff2", |
567 | 553 | "metadata": {}, |
568 | 554 | "outputs": [], |
569 | 555 | "source": [ |
570 | | - "tx = np.where((table['dataproduct_subtype'] == 'lsst.deep_coadd')\n", |
571 | | - " & (table['lsst_band'] == 'r'))[0]\n", |
572 | | - "print(len(tx))" |
| 556 | + "# results" |
573 | 557 | ] |
574 | 558 | }, |
575 | 559 | { |
576 | 560 | "cell_type": "markdown", |
577 | | - "id": "d34c068c-2191-488c-9ef3-deb6d5de043c", |
| 561 | + "id": "fde6bcb0-48c2-4c6b-a476-30ec6be2adde", |
578 | 562 | "metadata": {}, |
579 | 563 | "source": [ |
580 | | - "All `deep_coadd` images overlap at the edges.\n", |
581 | | - "The fact that there are two r-band `deep_coadd` images means the target coordinates used are near the image edges and in the overlap region.\n", |
582 | | - "\n", |
583 | | - "Print the table of the r-band `deep_coadd` images only." |
| 564 | + "Print the number of unique values of `lsst_band` (filters)." |
584 | 565 | ] |
585 | 566 | }, |
586 | 567 | { |
587 | 568 | "cell_type": "code", |
588 | 569 | "execution_count": null, |
589 | | - "id": "44c100ac-3296-4846-ae0c-8b39051679b6", |
| 570 | + "id": "da7aa11c-93f2-43bd-9014-b3edc07b34de", |
590 | 571 | "metadata": {}, |
591 | 572 | "outputs": [], |
592 | 573 | "source": [ |
593 | | - "table[tx]" |
| 574 | + "values, counts = np.unique(results['lsst_band'],\n", |
| 575 | + " return_counts=True)\n", |
| 576 | + "for value, count in zip(values, counts):\n", |
| 577 | + " print(value, count)" |
594 | 578 | ] |
595 | 579 | }, |
596 | 580 | { |
597 | 581 | "cell_type": "markdown", |
598 | | - "id": "197a2b2a-cf18-4b40-ba7f-ec9300116a18", |
| 582 | + "id": "5a3bc533-3865-4d63-8593-9f588b19c810", |
599 | 583 | "metadata": {}, |
600 | 584 | "source": [ |
601 | | - "Keep only the `table` to use in the next sections." |
| 585 | + "There are 2 overlapping patches for the search coordinates, and thus 2 `deep_coadd` images for each of the six filters." |
602 | 586 | ] |
603 | 587 | }, |
604 | 588 | { |
|
608 | 592 | "metadata": {}, |
609 | 593 | "outputs": [], |
610 | 594 | "source": [ |
611 | | - "del results, tx" |
| 595 | + "del results, values, counts" |
612 | 596 | ] |
613 | 597 | }, |
614 | 598 | { |
|
618 | 602 | "source": [ |
619 | 603 | "#### 3.2.3. Template coadd images\n", |
620 | 604 | "\n", |
621 | | - "Use the same initial query as in Section 3.2.2, but then subset only to the results with `dataproduct_subtype` equal to `lsst.template_coadd`." |
| 605 | + "Query for `template_coadd` images by setting `calib_level=3` and `dpsubtype='lsst.template_coadd'`.\n", |
| 606 | + "\n", |
| 607 | + "Since the `template_coadd` images are also stored by patch, there are also 12 that match the query constraints." |
622 | 608 | ] |
623 | 609 | }, |
624 | 610 | { |
|
628 | 614 | "metadata": {}, |
629 | 615 | "outputs": [], |
630 | 616 | "source": [ |
631 | | - "tx = np.where((table['dataproduct_subtype'] == 'lsst.template_coadd')\n", |
632 | | - " & (table['lsst_band'] == 'r'))[0]\n", |
633 | | - "print(len(tx))" |
634 | | - ] |
635 | | - }, |
636 | | - { |
637 | | - "cell_type": "markdown", |
638 | | - "id": "653f6e5e-af41-4207-a5e2-4dce8ea98ade", |
639 | | - "metadata": {}, |
640 | | - "source": [ |
641 | | - "Option to display the subsetted table." |
642 | | - ] |
643 | | - }, |
644 | | - { |
645 | | - "cell_type": "code", |
646 | | - "execution_count": null, |
647 | | - "id": "ef5f1c7a-c8af-44a1-b352-5399ff92a111", |
648 | | - "metadata": {}, |
649 | | - "outputs": [], |
650 | | - "source": [ |
651 | | - "# table[tx]" |
| 617 | + "results = sia_service.search(pos=circle, calib_level=3, dpsubtype='lsst.template_coadd')\n", |
| 618 | + "print(len(results))" |
652 | 619 | ] |
653 | 620 | }, |
654 | 621 | { |
|
658 | 625 | "metadata": {}, |
659 | 626 | "outputs": [], |
660 | 627 | "source": [ |
661 | | - "del tx" |
| 628 | + "del results" |
662 | 629 | ] |
663 | 630 | }, |
664 | 631 | { |
|
668 | 635 | "source": [ |
669 | 636 | "#### 3.2.4. Difference images\n", |
670 | 637 | "\n", |
671 | | - "Use the same initial query as in Section 3.2.2, but then subset only to the results with `dataproduct_subtype` equal to `lsst.difference_image`." |
| 638 | + "Query for `difference_images` by setting `calib_level=3` and `dpsubtype='lsst.difference_image'`.\n", |
| 639 | + "\n", |
| 640 | + "There will be as many difference images returned as there are `visit_images`." |
672 | 641 | ] |
673 | 642 | }, |
674 | 643 | { |
|
678 | 647 | "metadata": {}, |
679 | 648 | "outputs": [], |
680 | 649 | "source": [ |
681 | | - "tx = np.where((table['dataproduct_subtype'] == 'lsst.difference_image')\n", |
682 | | - " & (table['lsst_band'] == 'r'))[0]\n", |
683 | | - "print(len(tx))" |
684 | | - ] |
685 | | - }, |
686 | | - { |
687 | | - "cell_type": "markdown", |
688 | | - "id": "160d484b-b1be-4303-9ef7-e5d89f265b25", |
689 | | - "metadata": {}, |
690 | | - "source": [ |
691 | | - "Option to display the subsetted table." |
692 | | - ] |
693 | | - }, |
694 | | - { |
695 | | - "cell_type": "code", |
696 | | - "execution_count": null, |
697 | | - "id": "81e0ac68-f7b4-4155-8386-74c5ffdee8cd", |
698 | | - "metadata": {}, |
699 | | - "outputs": [], |
700 | | - "source": [ |
701 | | - "# table[tx]" |
| 650 | + "results = sia_service.search(pos=circle, calib_level=3, dpsubtype='lsst.difference_image')\n", |
| 651 | + "print(len(results))" |
702 | 652 | ] |
703 | 653 | }, |
704 | 654 | { |
|
708 | 658 | "metadata": {}, |
709 | 659 | "outputs": [], |
710 | 660 | "source": [ |
711 | | - "del table, tx" |
| 661 | + "del results" |
712 | 662 | ] |
713 | 663 | }, |
714 | 664 | { |
|
0 commit comments