SCUBA-2 Data Reduction – Tutorial 3

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 the appropriate setenv equivalent. See Step 4 of SCUBA-2 DR Tutorial 1 for an example of how to do this. Please also remember to run KAPPA and SMURF first.

External Masking

Note: External masking is usually used to help recover/improve large scale structure and decrease the negative bowling in large PONG 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 Daisy observation as used for SCUBA-2 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 PONG map containing complex structure from the JCMT Science Archive and looking at the effect of an external mask using a more powerful desktop computer.

  1. Obtaining the data (if not already done for previous SCUBA-2 tutorials).

    This tutorial uses the same raw data as SCUBA-2 Tutorials 1 and 2, available here. Please download and gunzip/untar this file:

    tar xvfz JCMT_SCUBA-2_tutorial1_2016.tar.gz

  2. Perform a normal reduction of the map.

    The default dimmconfig file dimmconfig_bright_extended.lis will be used for this reduction. This is not actually an ideal dimmconfig for Daisy observations, and would be more suited to a large PONG observation.

    First, make a list of the raw files:

    ls `pwd`/raw/s*.sdf > raw.lis

    Alternatively, just copy the mylist file from SCUBA-2 Tutorial 1 to the current directory as raw.lis and use that.

    The reduction here is performed directly with makemap, although if preferred, this step could be done using ORAC-DR as well.

    makemap in=^raw.lis out=map config=^$STARLINK_DIR/share/smurf/dimmconfig_bright_extended.lis

    Initial mapmaker-generated image map.

    Initial mapmaker-generated image map.

  3. Check the output map by opening it in Gaia. The bright_extended dimmconfig does not produce a very good map. Note that if the file was reduced directly with makemap, the output file will be in units of pW, as it has not yet been calibrated.
  4. 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.
    1. Make a signal-to-noise ratio (snr) map and threshold it such that everything below a 3σ detection is 0 and everything above it is 1:

      makesnr in=map.sdf out=snr.sdf minvar=0
      thresh in=snr.sdf out=threshed.sdf thrlo=3 newlo=0 thrhi=3 newhi=1

    2. 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 BAD and the remaining values to 1:

      gausmooth in=threshed.sdf out=smoothed.sdf fwhm=5.0
      thresh in=smoothed.sdf out=mask.sdf thrlo=0.05 newlo=bad thrhi=0.05 newhi=1

      Mask derived from G34.3+0.2 tutorial data.

      Mask derived from G34.3+0.2 tutorial data.

  5. Re-reduce the raw files with this new mask.
    1. Create a dimmconfig with the necessary parameters to use an external mask:

      echo '^$STARLINK_DIR/share/smurf/dimmconfig_bright_extended.lis' > external.lis
      echo 'ast.zero_mask=1' >> external.lis
      echo 'ast.zero_snr=0' >> external.lis

    2. Now make the map again, this time using the new dimmconfig file and supplying the mask as the ref parameter:

      makemap in=^raw.lis out=map_extmasked config=^external.lis ref=mask.sdf

      Map of G34.3+0.2 tutorial data with external mask applied.

      Map of G34.3+0.2 tutorial data with external mask applied.

      It is now possible to compare the output files map.sdf and map_extmasked.sdf. Unfortunately, a large difference will not be apparent. This process also be tried (on a powerful computer) with large, complex Pong observations for a better example of the effect.


Other JCMT data reduction/analysis tutorials are available here.

Comments are closed.