Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 803
News FAQ
Search Home


next up previous contents
Next: Recipe 2: Add a function to DISH (or Up: Recipes Previous: Recipes

Recipe 1: Reduce an ON/OFF Total Power scan

Goal: To reduce an on/off total power scan pair by extracting the 'on' and the 'off' source scans from an opened data set, constructing a difference scan from them, and inserting the result into the DISH results manager.

Assume: You have a data set named rawdata opened and available in the dish results manager. An 'on' scan is located at the first record in rawdata and an 'off' scan is located at the third record in rawdata.

AIPS++/Glish commands and results   Purpose and Background 

rawdata.setlocation(1)              Move the rawdata pointer so that it 
                                    points at the first record, where the
                                    'on' scan is located.

on:=rawdata.get()                   Get that scan and assign it to a variable
                                    named on. on is a glish record having a 
                                    known structure. For example, the data and
                                    its description (axis type, value, etc.) is
                                    in a subrecord, data, and a subfield of
                                    that, arr, contains the data array.

rawdata.setlocation(3)              Move the pointer to point at the 'off'
                                    scan location.

off:=rawdata.get()                  Get it and assign it to 'off'.

result:=off;			    Set result initially to 'off' so that it
				    is a complete SDRECORD. Now adjust the
				    the data array...

result.data.arr:=(on.data.arr -     Subtract the 'on' data array from the 'off'
       off.data.arr)/off.data.arr   data array and divide the result by the 
                                    'off' data array. Additional operations to 
                                    appropriately scale the data and adjust
                                    relevant header words would be done here.

dish.rm().add('result','Difference  Add this result to the DISH results
       of rows 1 and 3',result,     manager. The final argument tells the
       'SDRECORD')                  results manager that this is an SDRECORD
                                    something the results manager knows how
                                    to display and interact with.


next up previous contents
Next: Recipe 2: Add a function to DISH (or Up: Recipes Previous: Recipes   Contents
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2004-08-28