{"id":6231,"date":"2017-01-10T16:05:57","date_gmt":"2017-01-11T02:05:57","guid":{"rendered":"http:\/\/www.eaobservatory.org\/jcmt\/?page_id=6231"},"modified":"2020-11-24T10:55:57","modified_gmt":"2020-11-24T20:55:57","slug":"scuba-2-dr-tutorial-5","status":"publish","type":"page","link":"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-5\/","title":{"rendered":"SCUBA-2 Data Reduction \u2013 Tutorial 5"},"content":{"rendered":"<p style=\"text-align: justify\"><strong>Note:<\/strong> This tutorial assumes that the computer to be used already has a functioning installation of a recent (2016A or newer) version of the Starlink software suite (the latest release is available for download <a href=\"http:\/\/starlink.eao.hawaii.edu\/starlink\/Releases\">here<\/a>). The user should download the relevant data for this tutorial:<\/p>\n<ul>\n<li style=\"text-align: justify\"><a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMT_SCUBA-2_tutorial1_2016.tar.gz\">Dataset for <em>SCUBA-2<\/em> Data Reduction\/Analysis Tutorials 1 \u2013 3 &amp; 5<\/a> (Filesize: ~650 MB)<\/li>\n<li style=\"text-align: justify\"><a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMT_HETERODYNE_tutorial_2016.tar.gz\">Dataset for <em>Heterodyne<\/em> Data Reduction\/Analysis Tutorial 1 <em>also<\/em> required for <em>SCUBA-2<\/em> Data Reduction\/Analysis Tutorial 5<\/a> (Filesize: ~77MB)<\/li>\n<\/ul>\n<p style=\"text-align: justify\">The user is also advised to first obtain basic familiarity with SCUBA-2 datasets, via the relevant JCMT SCUBA-2 web <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/\">Tutorials 1 and 2<\/a> and heterodyne data reduction, via the relevant JCMT heterodyne web <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/heterodyne-dr-tutorial-1\/\">Tutorial 1<\/a> (specifically using data: 20070705 Scans 38+39).<\/p>\n<h2>CO (3-2) contamination estimation<\/h2>\n<p style=\"text-align: justify\">It has long been reported in the literature that the CO (3-2) molecule provides additional emission at 850 micron than the emission produced by dust alone. To fully appreciate this tutorial you are encouraged to read: <a href=\"http:\/\/adsabs.harvard.edu\/cgi-bin\/bib_query?arXiv:1204.6180\">Molecular line contamination in the SCUBA-2 450 and 850 \u03bcm continuum data by Drabek et al. 2012<\/a>,\u00a0 <a href=\"http:\/\/iopscience.iop.org\/article\/10.3847\/1538-4365\/aa989c\/meta\">Parsons et al. 2018<\/a> and also the <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/instrumentation\/continuum\/scuba-2\/contamination\/\">SCUBA-2 contamination page<\/a>.<\/p>\n<p style=\"text-align: justify\">Before proceeding further you will need to ensure the\u00a0<a class=\"http\" href=\"http:\/\/www.jiscmail.ac.uk\/archives\/starlink.html\">Starlink <\/a>software is loaded in your terminal, and you have loaded the analysis tools package; <a href=\"http:\/\/starlink.eao.hawaii.edu\/docs\/sun95.htx\/sun95.html\">kappa<\/a>:<\/p>\n<p><code>starlink<\/code><\/p>\n<p><code>kappa<\/code><\/p>\n<p>if you have issues please ensure you have <a href=\"http:\/\/starlink.eao.hawaii.edu\/starlink\">installed starlink correctly,<\/a> you can also see 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<h3>STEP 1: Creating a HARP reference input file<\/h3>\n<p style=\"text-align: center\"><span style=\"color: #ff0000\">If you have run the\u00a0<strong><span style=\"color: #ff0000\"><a style=\"color: #ff0000\" href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/reductionanalysis-tutorials\/heterodyne-dr-tutorial-1\/\">Heterodyne Instrument Data Reduction\/Analysis Tutorial 1<\/a><\/span><\/strong> on observations 20070705 38 and 39 and have produced file: ga20070705_38_1_integ.sdf you can skip this first step<br \/>\n<\/span><\/p>\n<p style=\"text-align: justify\">If you have not done so already download: <a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMT_HETERODYNE_tutorial_2016.tar.gz\">Dataset for Heterodyne Data Reduction\/Analysis Tutorial 1<\/a> (Filesize: ~77MB) containing the raw data. Copy this file to a suitable directory to work in (<em>~\/raw<\/em> is used in the following example):<\/p>\n<p><code>cp JCMT_HETERODYNE_tutorial_2016.tar.gz ~\/raw<\/code><\/p>\n<p>Switch to the raw directory and open the tarball:<\/p>\n<p><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. To being the reduction process it is recommended moving to a new folder (you might like to call this reduced). In this folder you should 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:<\/p>\n<p><code>oracdr_acsis -cwd<\/code><\/p>\n<p>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>In the Bash or zsh shell, type:<\/p>\n<p><code>export ORAC_DATA_IN=.<\/code><\/p>\n<p>Or, in the TC-shell or C-shell, type:<\/p>\n<p><code>setenv ORAC_DATA_IN .<\/code><\/p>\n<p>now create a file <em>harp_files.list<\/em> with the absolute file path to the raw data. This can be done via:<\/p>\n<p><code>ls \/absolute\/file\/path\/a20070705_0003[8-9]*.sdf &gt; harp_files.list<\/code><\/p>\n<p>It should now be possible to run <em>ORAC-DR<\/em> on the raw HARP data by typing the following:<\/p>\n<p><code>oracdr -files harp_files.list -nodisplay -log sf<\/code><\/p>\n<p>To view the reduced data cube simply run GAIA:<\/p>\n<p><code>gaia ga20070705_38_1_integ.sdf<\/code><\/p>\n<p>To view the integrated intensity image produced by the pipeline you can run GAIA:<\/p>\n<p><code>gaia ga20070705_38_1_integ.sdf<\/code><\/p>\n<div id=\"attachment_6418\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-HARP-integrated-intensity-map.png\"><img aria-describedby=\"caption-attachment-6418\" loading=\"lazy\" class=\"wp-image-6418 size-medium\" src=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-HARP-integrated-intensity-map-300x287.png\" width=\"300\" height=\"287\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-HARP-integrated-intensity-map-300x287.png 300w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-HARP-integrated-intensity-map-768x735.png 768w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-HARP-integrated-intensity-map-157x150.png 157w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-HARP-integrated-intensity-map-150x144.png 150w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-HARP-integrated-intensity-map.png 798w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-6418\" class=\"wp-caption-text\">HARP integrated intensity map of g34 as produced by ORACDR.<\/p><\/div>\n<h3>STEP 2: Masking noise regions in the HARP CO (3-2) integrated intensity map<\/h3>\n<p style=\"text-align: justify\">First we take the HARP CO (3-2) integrated intensity mask (ga20070705_38_1_integ.sdf) and remove the redundant third axis.<\/p>\n<p style=\"text-align: justify\"><code>ndfcopy in=\\\"ga20070705_38_1_integ.sdf\\(:,:\\)\\\" out=ga20070705_38_1_integ_clip.sdf<\/code><\/p>\n<p>we then remove noisy pixels\/regions.<\/p>\n<p><code>makesnr in=ga20070705_38_1_integ_clip.sdf out=ga20070705_38_1_integ_snr.sdf minvar=0<\/code><\/p>\n<p style=\"text-align: justify\">we then set the images to be bad or have a value of 1, depending if they are above or below a certain threshold in the signal-to-noise image. In this example we set this value to be 5*:<\/p>\n<p><code>thresh in=ga20070705_38_1_integ_snr out=ga20070705_38_1_integ_snr_thresh thrhi=5 thrlo=5 newhi=1 newlo=bad<\/code><\/p>\n<p>Now we apply this mask to the original data:<\/p>\n<p><code>mult ga20070705_38_1_integ_snr_thresh.sdf ga20070705_38_1_integ.sdf  out=ga20070705_38_1_integ_masked.sdf<\/code><\/p>\n<p style=\"text-align: justify\"><em>NOTE: The above can also be done in a single step using an error clip to remove all pixels with a signal-to-noise-ratio greater than 5, however we will use the ga20070705_38_1_integ_snr_thresh file later. <\/em><em><code>errclip in=ga20070705_38_1_integ_clip.sdf out=ga20070705_38_1_integ_masked.sdf limit=5 mode=snr<\/code><\/em><\/p>\n<h3>STEP 3: Convert the HARP integrated data from K to pW<\/h3>\n<p>To be converted to pW (the raw units of SCUBA-2 data) from K (the raw units of HARP data) we first need to correct the data for HARP efficiencies and transform the data from T<sub>A<\/sub>* to T<sub>mb<\/sub> using \u03b7<sub>mb<\/sub> = 0.64 from the <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/instrumentation\/heterodyne\/harp\/\">HARP instrument page<\/a>.<\/p>\n<p><code>cdiv in=ga20070705_38_1_integ_masked out=ga20070705_38_1_integ_masked_tmb scalar=0.64<\/code><\/p>\n<p>It is good practice to update the units and the data label as we progress. Note we can also track our progress using the <a href=\"http:\/\/starlink.eao.hawaii.edu\/docs\/sun95.htx\/sun95.html\">kappa<\/a> command <a href=\"http:\/\/starlink.eao.hawaii.edu\/docs\/sun95.htx\/sun95ss72.html#Q1-99-442\">hislist<\/a>.<\/p>\n<p><code>setunits ga20070705_38_1_integ_masked_tmb units=\\\"K km\/s \\\"<\/code><\/p>\n<p><code>setlabel ga20070705_38_1_integ_masked_tmb label=\\\"Tmb\\\"<\/code><\/p>\n<p style=\"text-align: justify\">We then need to calculate the conversion from K to pW, known as the C factor. This is explained more fully on the <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/instrumentation\/continuum\/scuba-2\/contamination\/\">SCUBA-2 Molecular Line Contamination<\/a> page. The C factor is known to depend on the amount of water in the atmosphere and so the initial steps for the conversion is to determine the PWV value\/the conditions that the HARP data were obtained under. This is done using fitslist:<\/p>\n<p><code>fitslist ga20070705_38_1_integ_masked_tmb.sdf | grep WVMTAU<\/code><\/p>\n<p style=\"text-align: justify\">The WVM opacity reported at the JCMT is obtained by the 183GHz WVM instrument installed inside the JCMT&#8217;s receiver cabin (the reported 186GHz in some observations is a bug\/typo in our software &#8211; please ignore). The value reported, alhtough obtained at 183GHz, is reported in terms of Tau225GHz. The reason the WVM is reported at 225GHz is historical and relates to a time when the JCMT used the <a href=\"http:\/\/cso.caltech.edu\/wiki\/cso\/instruments\/tippers\">CSO tipping radiaometer<\/a> (operating at 225GHz) for reference.<\/p>\n<p>The conversion from Tau<sub>225GH<\/sub>z to PWV is given on the weather page and in <a title=\"http:\/\/cdsads.u-strasbg.fr\/abs\/2013MNRAS.430.2534D\" href=\"http:\/\/cdsads.u-strasbg.fr\/abs\/2013MNRAS.430.2534D\">Dempsey et al. 2013<\/a>:<\/p>\n<p style=\"text-align: center\">Tau<sub>225GHz<\/sub> = 0.04 PWV + 0.017<\/p>\n<p style=\"text-align: justify\">We can calculate this PWV value using kappa calc function, where WVM tau was recorded to be 0.108. We call the\u00a0WVM tau in kappa calc: PT.<\/p>\n<p style=\"text-align: justify\"><code>calc exp=\"(PT-0.017)\/0.04\" PT=0.108<\/code><\/p>\n<p style=\"text-align: justify\">From this we find the PWV to be 2.275.<\/p>\n<p style=\"text-align: justify\">K<span style=\"color: #000000\">nowing the PWV value we can calculate the\u00a0 <\/span>C<sub>850<\/sub> factor for this data using the relations given on the <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/instrumentation\/continuum\/scuba-2\/contamination\/\">SCUBA-2 contamination page<\/a>. We can calculate this C<sub>850<\/sub> factor using kappa calc function, where PA though PE are the C function coefficients at 850 microns and PW is the PWV value previously calculated.<\/p>\n<p style=\"text-align: left\"><span style=\"color: #000000\"><code>calc exp=\"(PA)+(PB*PW)-(PC*PW**2)+(PD*PW**3)-(PE*PW**4)\"\u00a0 PA=0.574 PB=0.1151 PC=0.0485 PD=0.0109 PE=0.000856 PW=2.275<\/code><\/span><\/p>\n<p style=\"text-align: left\">we then apply this value to the data:<\/p>\n<p style=\"text-align: left\"><code>cmult in=ga20070705_38_1_integ_masked_tmb.sdf out=ga20070705_38_1_integ_masked_Cfactor scalar=0.69<\/code><\/p>\n<p style=\"text-align: left\">Again it is good practice to update the units and the data label as we progress.<\/p>\n<p><code>setunits ga20070705_38_1_integ_masked_Cfactor units=\\\"mJy\/beam\\\"<\/code><\/p>\n<p><code>setlabel ga20070705_38_1_integ_masked_Cfactor label=\\\"pseudo Flux Density\\\"<\/code><\/p>\n<p style=\"text-align: justify\">This gets the data into mJy\/beam \/ (K\/km\/s). We will be applying this to the raw SCUBA-2 data so need this in pW, so we divide by the <a href=\"http:\/\/www.eaobservatory.org\/jcmt\/instrumentation\/continuum\/scuba-2\/calibration\/\">standard FCF<\/a> (we chose the beam FCF as we applied the \u03b7<sub>mb<\/sub> to the HARP data). Note the standard beam FCF is given in units of Jy\/pW\/beam (so we multiply by 1000 to get to mJy\/pW\/beam):<\/p>\n<p style=\"text-align: left\"><code>cdiv in=ga20070705_38_1_integ_masked_Cfactor.sdf out=ga20070705_38_1_integ_masked_CfactorpW.sdf scalar=537000.0<br \/>\n<\/code><\/p>\n<p style=\"text-align: left\">Updating the units (keeping the label as pseudo Flux Density):<\/p>\n<p><code>setunits ga20070705_38_1_integ_masked_CfactorpW units=\\\"pW\\\"<\/code><\/p>\n<p style=\"text-align: justify\">We want to subtract this HARP data from the raw SCUBA-2 data. We will do this by inserting this data as a &#8220;fakemap&#8221;. Remember we are considering the CO (3-2) emission as contamination. As a result we invert the data:<\/p>\n<p style=\"text-align: left\"><code>cmult in=ga20070705_38_1_integ_masked_CfactorpW.sdf out=ga20070705_38_1_fakemap.sdf scalar=-1.0<\/code><\/p>\n<p style=\"text-align: left\"><code>setlabel ga20070705_38_1_fakemap label=\\\"inverted pseudo Flux Density\\\"<\/code><\/p>\n<p style=\"text-align: justify\">You now have produced the &#8220;fakemap&#8221; &#8211;\u00a0ga20070705_38_1_fakemap.sdf &#8211;\u00a0 that will be required in step 5 of this process.<\/p>\n<h3>STEP 4: Creating SCUBA-2 850 micron emission reference map<\/h3>\n<p style=\"text-align: center\"><span style=\"color: #ff0000\">If you have run the <strong><a style=\"color: #ff0000\" href=\"http:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-1\/\">SCUBA-2 Data Reduction\/Analysis Tutorial 1<\/a><\/strong> and produced\u00a0s20120501_00068_850_reduced.sdf you may skip this step but please rename the file to become: s20120501_00068_850_reference.sdf<br \/>\n<\/span><\/p>\n<p style=\"text-align: justify\">If you have not done so already download:\u00a0<a href=\"http:\/\/ftp.eao.hawaii.edu\/jcmt\/usersmeetings\/JCMT_SCUBA-2_tutorial1_2016.tar.gz\">Dataset for SCUBA-2 Data Reduction\/Analysis Tutorials 1 \u2013 3<\/a> (Filesize: ~650 MB). Note that when you extract the data from this tarball the SCUBA-2 data will end up in a file named \/tutorial\/raw<\/p>\n<p style=\"text-align: justify\"><code>tar xvzf JCMT_SCUBA-2_tutorial_2016.tar.gz<\/code><\/p>\n<p style=\"text-align: justify\">You are now advised to move to the directory where the other reduced HARP files are located. In this folder set up <em>ORAC-DR<\/em> for <em>SCUBA-2<\/em> data processing, and specify that the reduced files will be written to the current working directory:<\/p>\n<p><code>oracdr_scuba2_850<\/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>In the Bash or zsh shell, type:<\/p>\n<p><code>export ORAC_DATA_IN=.<\/code><\/p>\n<p>Or, in the TC-shell or C-shell, type:<\/p>\n<p><code>setenv ORAC_DATA_IN .<\/code><\/p>\n<p>now create a file <em>scuba2_files.list<\/em> with the absolute file path to the raw data.<\/p>\n<p><code>ls \/absolute\/file\/path\/s8?20120501_00068*.sdf &gt; scuba2_files.list<\/code><\/p>\n<p>It should now be possible to run <em>ORAC-DR<\/em> on the raw SCUBA-2 data by typing the following:<\/p>\n<p><code>oracdr -files scuba2_files.list -nodisplay -log sf<br \/>\n<\/code><\/p>\n<p>which will produce file &#8211; <em>s20120501_00068_850_reduced.sdf<\/em>. Rename that file to be <em>s20120501_00068_850_reference.sdf <\/em>:<\/p>\n<p><code>mv s20120501_00068_850_reduced.sdf s20120501_00068_850_reference.sdf<\/code><\/p>\n<p><code>gaia s20120501_00068_850_reference.sdf<\/code><\/p>\n<div id=\"attachment_6412\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map.png\"><img aria-describedby=\"caption-attachment-6412\" loading=\"lazy\" class=\"wp-image-6412 size-medium\" src=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map-300x298.png\" width=\"300\" height=\"298\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map-300x298.png 300w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map-150x150.png 150w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map-768x762.png 768w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map-1024x1017.png 1024w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map-151x150.png 151w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-reference-map.png 1110w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-6412\" class=\"wp-caption-text\">g34 scuba-2 reference map.<\/p><\/div>\n<h3>STEP 5: Creating SCUBA-2 with HARP CO subtracted from the 850 micron emission<\/h3>\n<p style=\"text-align: justify\">We now wish to re-reduce the SCUBA-2 data using the HARP data as a fakemap. To do this we must ensure the HARP and SCUBA-2 data are aligned. To do this we first need to remove the third axis from the SCUBA-2 data. We can see this third axis if we do an ndftrace:<\/p>\n<p style=\"text-align: justify\"><code>ndftrace s20120501_00068_850_reference.sdf<\/code><\/p>\n<p style=\"text-align: justify\">removing the third axis<\/p>\n<p style=\"text-align: left\"><code>ndfcopy in=\\\"s20120501_00068_850_reference.sdf\\(:,:\\)\\\" out=s20120501_00068_850_reference_clip.sdf<\/code><\/p>\n<p style=\"text-align: justify\">and now we can align the HARP data to the SCUBA-2 data.<\/p>\n<p><code>wcsalign in=ga20070705_38_1_fakemap.sdf out=ga20070705_38_1_fakemap_aligned.sdf ref=s20120501_00068_850_reference_clip.sdf accept<br \/>\n<\/code><\/p>\n<p style=\"text-align: justify\">Next we need to tell ORAC-DR pipeline that we wish to use this HARP data as a fake map. This is a three step process:<\/p>\n<p style=\"text-align: justify\">i) check the reduction recipe used during the original\/reference SCUBA-2 reduction.<\/p>\n<p style=\"text-align: justify\"><code>fitsval\u00a0s20120501_00068_850_reference.sdf RECIPE<\/code><\/p>\n<p style=\"text-align: justify\">In this example we see that the map has been reduced using the REDUCE_SCAN recipe. Classically the REDUCE_SCAN recipe file calls the <em>dimmconfig_jsa_generic.lis <\/em>configuration file. We need to know this as we want to add a parameter to this configuration file.<\/p>\n<p style=\"text-align: justify\">ii) use your favorite editor to make a new configuration file: <em>dimmconfig-contamination.lis<\/em>. We will use this to point to the want this to point to the <em>dimmconfig_jsa_generic.lis <\/em>configuration file and include the newly made fakemap.<\/p>\n<p style=\"color: #000000\"><code>^$STARLINK_DIR\/share\/smurf\/dimmconfig_jsa_generic.lis<br \/>\nfakemap=ga20070705_38_1_fakemap_aligned.sdf<\/code><\/p>\n<p style=\"text-align: justify\">iii) in order for this new dimmconfig file to be picked up during the reduction we will link it to a recipe parameter file. This file will be called <em>myparams.ini <\/em>this will need to contain the following:<\/p>\n<p style=\"color: #000000\"><code>[REDUCE_SCAN]MAKEMAP_CONFIG=dimmconfig-contamination.lis<br \/>\n<\/code><\/p>\n<p style=\"text-align: justify\">and now run the reduction:<\/p>\n<p style=\"text-align: justify\"><code>oracdr -files scuba2_files.list -recpars myparams.ini -nodisplay -log sf<\/code><\/p>\n<p style=\"text-align: justify\">which will produce a file called <em>s20120501_00068_850_reduced.sdf<\/em>. For clarity, rename that file to be <em>s20120501_00068_850_corrected.sdf<\/em>:<\/p>\n<p style=\"text-align: justify\"><code>mv s20120501_00068_850_reduced.sdf s20120501_00068_850_corrected.sdf<\/code><\/p>\n<p>This is now the SCUBA-2 850 micron emission with the CO (3-2) emission removed over a region of the map.<\/p>\n<p><code>gaia s20120501_00068_850_corrected.sdf<\/code><\/p>\n<div id=\"attachment_6414\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map.png\"><img aria-describedby=\"caption-attachment-6414\" loading=\"lazy\" class=\"wp-image-6414 size-medium\" src=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map-300x295.png\" width=\"300\" height=\"295\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map-300x295.png 300w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map-768x756.png 768w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map-1024x1008.png 1024w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map-152x150.png 152w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map-150x148.png 150w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34-scuba2-corrected-map.png 1126w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-6414\" class=\"wp-caption-text\">SCUBA-2 map of g34 with the emission from CO (3-2) as provided by HARP, removed from the raw SCUBA-2 data during the initial step of the reduction process.<\/p><\/div>\n<h3>STEP 6: Comparing SCUBA-2 reductions:<\/h3>\n<p>To create the contamination map we simply want to perform the following calculation:<\/p>\n<p style=\"text-align: center\"><em>(SCUBA-2 map &#8211; HARP CO emission) \/ SCUBA-2 map = the dust fraction<br \/>\n<\/em><\/p>\n<p style=\"text-align: justify\">if HARP contributes 0 to the emission then we obtain a value 1 from the above equation indicating that 100% of the emission originates from continuum emission and not from emission at the CO frequency.<\/p>\n<p>To perform this on the command line we use:<\/p>\n<p><code>div s20120501_00068_850_corrected.sdf s20120501_00068_850_reference.sdf div.sdf<br \/>\n<\/code><\/p>\n<p>again we remove the redundant third axis:<\/p>\n<p><code>ndfcopy in=\\\"div.sdf\\(:,:\\)\\\" out=dust_fraction.sdf<\/code><\/p>\n<p style=\"text-align: justify\">We only want to consider the above map where we know we have associated HARP data. We should also be careful not to include the edges of the HARP map as they may suffer from issues resulting from a step function at the boundary in the reduction.<\/p>\n<p style=\"text-align: justify\">To trim the edges we first inspect the original HARP map size:<\/p>\n<p><code>ndftrace ga20070705_38_1_integ_snr_thresh.sdf<\/code><\/p>\n<p>To trim the edges of the map by five times the SCUBA-2 beam we will need to clip the map edges by 10 pixels*<\/p>\n<p><code>ndfcopy in=\\\"ga20070705_38_1_integ_snr_thresh.sdf\\(-7:8,-6:7\\)\\\" out=ga20070705_38_1_integ_snr_thresh_clipped<\/code><\/p>\n<p>again we ensure the maps are aligned:<\/p>\n<p><code>wcsalign in=ga20070705_38_1_integ_snr_thresh_clipped.sdf out=ga20070705_38_1_integ_snr_thresh_clipped_aligned ref=dust_fraction.sdf accept<\/code><\/p>\n<p>and then extract only the region of interest<\/p>\n<p><code>mult ga20070705_38_1_integ_snr_thresh_clipped_aligned.sdf dust_fraction.sdf out=dust_fraction_cropped.sdf<\/code><\/p>\n<p>and remove excess bad pixels:<\/p>\n<p><code>ndfcopy in=dust_fraction_cropped.sdf out=dust_fraction_clipped.sdf trimbad=true<\/code><\/p>\n<p>It is then recommended to inspect this final map, using the <a href=\"http:\/\/starlink.eao.hawaii.edu\/docs\/sun95.htx\/sun95ss191.html#Q1-218-799\">stats<\/a>, <a href=\"http:\/\/starlink.eao.hawaii.edu\/docs\/sun95.htx\/sun95ss74.html#Q1-101-448\">histat<\/a> and <a href=\"http:\/\/starlink.eao.hawaii.edu\/docs\/sun95.htx\/sun95ss76.html#Q1-103-454\">histogram<\/a> commands. Using<\/p>\n<p><code>gaia dust_fraction_clipped.sdf<\/code><\/p>\n<p>we see the following dust fraction map.<\/p>\n<div id=\"attachment_6404\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34_contamination_percentage_clipped.png\"><img aria-describedby=\"caption-attachment-6404\" loading=\"lazy\" class=\"wp-image-6404 size-medium\" src=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34_contamination_percentage_clipped-300x263.png\" width=\"300\" height=\"263\" srcset=\"https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34_contamination_percentage_clipped-300x263.png 300w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34_contamination_percentage_clipped-768x673.png 768w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34_contamination_percentage_clipped-171x150.png 171w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34_contamination_percentage_clipped-150x131.png 150w, https:\/\/www.eaobservatory.org\/jcmt\/wp-content\/uploads\/sites\/2\/2017\/01\/g34_contamination_percentage_clipped.png 950w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-6404\" class=\"wp-caption-text\">dust fraction map scaled linearly from 0.95 to 1.00.<\/p><\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><em>*This is by no means a comprehensive guide and you should consider your own data\/cuts to data before making decisions on where\/exactly how to inspect the resulting contamination map.<\/em><\/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 (2016A or newer) version of the Starlink software suite (the latest release is available for download here). The user should download the relevant data for this tutorial: Dataset for SCUBA-2 Data Reduction\/Analysis\u2026 <a class=\"continue-reading-link\" href=\"https:\/\/www.eaobservatory.org\/jcmt\/science\/reductionanalysis-tutorials\/scuba-2-dr-tutorial-5\/\">Continue reading<\/a><\/p>\n","protected":false},"author":5,"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\/6231"}],"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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/comments?post=6231"}],"version-history":[{"count":128,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/6231\/revisions"}],"predecessor-version":[{"id":11505,"href":"https:\/\/www.eaobservatory.org\/jcmt\/wp-json\/wp\/v2\/pages\/6231\/revisions\/11505"}],"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=6231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}