next up previous 405
Next: Testing for a spectral dataset
Up: Obtaining dataset attributes
Previous: Does the dataset have variance/quality/axis/history information?


Testing for bad pixels

Imagine you have an application which could not process bad pixels. You could test whether a dataset might contain bad pixels, and run some pre-processing task to remove them first. This attribute could be inquired via ndftrace. If you need to know whether or not any were actually present, you should run setbad from KAPPA first.

     setbad $file
     ndftrace $file > /dev/null
     set badpix = `parget bad ndftrace`
     if ( badpix == "TRUE" ) then
        <remove the bad pixels>
     else
        goto tidy
     endif
     <perform data processing>

     tidy:
     <tidy any temporary files, windows etc.>
     exit
Here we also introduce the goto command--yes there really is one. It is usually reserved for exiting (goto exit), or, as here, moving to a named label. This lets us skip over some code, and move directly to the closedown tidying operations. Notice the colon terminating the label itself, and that it is absent from the goto command.



next up previous 405
Next: Testing for a spectral dataset
Up: Obtaining dataset attributes
Previous: Does the dataset have variance/quality/axis/history information?

C-shell Cookbook
Starlink Cookbook 4
Malcolm J. Currie
2006 November 26
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council