next up previous 530
Next: IF - The intermediate frequency in a dual sideband spectrum (DSBSpecFrames only)
Up: Frame Attributes
Previous: Equinox - Epoch of the mean equinox (SkyFrames only)


Format(axis) - Format specification for axis values

Description:
This attribute specifies the format to be used when displaying co-ordinate values associated with a particular Frame  axis (i.e. to convert values from binary to character form).

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.

The interpretation of this string depends on whether or not the Frame is a SkyFrame. If it is not, the string is interpreted as a format-specification string to be passed to the C ``printf'' function (e.g. "%1.7G") in order to format a single co-ordinate value (supplied as a double-precision number).

For SkyFrames, the syntax and default value of the Format string is re-defined to allow the formatting of sexagesimal values as appropriate for the particular celestial co-ordinate system being represented. The syntax of SkyFrame Format strings is described (below) in the ``SkyFrame Formats''  section.


Type:
String.

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.

  • "g": This is the same as "l", except that the separator characters are displayed as small superscripts when drawn on a graphical device.

  • "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".

Examples:
wcsattrib my_data set format(1) %10.5G
This sets the Format attribute for Axis 1 in the current co-ordinate Frame in the NDF called my_data, so that axis values are formatted as floating-point values using a minimum field width of ten characters, and displaying five significant figures. An exponent is used if necessary.
wcsattrib ngc5128 set format(2) bdms.2
This sets the Format attribute for Axis 2 in the current co-ordinate Frame in the NDF called ngc5128, so that axis values are formatted as separate degrees, minutes and seconds field, separated by blanks. The seconds field has two decimal places. This assumes the current co-ordinate Frame in the NDF is a celestial co-ordinate Frame (i.e. a SkyFrame).

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




next up previous 530
Next: IF - The intermediate frequency in a dual sideband spectrum (DSBSpecFrames only)
Up: Frame Attributes
Previous: Equinox - Epoch of the mean equinox (SkyFrames only)

KAPPA --- Kernel Application Package
Starlink User Note 95
Malcolm J. Currie & David S. Berry
2013 February 14
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council