next up previous
Next: Full - Set level of output detail
Up: AST Attribute Descriptions
Previous: Font(element) - Character font for a Plot element

Format(axis) - Format specification for axis values   

Description:
This attribute specifies the format to be used when displaying coordinate values associated with a particular Frame axis (i.e. to convert values from binary to character form). It is interpreted by the astFormat function and determines the formatting which it applies.

If no Format value is set for a Frame axis, a default value is supplied instead. This is based on the value of the Digits, or Digits(axis), attribute and is chosen so that it displays the requested number of digits of precision.

Type:
String.

Class Applicability:
Frame
The Frame class interprets this attribute as a format specification string to be passed to the C "printf" function (e.g. "%1.7G") in order to format a single coordinate value (supplied as a double precision number).

When supplying a value for this attribute, beware that the "%" character may be interpreted directly as a format specification by some printf-like functions (such as astSet). You may need to double it (i.e. use "%%") to avoid this.

SkyFrame
The SkyFrame class re-defines the syntax and default value of the Format string to allow the formatting of sexagesimal values as appropriate for the particular celestial coordinate system being represented. The syntax of SkyFrame Format strings is described (below) in the "SkyFrame Formats" section.
FrameSet
The Format attribute of a FrameSet axis is the same as that of its current Frame (as specified by the Current attribute). Note that the syntax of the Format string is also determined by the current Frame.

Notes:
  • When specifying this attribute by name, it should be subscripted with the number of the Frame axis to which it applies.

SkyFrame Formats
The Format string supplied for a SkyFrame should contain zero or more of the following characters. These may occur in any order, but the following is recommended for clarity:

  • "+": Indicates that a plus sign should be prefixed to positive values. By default, no plus sign is used.
  • "z": Indicates that leading zeros should be prefixed to the value so that the first field is of constant width, as would be required in a fixed-width table (leading zeros are always prefixed to any fields that follow). By default, no leading zeros are added.
  • "i": Use the standard ISO field separator (a colon) between fields. This is the default behaviour.
  • "b": Use a blank to separate fields.
  • "l": Use a letter ("h"/"d", "m" or "s" as appropriate) to separate fields.
  • "d": Include a degrees field. Expressing the angle purely in degrees is also the default if none of "h", "m", "s" or "t" are given.
  • "h": Express the angle as a time and include an hours field (where 24 hours correspond to 360 degrees). Expressing the angle purely in hours is also the default if "t" is given without either "m" or "s".
  • "m": Include a minutes field. By default this is not included.
  • "s": Include a seconds field. By default this is not included. This request is ignored if "d" or "h" is given, unless a minutes field is also included.
  • "t": Express the angle as a time (where 24 hours correspond to 360 degrees). This option is ignored if either "d" or "h" is given and is intended for use where the value is to be expressed purely in minutes and/or seconds of time (with no hours field). If "t" is given without "d", "h", "m" or "s" being present, then it is equivalent to "h".
  • ".": Indicates that decimal places are to be given for the final field in the formatted string (whichever field this is). The "." should be followed immediately by an unsigned integer which gives the number of decimal places required. By default, no decimal places are given.

All of the above format specifiers are case-insensitive. If several characters make conflicting requests (e.g. if both "i" and "b" appear), then the character occurring last takes precedence, except that "d" and "h" always override "t".



next up previous
Next: Full - Set level of output detail
Up: AST Attribute Descriptions
Previous: Font(element) - Character font for a Plot element

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
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