next up previous 405
Next: Loop a specified number of times
Up: Dealing with Files
Previous: Accessing other objects


Defining NDF sections with variables

If you want to define a subset or superset of a dataset, most Starlink applications recognise NDF sections

appended after the name.

A naïve approach might expect the following to work

     set lbnd = 50
     set ubnd = 120
     linplot $KAPPA_DIR/spectrum"($lbnd:$ubnd)"
     display $KAPPA_DIR/comwest"($lbnd:$ubnd",$lbnd~$ubnd)"
however, they generate the  Bad : modifier in $ ($).  error. That's because it is stupidly looking for a filename modifier :$.

Instead here are some recipes that work.

     set lbnd = 50
     set ubnd = 120
     set lrange = "101:150"

     linplot $KAPPA_DIR/spectrum"($lbnd":"$ubnd)"
     stats abc"(-20:99,~$ubnd)"
     display $KAPPA_DIR/comwest"($lbnd":"$ubnd",$lbnd":"$ubnd")"
     histogram hale-bopp.fit'('$lbnd':'$ubnd','$lbnd':'$ubnd')'
     ndfcopy $file1.imh"("$lbnd":"$ubnd","$lrange")" $work"1"
     splot hd102456'('$ubnd~60')'
An easy-to-remember formula is to enclose the parentheses and colons in quotes.



next up previous 405
Next: Loop a specified number of times
Up: Dealing with Files
Previous: Accessing other objects

C-shell Cookbook
Starlink Cookbook 4
Malcolm J. Currie
2006 November 26
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council