next up previous 264
Next: Storing an ID String with an Object
Up: Saving and Restoring Objects (Channels)
Previous: Saving and Restoring Multiple Objects


Validating Input

The pointer returned by AST_READ ([*]) could identify any class of Object--this is determined entirely by the external data being read. If it is necessary to test for a particular class (say a Frame), this may be done as follows using the appropriate member of the AST_ISA$<$CLASS$>$ family of functions:

      LOGICAL OK

      ...

      OK = AST_ISAFRAME( OBJECT, STATUS )

Note, however, that this will accept any Frame, so would be equally happy with a basic Frame or a SkyFrame. An alternative validation strategy would be to obtain the value of the Object's Class attribute and then test this character string, as follows:

      OK = AST_GETC( OBJECT, 'Class', STATUS ) .EQ. 'Frame'

This would only accept a basic Frame and would reject a SkyFrame.


next up previous 264
Next: Storing an ID String with an Object
Up: Saving and Restoring Objects (Channels)
Previous: Saving and Restoring Multiple Objects

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
24th May 2011
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2009 Science \& Technology Facilities Council