next up previous contents
Next: About this document ...
Up: IRAS90 IRAS Survey and PO Data Analysis Package Reference Guide
Previous: Converting IRAS Data in BDF Format to NDF Format

An Example of a Colour Temperature Procedure

 This appendix describes an ICL procedure called MASTER which is distributed with the VMS version of IRAS90. It performs an entire reduction process, starting from two groups of ``raw'' CRDD files (covering the same region of the sky but at different wavelengths), and produces surface brightness, colour temperature and optical depth maps. The procedure was optimised for a particular field and may well not be ideally suited to other types of field. It should be use as the basis for further experimentation and customisation. The source for the procedure is in the file IRAS90_DIR:MASTER.ICL (VMS only). To run the procedure as it stands, the following commands should be used:

     $ ADAM
     ICL> IRAS90
     ICL> KAPPA
     ICL> LOAD IRAS90_DIR:MASTER
     ICL> MASTER ^HCON2_B1.LIS ^HCON2_B2.LIS M51_TEMP M51_TAU

This assumes that the text files HCON2_B1.LIS and HCON2_B2.LIS contain lists of the raw CRDD files to be used. The temperature and optical depth images are put in M51_TEMP.SDF and M51_TAU.SDF. Other files are created by MASTER as described in the procedure prologue.

The production of a colour temperature map involves dividing one of the surface brightness images by the other. This process tends to amplify any residual stripes present in the two surface brightness images, especially in background regions. For this reason, MASTER pays particular attention to achieving good destriping.

