next up previous 264
Next: ...Display AST Data
Up: How To...
Previous: ...Read a WCS Calibration from a Dataset

...Validate WCS Information

Once you have read WCS information from a dataset, as in [*], you may wish to check that you have been successful. The following will detect and classify the things that might possibly go wrong:

#include <string.h>

...

if ( !astOK ) {
   <an error occurred (a message will have been issued)>
} else if ( wcsinfo == AST__NULL ) {
   <there was no WCS information present>
} else if ( strcmp( astGetC( wcsinfo, "Class" ), "FrameSet" ) ) {
   <something unexpected was read (i.e. not a FrameSet)>
} else {
   <WCS information was read OK>
}

For more information about detecting errors in AST functions, see [*]. For details of how to validate input data read by AST, see [*] and [*].


next up previous 264
Next: ...Display AST Data
Up: How To...
Previous: ...Read a WCS Calibration from a Dataset

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
7th December 2012
E-mail:starlink@jiscmail.ac.uk

Copyright (C) 2012 Science \& Technology Facilities Council