Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
FITS_ASCII_ENCODE()
Encode an unsigned longword as an ASCII string to insert in a FITS header
Follows the 23 May 2002 version of the FITS checksum proposal at http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/checksum.html
result = FITS_ASCII_ENCODE( sum32)
sum32 - 32bit *unsigned longword* (e.g. as returned by CHECKSUM32)
A 16 character scalar string suitable for the CHECKSUM keyword
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"
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.
Written W. Landsman SSAI December 2002
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]