Next: Mixing Objects with other Text
Up: Saving and Restoring Objects (Channels)
Previous: Controlling Commenting
The safest advice about editing the textual output from AST_WRITE (or
AST_SHOW) is ``don't!''--unless you know what you are doing.
Having given that warning, however, it is sometimes possible to make
changes to the text, or even to write entire Object descriptions from
scratch, and to read the results back in to construct new
Objects. Normally, simple changes to numerical values are safest, but
be aware that this is a back door method of creating Objects, so
you are on your own! There are a number of potential pitfalls. In
particular:
- AST_READ is intended for retrieving data written by AST_WRITE
and not for reading data input by humans. As such, the data validation
provided is very limited and is certainly not foolproof. This makes it
quite easy to construct Objects that are internally inconsistent by
this means. In contrast, the normal programming interface incorporates
numerous checks designed to make it impossible to construct invalid
Objects. You should not necessarily think you have found a bug if your
changes to an Object's textual description fail to produce the results
you expected!
- In many instances the names associated with values in textual
output will correspond with Object attributes. Sometimes, however,
these names may differ from the attribute name. This is mainly because
of length restrictions imposed by other common external formats, such
as FITS headers. Some of the names used do not correspond with
attributes at all.
- It is safest to change single numerical or string values.
Beware of changing the size or shape of Objects (e.g. the
number of axes in a Frame). Often, these values must match others
stored elsewhere within the Object and changing them in a haphazard
fashion will not produce useful results.
- Be wary about un-commenting default values. Sometimes this will
work, but often these values are derived from other Objects stored
more deeply in the structure and the proper place to insert a new
value is not where the default itself appears.
Next: Mixing Objects with other Text
Up: Saving and Restoring Objects (Channels)
Previous: Controlling Commenting
AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk
Copyright (C) 2003 Central Laboratory of the Research Councils