[daip] [!6263]: aips - SAD: Questions

Robert H Gray do-not-reply at nrao.edu
Mon Mar 23 17:24:17 EDT 2015


Robert H Gray updated #6263
---------------------------

SAD: Questions
--------------

           Ticket ID: 6263
                 URL: https://help.nrao.edu/staff/index.php?/Tickets/Ticket/View/6263
           Full Name: Robert H Gray
               Email: roberthansengray at gmail.com
             Creator: User
          Department: AIPS Data Processing
       Staff (Owner): Eric Greisen
                Type: Issue
              Status: Open
            Priority: Default
                 SLA: NRAO E2E
      Template Group: Default
             Created: 26 February 2015 08:45 PM
             Updated: 23 March 2015 09:24 PM
                 Due: 25 March 2015 12:00 AM (1d 2h 35m)
      Resolution Due: 06 March 2015 08:45 PM 



Hi Eric,

Question about AIPS procs:  Why do I get what seems to be an error message "AIPS 2: IF OR LOOP!" when I have an IF... THEN statement like "if ImageSiz=1024 then ImageBdr=20" which seems well formed?   It is in side a FOR... END loop.  The message goes away if I comment out the IF...THEN, so it seems to be the problem.

I put a half-day into this and can't  get any kind of IF...THEN logic to work, and I've consulted the Cookbook.  Any idea what might be the problem?  I'm pasting my code below, currently with the IF...THEN commented out.  

Thanks for any light you can shed!

Bob Gray  

PROC SETUP
scalar SigmaMin, chan, ch1, ch2, ImageSiz, ImageBdr 
finish
SETUP
*
PROC SRCS( SigmaMin, ch1, ch2, ImageSiz ) 
* Declare variables used in procedure.
* Note: the variable name "channel" is not used, to avoid overwriting 
* the value of the variable with the same name used by IMAGR. 
scalar chan, ch1, ch2, SigmaMin, ImageSiz, ImageBdr
scalar cparm1, cparm2, cparm3, cparm4
* Delete any existing MF tables in image or cube SAD is to process
inext 'MF'; invers -1; extdest; 
for Chan = ch1 to ch2
*
* Bottom left and top right corners of image area
* are set to stay away from edge of edges of image.
* Third dimension is set to specify current channel number.
ImageBdr=10
* for 2048 cube use 40 pixel border
ImageBdr=40 
***** PROBLEM - if IF statments below are uncommented, error messare appears
***** "AIPS 2: IF OR LOOP!" - WHY IS THIS?
*if ImageSiz=1024 then ImageBdr=20
*if ImageSiz=2048 then ImageBdr=40
blc ImageBdr ImageBdr Chan
trc ImageSiz-ImageBdr ImageSiz-ImageBdr Chan
* Get noise in current channel using task IMSTAT
* rms is returned in variable "pixstd"
GO IMSTAT
* Use task SAD to find sources, setting the "cutoff"
* minimum flux value to desired number of sigma.
* "sigma" must be set in command line by user.
task 'SAD'
* 1996: "CUTOFF = pixstd*sigma" had no effect because CUTOFF not AIPS adverb.
* 2015: "cparm= pixstd*sigma  , 0" uses CPARM(1) adverb known to AIPS
*  , sets cparm(2)=0 to show no more levels;.
* 2015b: calculate cparm(n) values starting at 3x, then 2x, then 1x Sigma min;
*        For ch0 images, SigmanMin is maybe 3 sigma, giving CPARM values like 
* 9xRMS6, 6xRMS, and 3xRMS;
*        For cubes, SigmaMin is maybe 6, giving CPARM values like
*  18xRMS6, 12xRMS, and 5xRMS;
*        (cparm(4)=0 indicates no more levels are present);
cparm1 = pixstd * SigmaMin*3
cparm2 = pixstd * SigmaMin*2
cparm3 = pixstd * SigmaMin*1.5
cparm4 = pixstd * SigmaMin
cparm = cparm1, cparm2, cparm3, cparm4, 0
NGAUSS=200
GO SAD
wait sad
end
FINISH
*
* Example for CH0 image 1024 pixels: SRCS(3, 1, 1, 1024 )

------------------------------------------------------
Staff CP:  https://help.nrao.edu/staff



More information about the Daip mailing list