diff --git a/_static/nb_html/DP02_13a_Image_Cutout_SciDemo.html b/_static/nb_html/DP02_13a_Image_Cutout_SciDemo.html index d1b7b27d..70517056 100644 --- a/_static/nb_html/DP02_13a_Image_Cutout_SciDemo.html +++ b/_static/nb_html/DP02_13a_Image_Cutout_SciDemo.html @@ -7519,8 +7519,8 @@
This notebook will teach how to use the cutout service (which enables users to retrieve small image cutouts from LSST data) by demonstration of a few basic science applications. Since LSST images are quite large, in some cases it is desirable to be able to perform operations (e.g. image cutouts) on the server side to avoid transferring large amounts of data. This can speed up visual inspection and other analyses requiring images of individual objects or fields that may be much smaller than the patch and tract sizes that are created by the LSST camera and pipelines.
-The International Virtual Observatory Alliance (IVOA) provides a Server-side Operations for Data Access (SODA) for web data access. The LSST architecture is built to fit into the requirements of the Virtual Observatory, enabling the use of Virtual Observatory tools such as the image cutout service to access LSST data. The procedure is to identify the remote web location of the image of interest (called a datalink), and use a web service that creates a cutout from that linked data remotely, to transfer and save locally on the Rubin Science Platform.
-Further demonstration of the technical side of this process using DP0.2 data can be found in (Leanne's companion tutorial when published, link here). Further details and information can be found at the IVOA data link documentation, where it says Access Data Services. Rubin-specific documentation for these can also be found in this document describing the RSP DataLink service implementation strategy.
+This notebook will teach how to use the cutout service (which enables users to retrieve small image cutouts from LSST data) by demonstration of a few basic science applications. Since LSST images are quite large, in some cases it is desirable to be able to perform image cutouts on the server side to avoid transferring large amounts of data. This can speed up visual inspection and other analyses requiring images of individual objects or fields that may be much smaller than the patch and tract sizes that are created by the LSST camera and pipelines.
+The International Virtual Observatory Alliance (IVOA) co-ordinates the community efforts of astronomical missions and archives to develop and maintain the Virtual Observatory (VO) standards. The VO standards enable interoperability between astronomical archives. IVOA also provides a Server-side Operations for Data Access (SODA), which is a protocol for remote data processing operations. This protocol allows users to perform computations (pixel operations, image transformations, etc) on the remote server, which avoids unnecssary data movement. The LSST architecture has a "VO-first" approach, meaning that VO standards are implemented in all applicable services, enabling the use of VO tools such as the image cutout service to access LSST data. The procedure is to identify the remote web location of the image of interest (called a datalink), and use a web service that creates a cutout from that linked data remotely, to transfer and save locally on the Rubin Science Platform.
+Further details and information can be found at the IVOA data link documentation, where it says Access Data Services. Rubin-specific documentation for these can also be found in this document describing the RSP DataLink service implementation strategy.
The cutout tool must first save cutouts as fits files locally on the Rubin Science Platform (RSP). +
The Rubin cutout service allows the user to save cutouts as fits files locally on the Rubin Science Platform (RSP). Create a new temporary folder in the home directory called "temp" in which to save these files. At the end of the notebook, the last cell will clear the contents and remove the temp folder.
Already exists: /home/melissagraham/dp02_13a_temp +Already exists: /home/christinawilliams/dp02_13a_temp
The following cells define a number of functions to be used throughout the tutorial. The first function is to enable easy plotting of files from the cutout tool (plotImage). The next function, `make_image_cutout', is a wrapper function that will perform the operations needed to call the cutout tool and create image cutouts stored locally. This procedure will first be demonstrated in Section 2. The steps include: 1) define the location on the sky. 2) Query the TAP service for the specifications of the dataId. 3) Retrieve the datalink URL associated with the data. 4) Create a cutout instance from the query result and the Datalink Resource.
+The following cells define a number of functions to be used throughout the tutorial. The first function is to enable easy plotting of files from the cutout tool (plotImage
). The next function, make_image_cutout
, is a wrapper function that will perform the operations needed to call the cutout tool and create image cutouts stored locally. This procedure will first be demonstrated in Section 2. The steps include: 1) define the location on the sky. 2) Query the TAP service for the specifications of the dataId. 3) Retrieve the datalink URL associated with the data. 4) Create a cutout instance from the query result and the Datalink Resource.
This section will demonstrate a simple example: how to create a cutout for a single object from a deepCoadd.
+This section will demonstrate a simple example: how to create a cutout for a single part of sky from a deepCoadd.
The TAP service is used to query the ivoa.Obscore table for the datalink (a web URL identifying where the data is hosted).
First, define a point on the sky as the center of the image cutout. This example uses the galaxy cluster from DP0.2 Notebook Tutorial 03a. Once the RA and Dec are defined, we will create a SpherePoint class to define the location on the sky, that is then used to identify which Patch and Tract contains that location among the deepCoadd images.
+First, define a point on the sky as the center of the image cutout. This example uses the galaxy cluster from DP0.2 Notebook Tutorial 03a. Once the RA and Dec are defined, create a SpherePoint object to define the location on the sky. Use these in a TAP query to identify the overlapping deepCoadd image.
4431 17 --
The identified Patch and Tract will be used to define the unique dataId for that location, and once a filter (band) is included, this defines a unique deepCoadd in the LSST image database.
-dataId = {'band': 'i', 'tract': tract,
- 'patch': patch}
The next cell shows the query to the TAP service for the metadata that is associated with the image's remote location in the LSST data archive. The DP0.2 has a schema (table collection) called "ivoa", which contains a table called ivoa.ObsCore. The IVOA-defined obscore table contains generic metadata for the DP0.2 datasets. The table is accessible via ADQL queries via a TAP endpoint. The mechanism for locating images from observations is to use the TAP service to query the ObsCore schema.
+The next cell shows the TAP query for the metadata that is associated with the image's remote location in the LSST data archive. The DP0.2 has a schema (table collection) called "ivoa", which contains a table called ivoa.ObsCore. The IVOA-defined obscore table contains generic metadata for the DP0.2 datasets. The table is accessible via ADQL queries via a TAP endpoint. The mechanism for locating the images LSST is to use the TAP service to query the ObsCore schema.
query = "SELECT access_format, access_url, dataproduct_subtype, " + \
- "lsst_patch, lsst_tract, lsst_band, s_ra, s_dec " + \
- "FROM ivoa.ObsCore WHERE dataproduct_type = 'image' " + \
- "AND obs_collection = 'LSST.DP02' " + \
- "AND dataproduct_subtype = 'lsst.deepCoadd_calexp' " + \
- "AND lsst_tract = " + str(tract) + " " + \
- "AND lsst_patch = " + str(patch) + " " + \
- "AND lsst_band = 'i' "
-print(query)
+query = "SELECT lsst_patch, lsst_tract, s_region, " + \
+ "access_format, access_url, dataproduct_subtype " + \
+ "FROM ivoa.ObsCore " + \
+ "WHERE dataproduct_type = 'image' " + \
+ "AND obs_collection = 'LSST.DP02' " + \
+ "AND dataproduct_subtype = 'lsst.deepCoadd_calexp' " + \
+ "AND lsst_band = 'i' " + \
+ "AND CONTAINS(POINT('ICRS', " + str(coord.ra.value) + \
+ ", " + str(coord.dec.value) + "), " + \
+ "s_region) = 1"
SELECT access_format, access_url, dataproduct_subtype, lsst_patch, lsst_tract, lsst_band, s_ra, s_dec FROM ivoa.ObsCore WHERE dataproduct_type = 'image' AND obs_collection = 'LSST.DP02' AND dataproduct_subtype = 'lsst.deepCoadd_calexp' AND lsst_tract = 4431 AND lsst_patch = 17 AND lsst_band = 'i' --
job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
print('Job phase is', job.phase)
+assert job.phase == 'COMPLETED'
results = job.fetch_result()
@@ -8225,7 +8162,7 @@
results.to_table()
@@ -8239,28 +8176,56 @@
-Out[14]:
+Out[13]:
Table length=1
-