next up previous 78
Next: Syntax conflicts
Up: Parameters: Controlling commands
Previous: Prompted parameters


Output parameters

Parameters are not only used to pass information to the application, the application may also return information in other parameters. `istat' has a number of output parameters in order that its results can be used in scripts. From ICL, output parameters can be handled quite easily:

   ICL> istat a_file stat_mean=(mean) stat_sigma=(var) accept

   Y-range 1 to 256
   X-range 1 to 256
   Total (over 65536.0 pixels) = 53723.8
   Max   = 0.90785  in pixel (89,47)
   Min   = 0        in pixel (215,35)
   Mean  = 0.81976
   Sigma = 0.065904

   ICL> print (mean)

   0.81976

   ICL> var = var * var
   ICL> print 'variance = ' (var)

   variance =  0.00434334

   ICL> ave = sqrt(var)
   ICL> print (ave)

   0.0659040

   ICL> icdiv a_file (mean) ffield

To achieve anything like that from the Unix shell one needs detailed knowledge of the storage of these output parameters in the Unix file system. The Unix shell does not have floating point arithmetics, but one can at least pass the value from one application to the next:

   % istat a_file accept

   Y-range 1 to 256
   X-range 1 to 256
   Total (over 65536.0 pixels) = 53723.8
   Max   = 0.90785  in pixel (89,47)
   Min   = 0        in pixel (215,35)
   Mean  = 0.81976
   Sigma = 0.065904

   % icdiv a_file @$HOME/adam/GLOBAL.STAT_MEAN ffield

Here it is assumed that the environment variable ADAM_USER does not exist or points to $HOME/adam.



next up previous 78
Next: Syntax conflicts
Up: Parameters: Controlling commands
Previous: Prompted parameters

FIGARO A general data reduction system
Starlink User Note 86
Keith Shortridge, Horst Meyerdierks,
Malcolm Currie, Martin Clayton, Jon Lockley,
Anne Charles, Clive Davenhall,
Mark Taylor, Tim Ash, Tim Wilkins, Dave Axon,
John Palmer, Anthony Holloway and
Vito Graffagnino
2004 February 17
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council