PROC MASTER INA INB TEMP TAU
{+
{  Name:
{     MASTER
{
{  Purpose:
{     Create colour temperature and optical depth maps from two sets 
{     of raw CRDD files.
{
{  Type of Module:
{     ICL command procedure.
{
{  Invocation:
{     MASTER INA INB TEMP TAU
{
{  Description:
{     This procedure is an example of the way IRAS90 can be used to 
{     create surface brightness maps and colour temperature maps. 
{     It is intended to form a basis for users own experimentation, 
{     and is not intended to be a fool proof, all-singing, all-dancing
{     tool.
{
{     Particular attention is paid to achieving low stripes in the
{     surface brightness maps. The resolution of the surface 
{     brightness maps are matched by simulating data from each of the
{     two original maps using the detector PSFs of the other band. The
{     resulting simulated data is then mapped again. Background 
{     subtraction is performed by BACKCRDD, resulting in the image 
{     having a global background of (roughly) zero.
{
{  Parameters:
{     INA = LITERAL (Read)
{        A group expression giving the raw CRDD files from the first 
{        band.
{     INB = LITERAL (Read)
{        A group expression giving the raw CRDD files from the second
{        band.
{     TEMP = NDF (Write)
{        The output NDF which is to receive the colour temperature
{        map.
{     TAU = NDF (Write)
{        The output NDF which is to receive the optical depth map.
{
{  Notes:
{     -  In addition to the above parameters which must be supplied 
{     on the command line, the user is prompted for:
{
{        1)  Dimensions of the mapped area. If one value is given a
{        square area is assumed.
{
{        2)  Dimensions of a map pixel. If one value is given the
{        pixels are assumed to be square.
{
{        3) The emmisivity spectral index (see COLTEMP parameter 
{        BETA).
{
{        4) The optical depth wavelength (see COLTEMP parameter 
{        WAVEL).
{
{     -  The following intermediate files are left on disk after the 
{     procedure has completed (where * represents the group of input 
{     CRDD files):
{
{        1) *_DS.SDF - The final destriped CRDD files.
{
{        2) *_BK.SDF - The final background subtracted CRDD files.
{
{        3) MAPA.SDF - The surface brightness image formed from the
{           CRDD files specified by parameter INA.
{
{        4) MAPA.SDF - The surface brightness image formed from the
{           CRDD files specified by parameter INB.
{
{        5) MAPA_SM.SDF - MAPA smoothed to a common resolution.
{
{        6) MAPB_SM.SDF - MAPB smoothed to a common resolution.
{
{        7) MAPA_SMT.SDF - MAPA_SM thresholded to remove values close 
{           to zero.
{        
{        8) MAPB_SMT.SDF - MAPB_SM thresholded to remove values close 
{           to zero.
{
{  Authors:
{     D.S. Berry (STARLINK)
{     {enter_new_authors_here}
{
{  History:
{     23-JUN-1993 (DSB):
{        Original version.
{     {enter_changes_here}
{
{  Bugs:
{     {note_any_bugs_here}
{
{-
{
{  Get all required information.
{
INPUT  "Dimensions of map (arc-mins): " (BSIZ)
INPUTR "Pixel size in arcminutes: " (PIXSIZ)
INPUTR "Emmisivity spectral index: " (BETA) 
INPUTI "Wavelength at which optical depth is required (microns): " ~
       (WAVEL)
PRINT 
{
{  An initial map is made using the standard destriping and background
{  removal technique. Samples excluded from the estimation of detector
{  offsets by DESTCRDD are also excluded from the scan background
{  estimates. This is done by flagging such samples with the quality
{  MASTER_SOURCE. Note, a list of the background subtracted CRDD
{  files is kept in file BK.LIS.
{
PRINT "  Making initial map from " (INA)
DESTCRDD IN=(INA) OUT=*_DS QNAME=MASTER_SOURCE BACKSIGMA=(SIGMA)
BACKCRDD OUT=*|_DS|_BK| QEXP=.NOT.MASTER_SOURCE ACCEPT
DCL COPY SYS$LOGIN:IRAS90_NDFS.LIS []BK.LIS
MAPCRDD OUT=MASTER_MAP1 PIXSIZE=(PIXSIZ) BOXSIZE=(BSIZ) ACCEPT
{
{  Save MAPCRDD parameters which define the map centre. These values
{  will be used for all other maps in order to ensure that they are 
{  aligned.
{
GETPAR MAPCRDD CENTRE_LON (LON)
GETPAR MAPCRDD CENTRE_LAT (LAT)
{
{  Create an image in which source regions hold bad values. This is 
{  done by thresholding the initial map created above. All pixels with
{  values outide the range -5*SIGMA to +5*SIGMA are set bad, where 
{  SIGMA is the spread in background values found by DESTCRDD. Note, 
{  THRESH does not currently use NDF origins (in effect the origin is
{  assumed to be at [1,1]) and so the origin of the thresholded image
{  must be set back to its correct value by using SETORIGIN. When 
{  THRESH is upgraded to use the ful facilities of the NDF structure, 
{  the following section can be simplified. 
{
PRINT "  Identifing source regions"
THRESH OUTPIC=MASTER_MAP2 THRLO=(-5*SIGMA) THRHI=(5*SIGMA) NEWLO=BAD ~
       NEWHI=BAD ACCEPT
SETORIGIN LIKE=MASTER_MAP1 ACCEPT
{
{  Generate simulated CRDD from the background map. Source samples
{  will be bad in these CRDD files. 
{
SIMCRDD IN=(INA) SKY=MASTER_MAP2 OUT=MM_*_SIM
{
{  Asssign quality MASTER_SOURCE to samples in the background 
{  subtracted CRDD files which corrrespond to bad samples in the 
{  simulated CRDD. 
{
SETQUAL NDF=^BK.LIS QNAME=MASTER_SOURCE MASK=^SYS$LOGIN:IRAS90_NDFS.LIS
{
{  Now CRDD files with better destriping, by omiting source samples
{  from the destriping and background estimation. Note, the cleaning 
{  algorithms used by DESTCRDD and BACKCRDD are switched off to avoid
{  backcrdd samples being rejected. A linear background is fitted to
{  each CRDD file.
{
PRINT "  Repeating the destriping and background removal on " (INA)
DESTCRDD IN=^BK.LIS OUT=*|_BK|_DS| QEXP=.NOT.MASTER_SOURCE BOX=0 ~
         BACKSIGMA=(SIGA)
BACKCRDD TYPE=LINEAR CLIP=1E6 OUT=*|_DS|_BK| QEXP=.NOT.MASTER_SOURCE ~
         ACCEPT
{
{  Now do it again, using the new _BK CRDD files as input.
{
DESTCRDD IN=^BK.LIS OUT=*|_BK|_DS| QEXP=.NOT.MASTER_SOURCE BOX=0 ~
         BACKSIGMA=(SIGA)
BACKCRDD TYPE=LINEAR CLIP=1E6 OUT=*|_DS|_BK| QEXP=.NOT.MASTER_SOURCE ~
         ACCEPT
{
{  Now create a map.
{
MAPCRDD OUT=MAPA PIXSIZE=(PIXSIZ) CENTRE_LON=(LON) CENTRE_LAT=(LAT) ~
        BOXSIZE=(BSIZ) ACCEPT
{
{  Now do just the same for band B.
{
PRINT "  Making initial map from " (INB)
DESTCRDD IN=(INB) OUT=*_DS QNAME=MASTER_SOURCE BACKSIGMA=(SIGMA)
BACKCRDD OUT=*|_DS|_BK| QEXP=.NOT.MASTER_SOURCE ACCEPT
DCL COPY SYS$LOGIN:IRAS90_NDFS.LIS []BK.LIS
MAPCRDD OUT=MASTER_MAP1 CENTRE_LON=(LON) CENTRE_LAT=(LAT) ~
        PIXSIZE=(PIXSIZ) BOXSIZE=(BSIZ) ACCEPT
PRINT "  Identifing source regions"
THRESH OUTPIC=MASTER_MAP2 THRLO=(-5*SIGMA) THRHI=(5*SIGMA) NEWLO=BAD ~
       NEWHI=BAD ACCEPT
SETORIGIN LIKE=MASTER_MAP1 ACCEPT
SIMCRDD IN=(INB) SKY=MASTER_MAP2 OUT=MM_*_SIM
SETQUAL NDF=^BK.LIS QNAME=MASTER_SOURCE MASK=^SYS$LOGIN:IRAS90_NDFS.LIS
PRINT "  Repeating the destriping and background removal on " (INB)
DESTCRDD IN=^BK.LIS OUT=*|_BK|_DS| QEXP=.NOT.MASTER_SOURCE BOX=0 ~
         BACKSIGMA=(SIGB)
BACKCRDD TYPE=LINEAR CLIP=1E6 OUT=*|_DS|_BK| QEXP=.NOT.MASTER_SOURCE ~
         ACCEPT
DESTCRDD IN=^BK.LIS OUT=*|_BK|_DS| QEXP=.NOT.MASTER_SOURCE BOX=0 ~
         BACKSIGMA=(SIGB)
BACKCRDD TYPE=LINEAR CLIP=1E6 OUT=*|_DS|_BK| QEXP=.NOT.MASTER_SOURCE ~
         ACCEPT
MAPCRDD OUT=MAPB PIXSIZE=(PIXSIZ) CENTRE_LON=(LON) CENTRE_LAT=(LAT) ~
        BOXSIZE=(BSIZ) ACCEPT
{
{  Now smooth the band A map using the satellite response for band B.
{ 
PRINT "  Smoothing first map"
SIMCRDD SKY=MAPA IN=(INB) OUT=MM_*_SIM
MAPCRDD PIXSIZE=(PIXSIZ) OUT=MAPA_SM CENTRE_LON=(LON) CENTRE_LAT=(LAT) ~
        BOXSIZE=(BSIZ) ACCEPT
SETIMAGE NDF=MAPA_SM LIKE=MAPA ACCEPT
{
{  Now smooth the band B map using the satellite response for band A.
{ 
PRINT "  Smoothing second map"
SIMCRDD SKY=MAPB IN=(INA) OUT=*_SIM
MAPCRDD PIXSIZE=(PIXSIZ) OUT=MAPB_SM CENTRE_LON=(LON) CENTRE_LAT=(LAT) ~
        BOXSIZE=(BSIZ) ACCEPT
SETIMAGE NDF=MAPB_SM LIKE=MAPB ACCEPT
{
{  Now threshold the two images to remove values close to zero (such
{  values can cause very large temperatures).
{
PRINT "  Thresholding the smoothed images"
THRESH INPIC=MAPA_SM OUTPIC=MAPA_SMT THRLO=(3*SIGA) THRHI=1E12 ~
       NEWLO=BAD NEWHI=BAD 
SETORIGIN LIKE=MAPA_SM ACCEPT
THRESH INPIC=MAPB_SM OUTPIC=MAPB_SMT THRLO=(3*SIGB) THRHI=1E12 ~
       NEWLO=BAD NEWHI=BAD
SETORIGIN LIKE=MAPB_SM ACCEPT
{
{  Now produce the colour termperature and optical depth maps
{
PRINT "  Creating colour temperature and optical depth images"
COLTEMP IN1=MAPA_SMT IN2=MAPB_SMT BETA=(BETA) TEMP=(TEMP) TAU=(TAU) ~
        WAVEL=(WAVEL)
{
{  Tidy up.
{
DCL DELETE MASTER_MAP%.SDF;*,MM_*_SIM.SDF;*,BK.LIS;*
DCL PURGE *_DS.SDF,*_BK.SDF
{
ENDPROC



next up previous contents
Next: About this document ...
Up: IRAS90 IRAS Survey and PO Data Analysis Package Reference Guide
Previous: Converting IRAS Data in BDF Format to NDF Format

IRAS90 --- IRAS Survey and PO Data Analysis Package --- Reference Guide
Starlink User Note 163
David S. Berry, W Gong, D C Parsons
19 February 1995
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council