next up previous
Next: Interaction with Initialisation Options
Up: BAD PIXELS
Previous: Setting the Bad-Pixel Flag

Interaction with Mapping and Unmapping   

An important process which can introduce bad pixels into an array component is that of accessing the component's values. This can occur for a number of reasons, but most obviously because type conversion may take place implicitly when an array component is mapped and unmapped (see §[*]). This conversion has the potential to fail if the value being converted cannot be represented using the new type. No error will result in such cases, but the affected pixels will be assigned the appropriate bad-pixel value.

In consequence, the effective bad-pixel flag value for an array component may change when that array is accessed by mapping it, and may change again when it is later unmapped. If type conversion errors occur when mapping or unmapping an array component which is being modified or written, then the bad-pixel flag will end up set to .TRUE. due to the resulting bad pixels being written back to the data structure.

What this means in practice is that, on input, the bad-pixel flag value should normally be checked after any mapping operation has been performed. Similarly, if the bad-pixel flag is to be changed using NDF_SBAD following the assignment of new values to an output array, then this should be done before the component is unmapped. See §[*] for an example.



next up previous
Next: Interaction with Initialisation Options
Up: BAD PIXELS
Previous: Setting the Bad-Pixel Flag


Starlink User Note 33
R.F. Warren-Smith
11th January 2000
E-mail:rfws@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils