{"id":4962,"date":"2016-05-09T12:29:34","date_gmt":"2016-05-09T22:29:34","guid":{"rendered":"http:\/\/www.eaobservatory.org\/jcmt\/?page_id=4962"},"modified":"2020-11-24T12:12:47","modified_gmt":"2020-11-24T22:12:47","slug":"heterodyne-dr-tutorial-1","status":"publish","type":"page","link":"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/heterodyne-dr-tutorial-1\/","title":{"rendered":"Heterodyne Instrument Data Reduction 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 a recent 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<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 heterodyne observation using the <em>ORAC-DR<\/em> pipeline software and provides an introduction to basic <em>Gaia<\/em> use.<\/p>\n<p style=\"text-align: justify\">The ORAC-DR pipeline is a generic automated data reduction pipeline that can process your raw JCMT data and return advanced data products: baselined single observation cubes, mosaicked and co-added cubes, moments map and clump catalogues. Before you begin we recommend reading <a href=\"http:\/\/starlink.eao.hawaii.edu\/devdocs\/sc20.htx\/sc20ch5.html#x6-340001\">Chapter 5<\/a> of the <a href=\"http:\/\/starlink.eao.hawaii.edu\/devdocs\/sc20.htx\/sc20.html\">The Heterodyne Data Reduction Cookbook<\/a> which discusses <a href=\"http:\/\/starlink.eao.hawaii.edu\/devdocs\/sc20.htx\/sc20ch5.html#x6-340001\">the ACSIS Pipeline<\/a>.<\/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_HETERODYNE_tutorial_2016.tar.gz\"><em>JCMT_HETERODYNE_tutorial_2016.tar.gz<\/em><\/a> containing the raw data. Copy this file to a suitable directory to work in (<em>~\/data<\/em> is used in the following example):\n<p style=\"text-align: justify\"><code>cp JCMT_HETERODYNE_tutorial_2016.tar.gz ~\/data<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">Switch to the data directory and open the tarball:\n<p style=\"text-align: justify\"><code>tar xvzf JCMT_HETERODYNE_tutorial_2016.tar.gz<\/code><\/p>\n<p style=\"text-align: justify\">This directory should now contain a number of <em>.sdf<\/em> files corresponding to different heterodyne observing modes which are to be reduced by different recipes:<\/p>\n<table style=\"width: 653px\">\n<tbody>\n<tr>\n<td style=\"width: 318px;text-align: left\"><strong>Observation (UT Date + Scan Number)<\/strong><\/td>\n<td style=\"width: 10px;text-align: left\"><strong>Source Observed<\/strong><\/td>\n<td style=\"width: 10px;text-align: left\"><strong>Spectral Line<\/strong><\/td>\n<td style=\"width: 107px;text-align: left\"><strong>Mode<\/strong><\/td>\n<td style=\"width: 50px;text-align: left\"><strong>Type of Data<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 318px\">20110103 Scan 25<\/td>\n<td style=\"width: 10px\"><a href=\"http:\/\/simbad.u-strasbg.fr\/simbad\/sim-id?Ident=NAME%20LDN%201551%20IRS%205\">L1551-IRS5<\/a><\/td>\n<td style=\"width: 10px\">C<sup>18<\/sup>O(3-2)<\/td>\n<td style=\"width: 107px\">Stare<\/td>\n<td style=\"width: 50px\">Narrow Line<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 318px\">20160317 Scan 17<\/td>\n<td style=\"width: 10px\"><a href=\"http:\/\/simbad.u-strasbg.fr\/simbad\/sim-basic?Ident=CRL+618&amp;submit=SIMBAD+search\">CRL 618<\/a><\/td>\n<td style=\"width: 10px\">CO(3-2)<\/td>\n<td style=\"width: 107px\">Stare<\/td>\n<td style=\"width: 50px\">Broad Line<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 318px\">20110926 Scan 29<\/td>\n<td style=\"width: 10px\"><a href=\"http:\/\/simbad.u-strasbg.fr\/simbad\/sim-basic?Ident=CRL+2688&amp;submit=SIMBAD+search\">CRL 2688<\/a><\/td>\n<td style=\"width: 10px\">CO(3-2)<\/td>\n<td style=\"width: 107px\">Stare (wide band mode)<\/td>\n<td style=\"width: 50px\">Gradient<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 318px\">20160316 Scan 39<\/td>\n<td style=\"width: 10px\">Mars<\/td>\n<td style=\"width: 10px\">CO(3-2)<\/td>\n<td style=\"width: 107px\">Stare<\/td>\n<td style=\"width: 50px\">Continuum<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 318px\">20111025 Scan 7<\/td>\n<td style=\"width: 10px\"><a href=\"http:\/\/simbad.u-strasbg.fr\/simbad\/sim-basic?Ident=OH 34.26 %2b0.15&amp;submit=SIMBAD+search\">G34.3+0.2<\/a><\/td>\n<td style=\"width: 10px\">CH<sub>3<\/sub>OH(7-6)<\/td>\n<td style=\"width: 107px\">Stare<\/td>\n<td style=\"width: 50px\">Line forest<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 318px\">20070705 Scan 34<\/td>\n<td style=\"width: 10px\"><a href=\"http:\/\/simbad.u-strasbg.fr\/simbad\/sim-basic?Ident=OH 34.26 %2b0.15&amp;submit=SIMBAD+search\">G34.3+0.2<\/a><\/td>\n<td style=\"width: 10px\">CO(3-2)<\/td>\n<td style=\"width: 107px\">HARP-5 Jiggle map<\/td>\n<td style=\"width: 50px\">Gradient<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;width: 318px\">20070705 Scans 38+39<\/td>\n<td style=\"text-align: left;width: 10px\"><a href=\"http:\/\/simbad.u-strasbg.fr\/simbad\/sim-basic?Ident=OH 34.26 %2b0.15&amp;submit=SIMBAD+search\">G34.3+0.2<\/a><\/td>\n<td style=\"text-align: left;width: 10px\">CO(3-2)<\/td>\n<td style=\"text-align: left;width: 107px\">Raster map (basket-weave)<\/td>\n<td style=\"text-align: left;width: 50px\">Gradient<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li style=\"text-align: justify\">before proceeding further you will need to ensure the starlink software is loaded in your terminal, and you have loaded the analysis tools package; Kappa.Firstly, in case there is uncertainty as to which shell is currently in use, type the following to find out the answer:\n<p style=\"text-align: justify\"><code>echo \"$SHELL\"<\/code><\/p>\n<p>If using the Bash or zsh shells, type:<\/p>\n<p style=\"text-align: justify\"><code>export STARLINK_DIR=\/star<\/code><\/p>\n<p>Or, if using the TC-shell or C-shell, instead type:<\/ul>\n<\/li>\n<\/ul>\n<p style=\"text-align: justify\"><code>setenv STARLINK_DIR \/star<\/code><\/p>\n<p>Then in any of the above shells, type:<\/p>\n<p><code>source $STARLINK_DIR\/etc\/profile<\/code><\/p>\n<p>And then launch Kappa by typing:<\/p>\n<p><code>kappa<\/code><\/p>\n<p style=\"text-align: justify\">If you encouter issues, please ensure you have <a href=\"http:\/\/starlink.eao.hawaii.edu\/starlink\">installed Starlink correctly<\/a>. You can also consult the\u00a0<a class=\"http\" href=\"http:\/\/www.jiscmail.ac.uk\/archives\/starlink.html\">Starlink support mailing list<\/a> for questions\/concerns (or email\u00a0 <a href=\"mailto:helpdesk@eaobservatory.org\">helpdesk@eaobservatory.org<\/a>).<\/p>\n<\/li>\n<li style=\"text-align: justify\">It is possible to inspect a raw data file with <em>Gaia<\/em>:\n<p style=\"text-align: justify\"><code>gaia a20110103_00025_01_0001.sdf<\/code><\/p>\n<div id=\"attachment_5091\" style=\"width: 304px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig1.png\"><img aria-describedby=\"caption-attachment-5091\" loading=\"lazy\" class=\"size-medium wp-image-5091\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig1-294x300.png\" alt=\"One of the heterodyne tutorial datasets imaged in Gaia.\" width=\"294\" height=\"300\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig1-294x300.png 294w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig1-1002x1024.png 1002w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig1-147x150.png 147w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig1.png 1578w\" sizes=\"(max-width: 294px) 100vw, 294px\" \/><\/a><p id=\"caption-attachment-5091\" class=\"wp-caption-text\">One of the heterodyne tutorial datasets imaged in Gaia.<\/p><\/div><\/li>\n<li style=\"text-align: justify\">Before reducing your data it is possible to look at the metadata using <a href=\"http:\/\/www.starlink.ac.uk\/devdocs\/sun95.htx\/sun95ss56.html#xref_FITSLIST\">fitslist<\/a> and <a href=\"http:\/\/www.starlink.ac.uk\/devdocs\/sun95.htx\/sun95ss123.html#xref_NDFTRACE\">ndftrace<\/a> (for more information about the metadata click <a href=\"http:\/\/www.starlink.ac.uk\/devdocs\/sc20.htx\/sc20ch2.html#x3-150003\">here)<\/a>:\n<p style=\"text-align: justify\"><code>fitslist a20110103_00025_01_0001.sdf<\/code><\/p>\n<p style=\"text-align: justify\">and:<\/p>\n<p style=\"text-align: justify\"><code>ndftrace a20110103_00025_01_0001.sdf<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">It is possible to check the System Temperature (Tsys) and Receiver Temperature (Trx) by doing an hdstrace on your data:\n<p style=\"text-align: justify\"><code>hdstrace a20110103_00025_01_0001.MORE.ACSIS.TSYS<\/code><\/p>\n<p style=\"text-align: justify\">and:<\/p>\n<p style=\"text-align: justify\"><code>hdstrace a20110103_00025_01_0001.MORE.ACSIS.TRX<br \/>\n<\/code><\/li>\n<li style=\"text-align: justify\">Set up <em>ORAC-DR<\/em> for <em>ACSIS<\/em> data processing, and specify that the reduced files will be written to the current working directory:\n<p style=\"text-align: justify\"><code>oracdr_acsis<\/code><\/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.<\/p>\n<p style=\"text-align: justify\">If in the Bash or zsh shells, type:<\/p>\n<p style=\"text-align: justify\"><code>export ORAC_DATA_IN=.<\/code><\/p>\n<p style=\"text-align: justify\">Or, if in the TC-shell or C-shell, type:<\/p>\n<p style=\"text-align: justify\"><code>setenv ORAC_DATA_IN .<\/code><\/p>\n<\/li>\n<li style=\"text-align: justify\">Next, create a file <em>mylist<\/em> with the absolute file path to the raw data. This can be done via:\n<p style=\"text-align: justify\"><code>ls \/absolute\/file\/path\/file-of-interest.sdf &gt; mylist<\/code><\/p>\n<p style=\"text-align: justify\">Initially it is recommended to only reduce a single file at a time (typically one source\/frequency set-up)<\/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 -files mylist<br \/>\n<\/code><\/p>\n<p style=\"text-align: justify\"><em>ORAC-DR<\/em> will use the default <a href=\"http:\/\/starlink.eao.hawaii.edu\/docs\/sun260.htx\/sun260.html\">recipe<\/a> specified in the header (<em>REDUCE_SCIENCE<\/em>) to reduce the data. This should launch a separate windows showing the progress of the data reduction. It will also indicate any problems encountered, and report as files are created and\/or deleted. The <em>-nodisplay<\/em> option is not necessary. Although often informative, displaying the outputs from the reduction process while running it may slow down its execution.<\/p>\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. <em>REDUCE_SCIENCE<\/em> uses <em>REDUCE_STANDARD<\/em> for standard calibration sources and <em>REDUCE_SCIENCE_GRADIENT<\/em> for maps. Note that <em>REDUCE_STANDARD<\/em> does not produce group files. Alternatively (for to see progress in the terminal, and a log saved to the directory you are working in) try:<\/p>\n<p style=\"text-align: justify\"><code>oracdr -files mylist -nodisplay -log sf<\/code><\/p>\n<p style=\"text-align: justify\">A list of the output files produced and their descriptions can be found here:<\/p>\n<\/li>\n<li style=\"text-align: justify\">It is 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 a20110103_00025_01_reduced001.sdf &amp;<\/code><\/p>\n<p>or<\/p>\n<p style=\"text-align: justify\"><code>gaia ga20110103_25_1_reduced001.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. It is possible to zoom in and out of the image using the two <em>Z<\/em> buttons. Click on a pixel to view the spectrum at this position. It is then possible to click on the <em>Send: replace<\/em> button to view the spectrum in <em>SPLAT<\/em>.<\/p>\n<div id=\"attachment_5094\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig2.png\"><img aria-describedby=\"caption-attachment-5094\" loading=\"lazy\" class=\"size-medium wp-image-5094\" src=\"http:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig2-300x198.png\" alt=\"A spectrum from the heterodyne tutorial dataset displayed in SPLAT.\" width=\"300\" height=\"198\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig2-300x198.png 300w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig2-1024x675.png 1024w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig2-228x150.png 228w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig2-150x99.png 150w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2016\/05\/Heterodyne_DR_tutorial_fig2.png 1576w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-5094\" class=\"wp-caption-text\">A spectrum from the heterodyne tutorial dataset displayed in SPLAT.<\/p><\/div>\n<p style=\"text-align: justify\">Gaia and SPLAT have many other features to aid in image analysis. Feel free to experiment!<\/p>\n<\/li>\n<li style=\"text-align: justify\">Estimation of the rms of a spectrum can be done in SPLAT using the \u03a3 button (&#8220;Get statistics on region of spectrum&#8221;), by &#8220;adding&#8221; new background regions and calculating the statistics. Alternatively you can simply run the kappa stats command on the error component of the data:\n<p style=\"text-align: justify\"><code>stats file.sdf comp=error<br \/>\n<\/code><\/li>\n<\/ol>\n<hr \/>\n<p style=\"text-align: center\"><strong><a style=\"text-align: justify\" 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 a recent version of the Starlink software suite (the latest release is available for download here). Basic Pipeline Reduction This tutorial demonstrates how to run a standard, basic reduction of a heterodyne observation using\u2026 <a class=\"continue-reading-link\" href=\"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/heterodyne-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\/4962"}],"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=4962"}],"version-history":[{"count":69,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4962\/revisions"}],"predecessor-version":[{"id":11530,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/4962\/revisions\/11530"}],"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=4962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}