{"id":4648,"date":"2016-04-29T17:39:33","date_gmt":"2016-04-30T03:39:33","guid":{"rendered":"http:\/\/www.eaobservatory.org\/jcmt\/?page_id=4648"},"modified":"2020-11-23T17:27:56","modified_gmt":"2020-11-24T03:27:56","slug":"scuba-2-dr-tutorial-1","status":"publish","type":"page","link":"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-1\/","title":{"rendered":"SCUBA-2 Data Reduction &#8211; Tutorial 1"},"content":{"rendered":"<p style=\"text-align: justify\"><strong>Note:<\/strong> <em>This tutorial assumes that the computer to be used already has a functioning installation of the latest version of the <em>Starlink<\/em> software suite (<a href=\"http:\/\/starlink.eao.hawaii.edu\/starlink\/Releases\">the latest release is available for download here<\/a>).<\/em><\/p>\n<p>You must initialise the Starlink software following the instructions on the release page in the same terminal you are going to run this tutorial in.<\/p>\n<h2 style=\"text-align: justify\">Basic Pipeline Reduction<\/h2>\n<p style=\"text-align: justify\">This tutorial demonstrates how to run a standard, basic reduction of a <em>SCUBA-2<\/em> dataset using the <em>ORAC-DR<\/em> pipeline software using different data reduction recipes and provides an introduction to basic Gaia use.<\/p>\n<ol>\n<li style=\"text-align: justify\">Obtain a copy of the file <a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMT_SCUBA-2_tutorial1_2016.tar.gz\"><em>JCMT_SCUBA-2_tutorial1_2016.tar.gz<\/em><\/a> containing the raw data <a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMT_SCUBA-2_tutorial1_2016.tar.gz\">from here<\/a> (file size: ~650 MB). This file contains <em>SCUBA-2<\/em> 850-micron band observational data for <a href=\"http:\/\/simbad.u-strasbg.fr\/simbad\/sim-basic?Ident=G34.3%2B0.2&amp;submit=SIMBAD+search\">G34.3+0.2<\/a>.\n<p style=\"text-align: justify\">Copy this file to a suitable directory to work in (e.g. your local home directory, <em>~\/<\/em> , in the following example):<\/p>\n<p style=\"text-align: justify\"><code>cp JCMT_SCUBA-2_tutorial1_2016.tar.gz ~\/<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">Switch to the working directory, open the tarball and change to the newly-created directory containing the raw data:\n<p style=\"text-align: justify\"><code>cd ~\/<br \/>\ntar xvzf JCMT_SCUBA-2_tutorial1_2016.tar.gz<br \/>\ncd tutorial\/raw\/<\/code><\/p>\n<p>This directory should contain a number of <em>.sdf<\/em> files and a<em> README <\/em>document. This can be checked by listing the contents of the directory by typing<\/p>\n<p style=\"text-align: justify\"><code>ls<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">Create an index file (called <em>mylist<\/em>) listing all of the input files, with explicit pathnames, and move it to the reduced directory, and switch to that as the current working directory (<em>ORAC-DR<\/em> will be run from there later on):\n<p style=\"text-align: justify\"><code>ls -d -1 $PWD\/*.sdf &gt; mylist<br \/>\nmv mylist ..\/reduced\/<br \/>\ncd ..\/reduced\/<\/code><\/li>\n<li style=\"text-align: justify\">Set up <em>ORAC-DR<\/em> for <em>SCUBA-2<\/em> 850-micron data processing, and specify that the reduced files will be written to the current working directory:\n<p style=\"text-align: justify\"><code>oracdr_scuba2_850 -cwd<\/code><\/p>\n<p style=\"text-align: justify\">The <em>-cwd<\/em> option specifies that the current working directory should be used. Depending on your environment variable settings, it may not be needed.<\/p>\n<p style=\"text-align: justify\">By default, <em>ORAC-DR<\/em> will issue a warning that the default input data directory does not exist. It is therefore necessary to manually set the <em>ORAC_DATA_IN<\/em> environment variable. In case there is uncertainty as to which shell is currently in use, type the following to find out the answer:<\/p>\n<p style=\"text-align: justify\"><code>echo \"$SHELL\"<\/code><\/p>\n<p style=\"text-align: justify\">If in the <strong>Bash or zsh<\/strong> shell, type:<\/p>\n<p style=\"text-align: justify\"><code>export ORAC_DATA_IN=~\/tutorial\/raw\/<\/code><\/p>\n<p style=\"text-align: justify\"><span style=\"text-decoration: underline\"><strong>Or<\/strong><\/span>, if in the <strong>TC-shell or C-shell<\/strong>, type:<\/p>\n<p style=\"text-align: justify\"><code>setenv ORAC_DATA_IN ~\/tutorial\/raw\/<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">It should now be possible to run <em>ORAC-DR<\/em> by typing the following:\n<p style=\"text-align: justify\"><code>oracdr -loop file -files mylist<\/code><\/p>\n<p style=\"text-align: justify\">This should launch a separate window showing the progress of the data reduction. It will also indicate any problems encountered, and report as files are created and\/or deleted.<\/p>\n<div id=\"attachment_5030\" style=\"width: 296px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig1.png\"><img aria-describedby=\"caption-attachment-5030\" loading=\"lazy\" class=\"size-medium wp-image-5030\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig1-286x300.png\" alt=\"The ORAC-DR window, upon completion of the automated SCUBA-2 pipeline data reduction process.\" width=\"286\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig1-286x300.png 286w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig1-975x1024.png 975w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig1-143x150.png 143w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig1.png 1498w\" sizes=\"(max-width: 286px) 100vw, 286px\" \/><\/a><p id=\"caption-attachment-5030\" class=\"wp-caption-text\">The ORAC-DR window, upon completion of the automated SCUBA-2 pipeline data reduction process.<\/p><\/div>\n<p style=\"text-align: justify\">Once the reduction process has completed, press the <em>Exit ORAC-DR<\/em> button to close the window. A number of files should have been produced as a result of the reduction process, including various logs, NDF and PNG preview image files.<\/p>\n<\/li>\n<li style=\"text-align: justify\">It is also possible to examine the reduced group dataset in <em>Gaia<\/em>. This can be done by typing:\n<p style=\"text-align: justify\"><code>gaia gs20120501_68_850_reduced.sdf &amp;<\/code><\/p>\n<p style=\"text-align: justify\">This should launch a main <em>Gaia<\/em> window with the reduced image in it. To get a better sense of the more extended structure in the source, use the <em>View<\/em> drop-down menu, select <em>Cut Levels<\/em> and use the <em>Auto Set<\/em> option of <em>98%<\/em>. It is also trivial to zoom in and out of the image using the two <em>Z<\/em> buttons.<\/p>\n<div id=\"attachment_5035\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig2.png\"><img aria-describedby=\"caption-attachment-5035\" loading=\"lazy\" class=\"size-medium wp-image-5035\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig2-294x300.png\" alt=\"Simple Gaia imaging of the pipeline-reduced map of G34.3+0.2.\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig2-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig2-1002x1024.png 1002w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig2-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig2.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5035\" class=\"wp-caption-text\">Simple Gaia imaging of the pipeline-reduced map of G34.3+0.2.<\/p><\/div>\n<p style=\"text-align: justify\"><em>Gaia<\/em> has many other features to aid in image analysis. Feel free to experiment!<\/p>\n<\/li>\n<li style=\"text-align: justify\">As well as examining the reduced image data in <em>Gaia<\/em>, it is also possible to view other components of the <em>NDF<\/em> file. For example, the dataset also includes maps of the weights used at each position, the exposure times, and so on. In order to view these, the general strategy is to locate the supplementary Gaia window with the title Select <em>NDF<\/em> in container file, then select the desired table entry, and finally select one of the buttons near the bottom of that window. For example, to view the variance map of the science data, click on the top row of the table (number 1) to choose the science dataset, and then press the <em>Variance<\/em> button to see the science data variance map in the main <em>Gaia<\/em> window. Similarly, to view the exposure time map for the field, select the third row of the table (number 3 \/ <em>EXP_TIME<\/em>) and click on the <em>data<\/em> button. It should be noted that the levels of each of these maps can be very different, so it may be necessary to modify the cut levels again, as in step 6.\n<div id=\"attachment_5044\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig3.png\"><img aria-describedby=\"caption-attachment-5044\" loading=\"lazy\" class=\"size-medium wp-image-5044\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig3-294x300.png\" alt=\"Exposure time map of SCUBA-2 tutorial dataset.\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig3-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig3-1002x1024.png 1002w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig3-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/04\/SCUBA-2_DR_tutorial_fig3.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5044\" class=\"wp-caption-text\">Exposure time map of the pipeline-reduced SCUBA-2 tutorial dataset.<\/p><\/div><\/li>\n<li style=\"text-align: justify\">Each <em>SCUBA-2<\/em> science observation specifies a default data reduction recipe in the header information. This is originally set by selecting a recipe option in the <em>Observing Tool<\/em> during MSB preparation. To view the default recipe for a given dataset, switch to the raw data directory:\n<p style=\"text-align: justify\"><code>cd ..\/raw\/<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>If you set up the KAPPA package by typing<br \/>\n<code><br \/>\nkappa<br \/>\n<\/code><br \/>\nAnd seeing in your terminal<br \/>\n<code><br \/>\nKAPPA commands are now available -- (Version 2.6-4)<\/code><\/p>\n<p>Type kaphelp for help on KAPPA commands.<br \/>\nType &#8216;showme sun95&#8217; to browse the hypertext documentation.<\/p>\n<p>See the &#8216;Release Notes&#8217; section of SUN\/95 for details of the<br \/>\nchanges made for this release.<\/p>\n<p>You can use either of the following commands to examine the relevant part of the FITS header component of the data:<\/li>\n<li style=\"text-align: justify\"><code>fitsval s8a20120501_00068_0001.sdf RECIPE<\/code>\n<p style=\"text-align: justify\">or<\/p>\n<p style=\"text-align: justify\"><code>fitslist s8a20120501_00068_0001.sdf | grep RECIPE<\/code><\/p>\n<p style=\"text-align: justify\">The default recipe for the example dataset is <em>REDUCE_SCAN<\/em>.<\/p>\n<\/li>\n<li style=\"text-align: justify\">It is also possible to re-run the pipeline reduction process using a different recipe from the default specified in the FITS header by simply appending the name of the recipe to the command line instruction. To try this, switch to the reduced data directory and try re-running the pipeline reduction with a different recipe:\n<p style=\"text-align: justify\"><code>cd ..\/reduced\/<br \/>\noracdr -loop file -files mylist REDUCE_SCAN_EXTENDED_SOURCES<\/code><\/p>\n<p style=\"text-align: justify\">Note that when this is run, <em>ORAC-DR<\/em> will issue a warning about the suitability of the specified recipe for the <em>DAISY<\/em> mode data used in this tutorial. This demonstrates that care should be taken when manually specifying recipes.<\/p>\n<p style=\"text-align: justify\">To regenerate the original default reduction, just re-run <em>ORAC-DR<\/em> with the default recipe as before:<\/p>\n<p style=\"text-align: justify\"><code>oracdr -loop file -files mylist<\/code><\/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 that the computer to be used already has a functioning installation of the latest version of the Starlink software suite (the latest release is available for download here). You must initialise the Starlink software following the instructions on the release page in the same terminal you\u2026 <a class=\"continue-reading-link\" href=\"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-1\/\">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\/4648"}],"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=4648"}],"version-history":[{"count":97,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4648\/revisions"}],"predecessor-version":[{"id":11485,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4648\/revisions\/11485"}],"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=4648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}