{"id":4888,"date":"2016-05-06T15:46:29","date_gmt":"2016-05-07T01:46:29","guid":{"rendered":"http:\/\/www.eaobservatory.org\/jcmt\/?page_id=4888"},"modified":"2020-11-23T17:44:56","modified_gmt":"2020-11-24T03:44:56","slug":"scuba-2-dr-tutorial-3","status":"publish","type":"page","link":"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-3\/","title":{"rendered":"SCUBA-2 Data Reduction &#8211; Tutorial 3"},"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 and ZSH<\/em> 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\">External Masking<\/h2>\n<p style=\"text-align: justify\">Note: External masking is usually used to help recover\/improve large scale structure and decrease the negative bowling in large <em>PONG<\/em> maps. However, large maps have high computational requirements for reduction, which may not be feasible on many laptops. To ensure that this tutorial is easy to run on portable computers, the same short <em>Daisy<\/em> observation as used for <em>SCUBA-2<\/em> DR Tutorials 1 and 2. This will demonstrate the steps used to carry out a reduction with an external mask, but it will not produce a scientifically useful output map. Interested users are encouraged to try downloading a larger <em>PONG<\/em> map containing complex structure from the <em>JCMT<\/em> Science Archive and looking at the effect of an external mask using a more powerful desktop computer.<\/p>\n<ol>\n<li style=\"text-align: justify\">Obtaining the data (if not already done for previous SCUBA-2 tutorials).\n<p style=\"text-align: justify\">This tutorial uses the same raw data as SCUBA-2 Tutorials <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-1\/\">1<\/a> and <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-2\/\">2<\/a>, available <a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMT_SCUBA-2_tutorial1_2016.tar.gz\">here<\/a>. Please download and <em>gunzip\/untar<\/em> this file:<\/p>\n<p style=\"text-align: justify\"><code>tar xvfz JCMT_SCUBA-2_tutorial1_2016.tar.gz<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">Perform a normal reduction of the map.\n<p style=\"text-align: justify\">The default <em>dimmconfig<\/em> file <em>dimmconfig_bright_extended.lis<\/em> will be used for this reduction. This is not actually an ideal <em>dimmconfig<\/em> for <em>Daisy<\/em> observations, and would be more suited to a large <em>PONG<\/em> observation.<\/p>\n<p style=\"text-align: justify\">First, make a list of the raw files:<\/p>\n<p style=\"text-align: justify\"><code>ls `pwd`\/raw\/s*.sdf &gt; raw.lis<\/code><\/p>\n<p style=\"text-align: justify\">Alternatively, just copy the <em>mylist<\/em> file from <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-1\/\">SCUBA-2 Tutorial 1<\/a> to the current directory as <em>raw.lis<\/em> and use that.<\/p>\n<p style=\"text-align: justify\">The reduction here is performed directly with <em>makemap<\/em>, although if preferred, this step could be done using <em>ORAC-DR<\/em> as well.<\/p>\n<p style=\"text-align: justify\"><code>makemap in=^raw.lis out=map config=^$STARLINK_DIR\/share\/smurf\/dimmconfig_bright_extended.lis<\/code><\/p>\n<div id=\"attachment_5073\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig1.png\"><img aria-describedby=\"caption-attachment-5073\" loading=\"lazy\" class=\"size-medium wp-image-5073\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig1-294x300.png\" alt=\"Initial mapmaker-generated image map.\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig1-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig1-1002x1024.png 1002w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig1-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig1.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5073\" class=\"wp-caption-text\">Initial mapmaker-generated image map.<\/p><\/div><\/li>\n<li style=\"text-align: justify\">Check the output map by opening it in <em>Gaia<\/em>. The <em>bright_extended dimmconfig<\/em> does not produce a very good map. Note that if the file was reduced directly with <em>makemap<\/em>, the output file will be in units of pW, as it has not yet been calibrated.<\/li>\n<li style=\"text-align: justify\">Use this map to create an external mask indicating the location of emission. In practice, this would usually involve creating a mask from the co-addition of multiple observations. For the sake of simplicity in this example, however, only one observation will be used.\n<ol>\n<li style=\"text-align: justify\">Make a signal-to-noise ratio (snr) map and threshold it such that everything below a 3\u03c3 detection is 0 and everything above it is 1:\n<p style=\"text-align: justify\"><code>makesnr in=map.sdf out=snr.sdf minvar=0<br \/>\nthresh in=snr.sdf out=threshed.sdf thrlo=3 newlo=0 thrhi=3 newhi=1<\/code><\/li>\n<li style=\"text-align: justify\">Smooth the thresholded map in order to ensure that it does not contain sharp cut-offs around the sources. Note that the FWHM is reported in pixels. Set the very low values to <em>BAD<\/em> and the remaining values to 1:\n<p style=\"text-align: justify\"><code>gausmooth in=threshed.sdf out=smoothed.sdf fwhm=5.0<br \/>\nthresh in=smoothed.sdf out=mask.sdf thrlo=0.05 newlo=bad thrhi=0.05 newhi=1<\/code><\/p>\n<div id=\"attachment_5074\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig2.png\"><img aria-describedby=\"caption-attachment-5074\" loading=\"lazy\" class=\"size-medium wp-image-5074\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig2-294x300.png\" alt=\"Mask derived from G34.3+0.2 tutorial data.\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig2-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig2-1004x1024.png 1004w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig2-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig2.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5074\" class=\"wp-caption-text\">Mask derived from G34.3+0.2 tutorial data.<\/p><\/div><\/li>\n<\/ol>\n<\/li>\n<li style=\"text-align: justify\">Re-reduce the raw files with this new mask.\n<ol>\n<li style=\"text-align: justify\">Create a <em>dimmconfig<\/em> with the necessary parameters to use an external mask:\n<p style=\"text-align: justify\"><code>echo '^$STARLINK_DIR\/share\/smurf\/dimmconfig_bright_extended.lis' &gt; external.lis<br \/>\necho 'ast.zero_mask=1' &gt;&gt; external.lis<br \/>\necho 'ast.zero_snr=0' &gt;&gt; external.lis<\/code><\/li>\n<li style=\"text-align: justify\">Now make the map again, this time using the new dimmconfig file and supplying the mask as the <em>ref<\/em> parameter:\n<p style=\"text-align: justify\"><code>makemap in=^raw.lis out=map_extmasked config=^external.lis ref=mask.sdf<\/code><\/p>\n<div id=\"attachment_5075\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig3.png\"><img aria-describedby=\"caption-attachment-5075\" loading=\"lazy\" class=\"size-medium wp-image-5075\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig3-294x300.png\" alt=\"Map of G34.3+0.2 tutorial data with external mask applied.\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig3-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig3-1002x1024.png 1002w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig3-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/SCUBA-2_DR_tutorial3_fig3.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5075\" class=\"wp-caption-text\">Map of G34.3+0.2 tutorial data with external mask applied.<\/p><\/div>\n<p style=\"text-align: justify\">It is now possible to compare the output files <em>map.sdf<\/em> and <em>map_extmasked.sdf<\/em>. Unfortunately, a large difference will not be apparent. This process also be tried (on a powerful computer) with large, complex <em>Pong<\/em> observations for a better example of the effect.<\/p>\n<\/li>\n<\/ol>\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-3\/\">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\/4888"}],"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=4888"}],"version-history":[{"count":43,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4888\/revisions"}],"predecessor-version":[{"id":11487,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4888\/revisions\/11487"}],"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=4888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}