{"id":4854,"date":"2016-05-06T14:14:28","date_gmt":"2016-05-07T00:14:28","guid":{"rendered":"http:\/\/www.eaobservatory.org\/jcmt\/?page_id=4854"},"modified":"2020-11-23T17:50:03","modified_gmt":"2020-11-24T03:50:03","slug":"scuba-2-dr-tutorial-4","status":"publish","type":"page","link":"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-4\/","title":{"rendered":"SCUBA-2 Data Reduction \u2013 Tutorial 4"},"content":{"rendered":"<p style=\"text-align: justify\"><strong>Note:<\/strong> <em>This tutorial assumes a pre-existing installation of the latest version of the Starlink software suite (<a href=\"http:\/\/starlink.eao.hawaii.edu\/starlink\/Releases\">available here<\/a>), and that it has been initialized. The steps outlined below are for the <em>BASH<\/em> and ZSH shells; if the <em>TCSH or CSH<\/em> shell is being used, please replace the <em>export<\/em> command with the appropriate <em>setenv<\/em> equivalent. See Step 4 of <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-1\/\">SCUBA-2 DR Tutorial 1<\/a> for an example of how to do this. Please also remember to run KAPPA and SMURF first.<\/em><\/p>\n<h2 style=\"text-align: justify\">Matched Filters<\/h2>\n<p style=\"text-align: justify\">Matched filters are a method of wavelet analysis used for optimal detection of point sources, by removing the large scale structure for a map and convolving the remaining information with an image of the telescope beam. Some <em>ORAC-DR<\/em> recipes (e.g. <em>REDUCE_SCAN_FAINT_POINT_SOURCES<\/em>) will automatically carry out matched filtering on the group coadds produced by the pipeline. This tutorial will demonstrate how to use <em>PICARD<\/em> to perform the same filtering on an already-reduced map.<\/p>\n<p style=\"text-align: justify\">The map used for this is a single observation with one visible faint point source present. Better examples of matched filtering can show a map going from appearing blank to having obviously detected point sources. When using matched filtering, care is needed in interpreting the flux of the output sources. See 6.1 of <em>Starlink<\/em> document <em>SUN\/264<\/em>, and section 8.7 and Appendix D of <em>SC\/21<\/em> (The <em>SCUBA-2<\/em> Data Reduction Cookbook) for more details on the <em>SCUBA-2<\/em> Matched Filter.<\/p>\n<ol>\n<li style=\"text-align: justify\">Download the example data <a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMTTutorial-MatchFilter.tar.gz\">from here<\/a> and copy it into a working directory on your computer:\n<p style=\"text-align: justify\"><code>JCMTTutorial-MatchFilter.tar.gz<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">Gunzip and untar this file:\n<p style=\"text-align: justify\"><code>tar xvfz JCMTTutorial-MatchFilter.tar.gz<\/code><\/p>\n<p style=\"text-align: justify\">You will now have a <em>JCMTTutorial-MatchFilter<\/em> directory, containing a reduced <em>SCUBA-2<\/em> observation in NDF format, and a <em>README<\/em> file.<\/p>\n<\/li>\n<li style=\"text-align: justify\">Examine the files:\n<p style=\"text-align: justify\"><code>cd JCMTTutorial-MatchFilter<br \/>\nls<br \/>\nREADME.txt jcmts20140729_00011_850_reduced001_obs_000.sdf<\/code><\/p>\n<p style=\"text-align: justify\">This observation is a reduced <em>SCUBA-2 Pong<\/em> map taken by the <em>JCMT<\/em> Cosmology Legacy Survey on 2014-07-29. The date and scan number may be deduced from the file name, and the file metadata can be examined with the <em>KAPPA<\/em> command <em>fitslist<\/em>:<\/p>\n<p style=\"text-align: justify\"><code>fitslist jcmts20140729_00011_850_reduced001_obs_000.sdf<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">Run the standard matched filter on it. <em>Starlink<\/em> provides a <em>PICARD<\/em> recipe for doing this, which can be run like so:\n<p style=\"text-align: justify\"><code>export ORAC_DATA_OUT=. (setenv ORAC_DATA_OUT .\/ if you are using TC shell)<br \/>\npicard -log sf SCUBA2_MATCHED_FILTER jcmts20140729_00011_850_reduced001_obs_000.sdf<\/code><\/p>\n<p style=\"text-align: justify\">Read the messages written to screen, which are also saved in a log file that begins with <em>.picard<\/em>.<\/p>\n<\/li>\n<li style=\"text-align: justify\">Open the matched filter image (extension <em>_mf<\/em>) in <em>Gaia<\/em>, and compare with the original image. Various source finding and photometry methods can be used to compare the before and after cases. <em>GAIA<\/em> enables the user to interactively perform photometry on a displayed file.<\/li>\n<li style=\"text-align: justify\">Look at the background structure of the matched filter image. There is a characteristic pattern visible in it, which is recognizable in comparison with a normal <em>SCUBA-2<\/em> map. Note that when searching for data in the <em>JCMT<\/em> Science archive, it may be possible for the user to recognize which observations were reduced with a matched filter just from this pattern visible in the preview image.\n<div id=\"attachment_5085\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig1.png\"><img aria-describedby=\"caption-attachment-5085\" loading=\"lazy\" class=\"size-medium wp-image-5085\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig1-294x300.png\" alt=\"Picard-generated map of SCUBA-2 Tutorial 4 dataset using matched filtering.\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig1-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig1-1004x1024.png 1004w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig1-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig1.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5085\" class=\"wp-caption-text\">Picard-generated map of SCUBA-2 Tutorial 4 dataset using matched filtering.<\/p><\/div><\/li>\n<li style=\"text-align: justify\">The point spread function (PSF) used by the recipe is stored in the file with the <em>_psf<\/em> extension.\n<div id=\"attachment_5086\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig2.png\"><img aria-describedby=\"caption-attachment-5086\" loading=\"lazy\" class=\"size-medium wp-image-5086\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig2-294x300.png\" alt=\"The standard Point Spread Function (PSF) used in SCUBA-2 Tutorial 4 (zoomed).\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig2-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig2-1004x1024.png 1004w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig2-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial4_fig2.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5086\" class=\"wp-caption-text\">The standard Point Spread Function (PSF) used in SCUBA-2 Tutorial 4 (zoomed).<\/p><\/div><\/li>\n<\/ol>\n<h3 style=\"text-align: justify\">Advanced Tips<\/h3>\n<p style=\"text-align: justify\">This can be run on a standard JCMT calibrator source to see the effect on the beam &#8211; try downloading a reduced observation of (e.g.) Arp 220 from the <em>JCMT<\/em> Science Archive <a href=\"http:\/\/www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca\/en\/search\/\">here<\/a> and running this <em>PICARD<\/em> recipe on it. Look at the difference in the source before and after running matched filtering. it is also possible to manually use the <em>KAPPA beamfit<\/em> command to analyze the maps.<\/p>\n<p style=\"text-align: justify\">The <em>SCUBA2_MATCHED_FILTER PICARD<\/em> recipe takes various optional recipe parameters. It is possible to set the following <em>recpars<\/em> to change the defaults:<\/p>\n<ol>\n<li style=\"text-align: justify\">Change the point spread function (by default it will construct one based on the measured SCUBA-2 beam from Dempsey et al. 2013):\n<p style=\"text-align: justify\"><code>PSF_MATCHFILTER<\/code><\/p>\n<p style=\"text-align: justify\">Name of an NDF file containing a suitable PSF. Must exist in the current working directory. If not specified, the recipe will calculate one itself for each input file.<\/p>\n<\/li>\n<li style=\"text-align: justify\">Change the normalization scheme used for the PSF:\n<p style=\"text-align: justify\"><code>PSF_NORM<\/code><\/p>\n<p style=\"text-align: justify\">Normalization scheme used for the PSF created by this recipe if one is not specified using the above parameter. This may be <em>PEAK<\/em> or <em>SUM<\/em> to indicate whether the Gaussian PSF should have a peak of unity or a sum of unity. If not specified, the recipe assumes <em>PEAK<\/em>.<\/p>\n<\/li>\n<li style=\"text-align: justify\">Whether to <em>SMOOTH<\/em> the data (default is 1, indicating it should be smoothed):\n<p style=\"text-align: justify\"><code>SMOOTH_DATA<\/code><\/p>\n<p style=\"text-align: justify\">Flag to denote whether or not the image and PSF should be smoothed and have the smoothed version subtracted from the original. If not specified, the recipe assumes a value of 1 (smooth and subtract).<\/p>\n<\/li>\n<li style=\"text-align: justify\">The FWHM of the Gaussian used to smooth the data:\n<p style=\"text-align: justify\"><code>SMOOTH_FWHM<\/code><\/p>\n<p style=\"text-align: justify\">FWHM of Gaussian used to smooth data and PSF images before convolving with the PSF. If not specified the recipe assumes a value of 30 arcsec.<\/p>\n<\/li>\n<\/ol>\n<hr \/>\n<p style=\"text-align: center\"><strong><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/\">Other JCMT data reduction\/analysis tutorials are available here.<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: This tutorial assumes a pre-existing installation of the latest version of the Starlink software suite (available here), and that it has been initialized. The steps outlined below are for the BASH and ZSH shells; if the TCSH or CSH shell is being used, please replace the export command with\u2026 <a class=\"continue-reading-link\" href=\"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-4\/\">Continue reading<\/a><\/p>\n","protected":false},"author":41,"featured_media":0,"parent":4510,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4854"}],"collection":[{"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/comments?post=4854"}],"version-history":[{"count":54,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4854\/revisions"}],"predecessor-version":[{"id":11488,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4854\/revisions\/11488"}],"up":[{"embeddable":true,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4510"}],"wp:attachment":[{"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/media?parent=4854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}