next up previous
Next: Menu Constraint
Up: Extended Routines
Previous: Arrays of Values between Limits

Parity Constraint  

There are occasions when you need an odd or even integer. For example, the size of a smoothing kernel must be odd. PAR provides two routines with these functions. Thus,

          CALL PAR_GODD( 'BOX', 5, 3, 11, .FALSE., BOXSIZ, STATUS )

obtains an odd integer between 3 and 11 from parameter BOX, and stores it in variable BOXSIZ. The dynamic default is 5. Similarly,

          CALL PAR_GEVEN( 'OFFSET', 2, -2, 10, .FALSE., OFFS, STATUS )
gets a even value in the range -2 to 10 from parameter OFFSET, with a dynamic default of 2. Zero counts as an even number, and so it would be acceptable here.



next up previous
Next: Menu Constraint
Up: Extended Routines
Previous: Arrays of Values between Limits

PAR Interface to the ADAM Parameter System
Starlink User Note 114
Malcolm J. Currie
Alan J. Chipperfield
1999 September 24
E-mail:ussc@star.rl.ac.uk