Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
"source": [
"# coord = SkyCoord(target_ra, target_dec, unit=\"deg\")\n",
"# coord_circle = (coord, 0.05)\n",
"# results = sia_service.search(pos=coord_circle, maxrec=3)\n",
"# results = sia_service.search(pos=coord_circle, maxrec=use_maxrec)\n",
"# results.to_table()"
]
},
Expand Down Expand Up @@ -361,7 +361,7 @@
"outputs": [],
"source": [
"# bounds = (target_ra-0.05, target_ra+0.05, target_dec-0.05, target_dec+0.05)\n",
"# results = sia_service.search(pos=bounds, maxrec=3)\n",
"# results = sia_service.search(pos=bounds, maxrec=use_maxrec)\n",
"# results.to_table()"
]
},
Expand Down Expand Up @@ -394,7 +394,7 @@
"# target_ra+0.05, target_dec-0.05,\n",
"# target_ra+0.05, target_dec+0.05,\n",
"# target_ra-0.05, target_dec+0.05)\n",
"# results = sia_service.search(pos=polygon, maxrec=3)\n",
"# results = sia_service.search(pos=polygon, maxrec=use_maxrec)\n",
"# results.to_table()"
]
},
Expand All @@ -421,9 +421,10 @@
"id": "d04e2397-b075-46d9-bdff-80e0ec0a7321",
"metadata": {},
"source": [
"Query by image type, which in the SIA2 service is the calibration level (`calib_level`).\n",
"Query by image type, which in the SIA2 service is specified by the calibration level (`calib_level`)\n",
"and by the data product subtype (`dpsubtype`).\n",
"\n",
"Calibration levels are:\n",
"Calibration levels and data product subtypes names are:\n",
" - 1 : `raw`\n",
" - 2 : `visit_image`\n",
" - 3 : `deep_coadd`, `template_coadd`, `difference_image`"
Expand All @@ -442,163 +443,146 @@
"id": "4361b7b0-cee1-44ba-96dd-1829f4b10fa3",
"metadata": {},
"source": [
"Query for `visit_images` by setting `calib_level=2`."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "11fe7623-125e-4afc-94f6-4246e2844662",
"metadata": {},
"outputs": [],
"source": [
"results = sia_service.search(pos=circle, calib_level=2, maxrec=5)\n",
"results.to_table()"
"Query for `visit_images` by setting `calib_level=2` *OR* `dpsubtype='lsst.visit_image'`,\n",
"since there is only one dataproduct subtype (`visit_image`) for calibration level 2.\n",
"\n",
"Return the results as Astropy tables using `.to_table()`.\n",
"\n",
"Set `calib_level`."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "769206dd-3fcb-475c-98bc-190258d9901d",
"id": "00b558f2-90e8-4266-aa64-65237e462002",
"metadata": {},
"outputs": [],
"source": [
"del results"
]
},
{
"cell_type": "markdown",
"id": "7e872f8f-0251-4a6d-ac0b-6952c98deaf1",
"metadata": {},
"source": [
"#### 3.2.2. Deep coadd images"
"results = sia_service.search(pos=circle, calib_level=2).to_table()\n",
"print(len(results))"
]
},
{
"cell_type": "markdown",
"id": "08b71293-d3ab-49ca-9a95-2566488eec33",
"id": "76e5918b-0321-4782-a36f-2a5de4ee03fb",
"metadata": {},
"source": [
"Query for `deep_coadd` images by setting `calib_level=3`.\n",
"\n",
"This will also return the `template_coadd` images and `difference_images`."
"Option to redo the query by setting `dpsubtype` to confirm they return the same number of visit images."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f597b4e1-f377-46fd-83cd-2ee6ae5e45bc",
"id": "11fe7623-125e-4afc-94f6-4246e2844662",
"metadata": {},
"outputs": [],
"source": [
"results = sia_service.search(pos=circle, calib_level=3)\n",
"print(len(results))"
"# results = sia_service.search(pos=circle, dpsubtype='lsst.visit_image').to_table()\n",
"# print(len(results))"
]
},
{
"cell_type": "markdown",
"id": "8f62bb47-7a7c-49cd-969a-6d60b5488abe",
"id": "4c126fe2-8bdb-4888-97e6-12ee4ae5dbaa",
"metadata": {},
"source": [
"Convert the `results` to an `astropy` `table`."
"Option to show the results table, which will be displayed as truncated."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ef4601bd-0936-4a32-b3d9-14a26fe99218",
"id": "2475d930-0896-4751-b38a-cb8e552f4776",
"metadata": {},
"outputs": [],
"source": [
"table = results.to_table()"
"# results"
]
},
{
"cell_type": "markdown",
"id": "9239fea9-0dc7-4586-b1bb-54b2952f4f30",
"cell_type": "code",
"execution_count": null,
"id": "769206dd-3fcb-475c-98bc-190258d9901d",
"metadata": {},
"outputs": [],
"source": [
"Option to show the full table of results."
"del results"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cc57c45c-2c02-447b-bd64-19979959bff2",
"cell_type": "markdown",
"id": "7e872f8f-0251-4a6d-ac0b-6952c98deaf1",
"metadata": {},
"outputs": [],
"source": [
"# table"
"#### 3.2.2. Deep coadd images"
]
},
{
"cell_type": "markdown",
"id": "fde6bcb0-48c2-4c6b-a476-30ec6be2adde",
"id": "08b71293-d3ab-49ca-9a95-2566488eec33",
"metadata": {},
"source": [
"Print the number of `deep_coadd`, `template_coadd`, and `difference_images` that were returned."
"Query for `deep_coadd` images by setting `calib_level=3` and `dpsubtype='lsst.deep_coadd'`.\n",
"\n",
"Do not pass `use_maxrec` here, retrieve all the `deep_coadd` images that match the search constraints."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "da7aa11c-93f2-43bd-9014-b3edc07b34de",
"id": "f597b4e1-f377-46fd-83cd-2ee6ae5e45bc",
"metadata": {},
"outputs": [],
"source": [
"values, counts = np.unique(table['dataproduct_subtype'],\n",
" return_counts=True)\n",
"for value, count in zip(values, counts):\n",
" print(value, count)"
"results = sia_service.search(pos=circle, calib_level=3, dpsubtype='lsst.deep_coadd').to_table()\n",
"print(len(results))"
]
},
{
"cell_type": "markdown",
"id": "5a3bc533-3865-4d63-8593-9f588b19c810",
"id": "9239fea9-0dc7-4586-b1bb-54b2952f4f30",
"metadata": {},
"source": [
"Subset the resulting images that are deep coadds in the r-band."
"Option to show the full table of results."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "62654699-3b7d-4864-9f0e-a854d969d2e3",
"id": "cc57c45c-2c02-447b-bd64-19979959bff2",
"metadata": {},
"outputs": [],
"source": [
"tx = np.where((table['dataproduct_subtype'] == 'lsst.deep_coadd')\n",
" & (table['lsst_band'] == 'r'))[0]\n",
"print(len(tx))"
"# results"
]
},
{
"cell_type": "markdown",
"id": "d34c068c-2191-488c-9ef3-deb6d5de043c",
"id": "fde6bcb0-48c2-4c6b-a476-30ec6be2adde",
"metadata": {},
"source": [
"All `deep_coadd` images overlap at the edges.\n",
"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",
"\n",
"Print the table of the r-band `deep_coadd` images only."
"Print the number of unique values of `lsst_band` (filters)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "44c100ac-3296-4846-ae0c-8b39051679b6",
"id": "da7aa11c-93f2-43bd-9014-b3edc07b34de",
"metadata": {},
"outputs": [],
"source": [
"table[tx]"
"values, counts = np.unique(results['lsst_band'],\n",
" return_counts=True)\n",
"for value, count in zip(values, counts):\n",
" print(value, count)"
]
},
{
"cell_type": "markdown",
"id": "197a2b2a-cf18-4b40-ba7f-ec9300116a18",
"id": "5a3bc533-3865-4d63-8593-9f588b19c810",
"metadata": {},
"source": [
"Keep only the `table` to use in the next sections."
"There are 2 overlapping patches for the search coordinates, and thus 2 `deep_coadd` images for each of the six filters."
]
},
{
Expand All @@ -608,7 +592,7 @@
"metadata": {},
"outputs": [],
"source": [
"del results, tx"
"del results, values, counts"
]
},
{
Expand All @@ -618,7 +602,9 @@
"source": [
"#### 3.2.3. Template coadd images\n",
"\n",
"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`."
"Query for `template_coadd` images by setting `calib_level=3` and `dpsubtype='lsst.template_coadd'`.\n",
"\n",
"Since the `template_coadd` images are also stored by patch, there are also 12 that match the query constraints."
]
},
{
Expand All @@ -628,27 +614,8 @@
"metadata": {},
"outputs": [],
"source": [
"tx = np.where((table['dataproduct_subtype'] == 'lsst.template_coadd')\n",
" & (table['lsst_band'] == 'r'))[0]\n",
"print(len(tx))"
]
},
{
"cell_type": "markdown",
"id": "653f6e5e-af41-4207-a5e2-4dce8ea98ade",
"metadata": {},
"source": [
"Option to display the subsetted table."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ef5f1c7a-c8af-44a1-b352-5399ff92a111",
"metadata": {},
"outputs": [],
"source": [
"# table[tx]"
"results = sia_service.search(pos=circle, calib_level=3, dpsubtype='lsst.template_coadd')\n",
"print(len(results))"
]
},
{
Expand All @@ -658,7 +625,7 @@
"metadata": {},
"outputs": [],
"source": [
"del tx"
"del results"
]
},
{
Expand All @@ -668,7 +635,9 @@
"source": [
"#### 3.2.4. Difference images\n",
"\n",
"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`."
"Query for `difference_images` by setting `calib_level=3` and `dpsubtype='lsst.difference_image'`.\n",
"\n",
"There will be as many difference images returned as there are `visit_images`."
]
},
{
Expand All @@ -678,27 +647,8 @@
"metadata": {},
"outputs": [],
"source": [
"tx = np.where((table['dataproduct_subtype'] == 'lsst.difference_image')\n",
" & (table['lsst_band'] == 'r'))[0]\n",
"print(len(tx))"
]
},
{
"cell_type": "markdown",
"id": "160d484b-b1be-4303-9ef7-e5d89f265b25",
"metadata": {},
"source": [
"Option to display the subsetted table."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "81e0ac68-f7b4-4155-8386-74c5ffdee8cd",
"metadata": {},
"outputs": [],
"source": [
"# table[tx]"
"results = sia_service.search(pos=circle, calib_level=3, dpsubtype='lsst.difference_image')\n",
"print(len(results))"
]
},
{
Expand All @@ -708,7 +658,7 @@
"metadata": {},
"outputs": [],
"source": [
"del table, tx"
"del results"
]
},
{
Expand Down

Large diffs are not rendered by default.

Loading