Once you have read WCS information from a dataset, as in 3.4, 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 4.15. For details of how to validate input data read by AST, see 15.6 and 17.4.