[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


FITS_ASCII_ENCODE() Source code in fits_ascii_encode.pro

FITS_ASCII_ENCODE()

Name
    FITS_ASCII_ENCODE()
Purpose
    Encode an unsigned longword as an ASCII string to insert in a FITS header
Explanation
     Follows the 23 May 2002 version of the FITS checksum proposal at
     http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
Calling Sequence
     result = FITS_ASCII_ENCODE( sum32)
Input Parameters
     sum32 - 32bit *unsigned longword* (e.g. as returned by CHECKSUM32)
Returns
     A 16 character scalar string suitable for the CHECKSUM keyword
Example
      A FITS header/data unit has a checksum of 868229149.  Encode the
      complement of this value (3426738146) into an ASCII string
      IDL> print,FITS_ASCII_ENCODE(3426738146U)
           ===> "hcHjjc9ghcEghc9g"
Procedure
      The 32bit value is interpreted as a sequence of 4 unsigned 8 bit
      integers, and divided by 4.    Add an offset of 48b (ASCII '0').
      Remove non-alphanumeric ASCII characters (byte values 58-64 and 91-96)
      by simultaneously incrementing and decrementing the values in pairs.
      Cyclicly shift the string one place to the right.
Revision History
     Written  W. Landsman  SSAI              December 2002

Last modified by pro2html on 2002 December 24 at 05:13 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically