yorick banner

Home

Manual

Packages

Global Index

Keywords

Quick Reference

functions in fits.i - f

 
 
 
fits


             fits - an introduction to Yorick interface to FITS files.  
 
     The  routines  provided by  this  (standalone)  package  are aimed  at  
     reading/writing  FITS (Flexible Image Transport  System) files from/to  
     Yorick.  These  routines attempt to follow the  FITS standard (version  
     1.1)  as defined in  NOST report  [1].  Nevertheless  the user  may be  
     aware of some  limitations (some of which are  unavoidable with such a  
     "flexible" format as FITS):  
      - It  is still possible to  produce a non-standard  FITS file because  
        (for obvious  efficiency reasons)  routines in this  package cannot  
        check  everything.  At  least, FITS  routines check  that compliant  
        FITS keywords  are used and that  mandatory cards (SIMPLE/XTENSION,  
        BITPIX,  NAXIS, ...)   get written  in the  correct order  and with  
        correct value types (see  fits_set).  Nevertheless, the user has to  
        know only  very little  about FITS standard  to be able  to produce  
        valid FITS files.  
      - In this version  of the package, headers of  any FITS extension can  
        be read/produced but  you can only read/write Yorick  array data or  
        binary tables, i.e.  corresponding to primary data and FITS "IMAGE"  
        or  "BINTABLE" extensions  (see  fits_read_array, fits_write_array,  
        fits_read_bintable, and fits_write_bintable).  Support for standard  
        extensions (such  as ASCII  table "TABLE") is  planned but  not yet  
        done.  
      - There  is   no  special   handling  of  IEEE  special  values  NaN,  
        +/-Infinity (using such values is  likely to raise a floating point  
        error catched by Yorick).  
      - You  cannot read/write  compressed  FITS  files.   You'll  have  to  
        pre-decompress or post-compress files  (you can use Yorick "system"  
        function to that end).  
      - It is (not yet) possible to re-open an existing FITS file to modify  
        it.  But it would be very easy to allow for appending extensions to  
        an existing file (should be provided very soon).  
     Some simple driver routines  are provided to allow for reading/writing  
     Yorick arrays from/to FITS file  and may be sufficient for basic usage  
     (see fits_read and fits_write).  
   READING AN EXISTING FITS FILE  
     There is a simplified driver fits_read  (which see) to read data in an  
     existing FITS file.  The following example demontrates how to read the  
     contents of a FITS file with the basic routines:  
     fh = fits_open(name);                 // open existing file and read  
                                           // header of 1st (primary) HDU  
     data1 = fits_read_array(fh);          // read all "image" data in 1st HDU  
     slice = fits_read_array(fh, which=n); // read N-th data slice in current  
                                           // HDU  
     fits_next_hdu, fh;                    // move to next HDU and read header  
     data2 = fits_read_array(fh);          // read data of secondary HDU  
     ...;  
   CREATING A NEW FITS FILE:  
     There is a (very) simplified driver fits_write (which see) to create a  
     new  FITS  file  to  store  a Yorick  array.   The  following  example  
     demontrates how to write a moderately complex FITS file with the basic  
     routines:  
     fh = fits_open(name, 'w');      // create new file  
     fits_set, fh, "SIMPLE", 'T',    "true FITS file";  
     fits_set, fh, "BITPIX", bitpix, "bits per pixel";  
     fits_set, fh, "NAXIS",  naxis,  "number of dimensions";  
     fits_set, fh, "NAXIS1", dim1,   "length of 1st dimension";  
     fits_set, fh, "NAXIS2", dim2,   "length of 2nd dimension";  
     fits_set, fh, ...               // set any number of other cards with  
     ...                             // several calls to fits_set  
     fits_write_header, fh;          // write header part of current HDU  
     fits_write_array, fh, data1;    // write data part of current HDU  
     fits_new_hdu, fh, "image";        // append new extension named "image"  
     fits_set, fh, "BITPIX", bitpix, "bits per pixel";  
     fits_set_dims, fh, dimsof(data2); // set all dimensions in one call  
     fits_set, fh, ...                 // set any number of other cards with  
     ...  
     fits_write_header, fh;            // write header part of extension  
     fits_write_array, fh, data2;      // write data part of extension  
     fits_close, fh;                   // close stream of FITS handle, the  
                                       // header can still be examined  
   LIST OF ROUTINES  
     By convention, in this Yorick package, all public symbols (routines or  
     variables)  are prefixed  with  "fits_" and  all  private symbols  are  
     prefixed with "_fits_".  The following (public) routines are provided:  
     File routines:  
       fits_check_file     - check whether a file may be a FITS file  
       fits_open           - open existing FITS file or create new FITS file  
       fits_close          - close file stream in FITS handle  
       fits_create         - creates a new FITS file with minimal header  
       fits_filename       - get full path name of FITS stream  
     Header/HDU routines:  
       fits_current_hdu    - returns number of current HDU  
       fits_goto_hdu       - go to a given HDA number  
       fits_list           - get list of extensions in a FITS file  
       fits_next_hdu       - move to next HDU and parse the header part  
       fits_rewind         - goto first (primary) HDU  
       fits_new_hdu        - start a new FITS extension  
       fits_read_header    - read header part of current HDU  
       fits_write_header   - write header part of current HDU  
     Card routines:  
       fits_delete         - delete card(s) from header of current HDU  
       fits_get            - get value of FITS card(s) in current HDU  
       fits_get_bitpix     - get BITPIX value  
       fits_get_bscale     - get BSCALE value  
       fits_get_bzero      - get BZERO value  
       fits_get_cards      - get all cards matching a pattern  
       fits_get_comment    - get value(s) of COMMENT card(s)  
       fits_get_coordinate - get coordinate information for a given axis  
       fits_get_data_size  - get size of data part in current HDU.  
       fits_get_dims       - get dimension list of array data  
       fits_get_gcount     - get GCOUNT value  
       fits_get_history    - get value(s) of HISTORY card(s)  
       fits_get_keywords   - get list of defined keywords  
       fits_get_naxis      - get NAXIS value  
       fits_get_pcount     - get PCOUNT value  
       fits_get_xtension   - get name of FITS primary/extension HDU  
       fits_move_card      - move FITS card  
       fits_parse          - parse FITS card(s)  
       fits_set            - set value of FITS card(s) in current HDU  
       fits_set_dims       - set FITS card(s) for dimension list of array  
     Reading/writing data (also see binary table routines):  
       fits_read           - simple driver to read "IMAGE" or "BINTABLE" data  
       fits_write          - simple driver to write "IMAGE" data  
       fits_new_image      - creates a new "IMAGE" HDU  
       fits_read_array     - read array data from current HDU  
       fits_write_array    - write array data in current HDU  
     Binary tables:  
       fits_new_bintable   - creates a new "BINTABLE" HDU  
       fits_read_bintable  - read binary table from current HDU  
       fits_write_bintable - write binary table in current HDU  
     Expert users routines:  
       fits_get_special    - get FITS value of mandatory FITS key  
       fits_init           - (re)initialize FITS internals  
       fits_id             - get numerical identifier of a single card  
       fits_ids            - get numerical identifier of FITS card(s)  
       fits_key            - converts numerical identifier into string  
       fits_match          - find FITS card(s) which match a pattern  
       fits_rehash         - recalculate the numerical identifiers of cards  
     Miscellaneous routines:  
       fits_bitpix_info    - get description of FITS bits-per-pixel value  
       fits_bitpix_of      - compute FITS bits-per-pixel value  
       fits_bitpix_type    - convert FITS bits-per-pixel value to data type  
       fits_check_bitpix   - test if FITS bits-per-pixel value is valid  
       fits_date           - get current time as standard FITS date string  
       fits_is_integer     - checks whether argument is integer  
       fits_is_integer_scalar - checks whether argument is integer scalar  
       fits_is_real_scalar - checks whether argument is real scalar  
       fits_is_scalar      - checks whether argument is scalar or not  
       fits_is_string_scalar - checks whether argument is scalar string or not  
       fits_map            - map scalar function onto array argument  
       fits_move           - move element of an array in-place  
       fits_nth            - format a string in the form: "1st", "2nd", ...  
       fits_tolower        - convert string(s) to lower case letters  
       fits_toupper        - convert string(s) to upper case letters  
       fits_trim           - removes trailing spaces  
   CHANGES WITH RESPECT TO "OLD" FITS PACKAGES  
     This  package is  intended to  be used  in place  of the  old "fits.i"  
     (written by me  and distributed along with Yorick)  which had too many  
     limitations and restrictions to allow for further extensions.  However  
     the API provided by this novel package is quite different from the old  
     one (in particular  the FITS header is no longer  stored into a Yorick  
     structure but in some "opaque"  object: a FITS handle).  Hopefully the  
     new package provides all the  routines needed to deal with this opaque  
     handle but  the name of the  routines (all prefixed  with "fits_") and  
     their calling sequences have changed.  
     The new FITS interface was written with the aim of being:  
       (1) conformable with FITS standards (although try to be not too strict  
           when _reading_ files)  
       (2) flexible and extensible  
       (3) fast (e.g. fits_get takes ~ 150 microseconds for a FITS header  
           with 200 cards on an PIII @ 1GHz)  
   FITS HANDLE  
     In this package, a FITS handle  (denoted FH in the documentation) to a  
     FITS file  is intended to  be an "opaque"  object.  Actually, it  is a  
     list of 4 items organized as follow:  
        _lst(cards, ids, descr, stream)  
        cards  = vector of strings which are the header cards of the  
                 current HDU;  
        ids    = vector of card identifier values (this is for fast search  
                 of cards);  
        descr  = descriptor, vector of long integers:  
                   DESCR(1)= current HDU number (1 for primary HDU);  
                   DESCR(2)= file address of the current HDU  
                   DESCR(3)= file address of the data part for the current HDU  
                   DESCR(4)= file address of the next HDU  
                   DESCR(5)= file mode: 'r' or 'w' or 'a'  
        stream = void (no associated file) or stream for input or output;  
     Of course the  end-user should never directly access  the items of the  
     FITS handle  but rather  use the provided  FITS routines (so  that, in  
     order  to  warant portability  of  the user  level  code,  it will  be  
     sufficient  to  only modify  routines  in  this  package whenever  the  
     internals of the FITS handle change).  
   WISH LIST  
     The following is a list of missing features or things I would like to  
     test:  
       1. Implement  support  for  "random groups"  records  (FITS keywords  
          GROUPS, PCOUNT  and GCOUNT) and other  "standard" FITS extensions  
          (only "IMAGE" and "BINTABLE" are implemented): ASCII table, ...  
       2. Extensively test the package (this is mainly because I lack  
          of sample FITS files written by other software).  
       3. Deal with compressed FITS files; this will be possible thanks to  
          the "channel" interface in Yeti (my own extension of Yorick).  
       4. Enhance  the consistency  checks  (for instance,  in the  current  
          version, you can read/write an "image" into a "table" extension).  
   GLOSSARY  
     HDU - Header and Data Unit  
     Indexed Keyword -  
   REFERENCES  
     [1] "Definition of Flexible Image Transport System (FITS)", NASA/Science  
         Office of Standards and Technology, report NOST 100-1.1, September 29,  
         1995.  
     [2] "A User's Guide for the Flexible Image Transport System (FITS)"  
         http://archive.stsci.edu/fits/users_guide/  
keyword,  defined at i/fits.i   line 35  
 
 
 
fitsAddComment


 fitsAddComment  
 
SEE fitsHeader  
 
 
 
fitsAddComment


 fitsAddComment  
 
SEE fitsHeader  
 
 
 
fitsAddHistory


 fitsAddHistory  
 
SEE fitsHeader  
 
 
 
fitsAddHistory


 fitsAddHistory  
 
SEE fitsHeader  
 
 
 
fitsFixHeader


 fitsFixHeader  
 
SEE fitsHeader  
 
 
 
fitsFixHeader


 fitsFixHeader  
 
SEE fitsHeader  
 
 
 
fitsHeader


 fitsHeader  
 
  
 
 
 
fitsHeader


             obsolete FITS routines  
 
     In order to help you to upgrade your code and use the new FITS API,  
     you can use the following equivalence table:  
       fitsAddComment, hdr, str;    ==>  fits_set, fh, "COMMENT", str;  
       fitsAddHistory, hdr, str;    ==>  fits_set, fh, "HISTORY", str;  
       fitsWrite, name, data;       ==>  fits_write, name, data;  
       fitsWrite, name, data, hdr;  ==>  fits_write_array, fh, data;  
       fitsRead(name);              ==>  fits_read(name);  
       data = fitsRead(name, hdr);  ==>  data = fits_read(name, fh);  
     where NAME is the file name, STR is a string comment, HDR is the  
     header structure (obsolete but see fitsMakeOldHeader), FH is  
     the (new) FITS handle and DATA is an array of numbers.  
     The following old routines have no real equivalent:  
       fitsHeader  
       fitsFixHeader  
       fitsRescale  
         
SEE ALSO: fits  
 
 
 
fitsMakeOldHeader


 fitsMakeOldHeader  
 
keyword,  defined at i/fits.i   line 3023  
SEE fitsOldHeaderMembers  
 
 
 
fitsObsolete


 fitsObsolete  
 
keyword,  defined at i/fits.i   line 2923  
SEE fitsHeader  
 
 
 
fitsOldHeaderKeywords


 fitsOldHeaderKeywords  
 
keyword,  defined at i/fits.i   line 3023  
SEE fitsOldHeaderMembers  
 
 
 
fitsOldHeaderMembers


             fitsMakeOldHeader(fh)  
 
     Convert header information in FITS handle FH into the obsolete FitsHeader  
     structure.  
       
keyword,  defined at i/fits.i   line 3023  
SEE ALSO: fits,   FitsHeader  
 
 
 
fitsRead


 fitsRead  
 
SEE fitsHeader  
 
 
 
fitsRead


             a= fitsRead(filename, header)  
 
     *** WARNING: Obsolete fits routine (see fits_read) ***   
     
     Returns the data of the  FITS file FILENAME.  If present, the optional  
     argument HEADER will be used to  store the contents of the FITS header  
     file (a FitsHeader structure).  
       
     Keyword  WHICH may  be  used  to indicate  which  sub-array should  be  
     returned.  For instance, if the array DATA with dimensions (235,453,7)  
     is stored in the FITS file "data.fits", the sub-array DATA(,,4) can be  
     read by:  
               SUB_DATA= fitsRead("data.fits", which= 4);  
     Keyword PACK, if non-nil and  non-zero, indicates that axis whith unit  
     dimension  should be  ignored.  The  default  is to  ignore only  zero  
     length axis.  
     Keyword RESCALE, if non-nil and  zero, indicates that read data values  
     should not  be rescaled according  to FITS keywords BSCALE  and BZERO.  
     The default is to rescale data values  if BSCALE is not 1. or BZERO is  
     not 0.  
SEE ALSO: fits,   fits_read,   fitsObsolete  
 
 
 
fitsRescale


 fitsRescale  
 
SEE fitsHeader  
 
 
 
fitsRescale


 fitsRescale  
 
SEE fitsHeader  
 
 
 
fitsWrite


 fitsWrite  
 
SEE fitsHeader  
 
 
 
fitsWrite


 fitsWrite  
 
SEE fitsHeader  
 
 
 
fits_bitpix_info


             fits_bitpix_info(bitpix)  
 
     Return string information about FITS bits-per-pixel value.  
interpreted function, defined at i/fits.i   line 2270  
SEE ALSO: fits,   fits_bitpix_of,   fits_bitpix_type,  
fits_check_bitpix  
 
 
 
fits_bitpix_of


             fits_bitpix_of(x)  
 
       -or- fits_bitpix_of(x, native=1)  
     Return FITS bits-per-pixel value BITPIX for binary data X which can be  
     an array or a data  type (structure definition).  If keyword NATIVE is  
     true, the routine assumes that  binary data will be read/write to/from  
     FITS file using native machine data representation.  The default is to  
     conform to FITS standard and to  assume that XDR binary format will be  
     used in FITS file.  
interpreted function, defined at i/fits.i   line 2298  
SEE ALSO: fits,   fits_bitpix_type,   fits_check_bitpix  
 
 
 
fits_bitpix_type


             fits_bitpix_type(bitpix)  
 
     Returns Yorick data type given by FITS bits-per-pixel value BITPIX.  
interpreted function, defined at i/fits.i   line 2284  
SEE ALSO: fits,   fits_bitpix_of,   fits_bitpix_info,  
fits_check_bitpix  
 
 
 
fits_check_bitpix


             fits_check_bitpix(bitpix)  
 
     Test if FITS bits-per-pixel value BITPIX is valid.  
interpreted function, defined at i/fits.i   line 2260  
SEE ALSO: fits,   fits_bitpix_of,   fits_bitpix_type,  
fits_bitpix_info  
 
 
 
fits_check_file


             fits_check_file(filename)  
 
       -or- fits_check_file(filename, errmode)  
     Returns 1/0  depending whether FILENAME is  a valid FITS  file or not.  
     If ERRMODE is true (non-nil  and non-zero), unreadable file results in  
     false result otherwise it is  a runtime error.  Note that the checking  
     is very simple: it is sufficient that the first FITS card in the first  
     2880 bytes has keyword "SIMPLE" with logical value 'T' (true).  
interpreted function, defined at i/fits.i   line 548  
SEE ALSO: fits  
 
 
 
fits_close


             fits_close(fh)  
 
     Closes stream in FITS handle  FH.  The header information stored in FH  
     remain unchanged  (e.g. you can keep  editing the header  in FH).  The  
     returned  value is FH.   Note that  if you  destroy all  references to  
     handle FH, the  associated file (if any) gets  automatically closed by  
     Yorick.  
interpreted function, defined at i/fits.i   line 433  
SEE ALSO: fits,   fits_open  
 
 
 
fits_coordinate


 fits_coordinate  
 
struct fits_coordinate {  
  long axis, length;  
  string ctype;  
  double crpix, crval, cdelt, crota;  
}  
 
 
 
fits_coordinate


             fits_get_coordinate(fh, axis)  
 
     Gets AXIS-th coordinate information for current HDU in FITS handle FH.  
     By  default, the  result  is a  fits_coordinate  structure defined  as  
     follows:  
       struct fits_coordinate {  
         long axis;    // axis number  
         long length;  // number of elements along this axis  
         string ctype; // name of the coordinate represented by this axis  
         double crpix; // location of a reference point (starting at 1)  
                       // along this axis  
         double crval; // value of the coordinate along this axis at the  
                       // reference point  
         double cdelt; // partial derivative of the coordinate with respect  
                       // to the pixel index along this axis, evaluated at  
                       // the reference point  
         double crota; // used to indicate a rotation from a standard  
                       // coordinate system described by the value of CTYPE  
                       // to a different coordinate system in which the  
                       // values in the array are actually expressed  
       }  
     If keyword  SPAN is true, then the  result is a vector  that gives the  
     coordinate of each element along given axis:  
        CDELT*(indgen(LENGTH) - CRPIX) + CRVAL  
     Note that, if the axis length is zero, a nil value is returned.  
SEE ALSO: fits,   fits_get,   fits_get_dims  
 
 
 
fits_create


             fits_create(filename)     
 
     Creates  a new  FITS  file FILENAME  and  returns a  FITS handle  with  
     mandatory cards (i.e. SIMPLE, BITPIX, NAXIS, NAXISn) and some optional  
     cards (i.e. EXTEND, BSCALE and BZERO) already initialized.  
     Keyword  BITPIX can  be  used to  set  FITS "bits-per-pixel"  (default  
     is BITPIX=8, i.e. byte data).  
     Keyword DIMLIST  should be used to  specify the dimension  list of the  
     array data that  is intended to be written in  primary HDU.  The value  
     of DIMLIST is similar to the result returned by dimsof.  
     Keyword EXTEND can  be used to indicate whether  the file may contains  
     FITS extensions.  It is probably a good idea to always use EXTEND=1.  
     Keyword TEMPLATE can be set with  an existing FITS handle to copy some  
     FITS cards  of the template into  the new header.  The  FITS card that  
     are  never  copied   are:  "SIMPLE",  "XTENSION",  "BITPIX",  "NAXIS",  
     "NAXIS#" (with #  an integer), "BSCALE" and "BZERO";  the orther cards  
     get copied.  See keywords BSCALE and BZERO if you specifically want to  
     set these values.  
       
     Keywords BSCALE and BZERO can  be used to specify physical value scale  
     and offset.   See fits_write_array to figure out  how keywords BITPIX,  
     BSCALE and BZERO are used to convert data values into file values.  
     Keywords HISTORY  and COMMENT can be  set to add some  comments in the  
     new handle.  The values of these keywords may be array of strings.  
     Keywords ENCODING and OVERWRITE have the same meaning as in fits_open  
     routine (to see).  
interpreted function, defined at i/fits.i   line 448  
SEE ALSO: fits,   fits_open,   fits_set,   fits_set_dims  
 
 
 
fits_current_hdu


             fits_current_hdu(fh);  
 
     Return number of current Header Data Unit in FITS handle FH.  
interpreted function, defined at i/fits.i   line 726  
SEE ALSO: fits,   fits_read_header,   fits_rewind,  
fits_next_hdu  
 
 
 
fits_date


             fits_date()  
 
     Returns current Universal Time date as a string conforming to FITS  
     standard: "DD/MM/YY"  
interpreted function, defined at i/fits.i   line 785  
SEE ALSO: fits,   rdline,   popen  
 
 
 
fits_delete


             fits_delete, fh, pattern;  
 
     Delete all cards  matching PATTERN from current header  of FITS handle  
     FH (see fits_match for the syntax of PATTERN).  
interpreted function, defined at i/fits.i   line 2562  
SEE ALSO: fits,   fits_match  
 
 
 
fits_filename


             fits_filename(fh)  
 
     Return path name  of file associated with FITS handle  FH (in fact the  
     argument may also be any Yorick open stream).  
interpreted function, defined at i/fits.i   line 2197  
SEE ALSO: fits  
 
 
 
fits_get


             fits_get(fh, pattern, comment)  
 
     Get  (array  of)  value(s)   for  FITS  cards  matching  PATTERN  (see  
     fits_match) in current header of FITS handle FH.  If present, argument  
     COMMENT is  an output symbol  where the corresponding comment  part of  
     selected card(s)  will be stored.   In order to avoid  namespace clash  
     due to Yorick's  scoping rules, COMMENT should be  declared as a local  
     symbol in the calling function, e.g.:  
       local comment;  
       value = fits_get(fh, pattern, comment);  
     If no  cards match PATTERN, the  value of keyword  DEFAULT is returned  
     and COMMENT is set to the null string.  
     If multiple  cards match PATTERN, they  must have the  same value type  
     unless keyword PROMOTE is true, in which case the routine promotes all  
     card values to a suitable "highest" type.  
     Request fo commentary cards  (i.e. PATTERN is "HISTORY", "COMMENT", or  
     "") may returns several cards.  
interpreted function, defined at i/fits.i   line 2439  
SEE ALSO: fits,   fits_match,   fits_parse  
 
 
 
fits_get_bitpix


             fits_get_bitpix(fh)  
 
       -or- fits_get_bitpix(fh, fix)  
     Get  BITPIX   value  from  current   HDU  in  FITS  handle   FH.   See  
     fits_get_special for the meaning of FIX.  
interpreted function, defined at i/fits.i   line 792  
SEE ALSO: fits,   fits_check_bitpix,   fits_get_special,  
fits_get_naxis,   fits_get_dims  
 
 
 
fits_get_bscale


             fits_get_bscale(fh)  
 
       -or- fits_get_bzero(fh)  
     Get BSCALE and BZERO values  for FITS handle FH.  These parameters are  
     used to convert file values into physical values according to:  
         physical_value = BZERO + BSCALE * file_value  
     if the corresponding card is  missing, BSCALE and BZERO default to 1.0  
     and 0.0 respectively.  
interpreted function, defined at i/fits.i   line 2682  
SEE ALSO: fits,   fits_get,   fits_read_array,  
fits_write_array  
 
 
 
fits_get_cards


             fits_get_cards(fh, pattern);  
 
     Return cards from  FITS handle FH which match  PATTERN (see fits_match  
     for the syntax of PATTERN).  
interpreted function, defined at i/fits.i   line 2550  
SEE ALSO: fits,   fits_match  
 
 
 
fits_get_coordinate


 fits_get_coordinate  
 
keyword,  defined at i/fits.i   line 897  
SEE fits_coordinate  
 
 
 
fits_get_data_size


             fits_get_data_size(fh)  
 
       -or- fits_get_data_size(fh, fix)  
     Computes  the number  of bytes  in data  part of  current HDU  of FITS  
     handle FH.  This value is computed  according to the header part of FH  
     and may be different from the  number of bytes actually written in the  
     data part of the current HDU.  
interpreted function, defined at i/fits.i   line 1078  
SEE ALSO: fits,   fits_read_header  
 
 
 
fits_get_dims


             fits_get_dims(fh)  
 
       -or- fits_get_dims(fh, fix)  
     Get all  NAXIS* values from current  HDU in FITS handle  FH and return  
     vector  [NAXIS, NAXIS1,  NAXIS2, ...].   If the  value of  any  of the  
     "NAXIS#" card is  zero, then there is no data in  the current unit and  
     fits_get_dims returns [] (nil) in this case.  See fits_get_special for  
     the meaning of FIX.  
interpreted function, defined at i/fits.i   line 820  
SEE ALSO: fits,   fits_get_special,   fits_get_bitpix,  
fits_get_naxis  
 
 
 
fits_get_gcount


             fits_get_gcount(fh)  
 
       -or- fits_get_pcount(fh)  
     Get PCOUNT and  GCOUNT values for FITS handle FH.   PCOUNT shall be an  
     integer  equal  to  the  number  of parameters  preceding  each  group  
     (default value 0).  GCOUNT shall be  an integer equal to the number of  
     random groups present (default value  1).  The total number of bits in  
     the data  array (exclusive of  fill that is  needed after the  data to  
     complete the last record) is given by the following expression:  
         NBITS = abs(BITPIX)*GCOUNT*(PCOUNT + NAXIS1*NAXIS2*...*NAXISm)  
interpreted function, defined at i/fits.i   line 2700  
SEE ALSO: fits,   fits_get,   fits_get_bitpix,  
fits_read_array,   fits_write_array  
 
 
 
fits_get_history


             fits_get_history(fh)  
 
       -or- fits_get_comment(fh)  
     Get COMMENT and  HISTORY values for FITS handle FH.   The result is an  
     array of string(s) or nil if no such cards exists in the header of the  
     current unit.  
interpreted function, defined at i/fits.i   line 2723  
SEE ALSO: fits,   fits_get,   fits_read_array,  
fits_write_array  
 
 
 
fits_get_keywords


             fits_get_keywords(fh)  
 
       -or- fits_get_keywords(fh, ordered)  
     Get list  of FITS keywords defined  in current HDU of  FITS handle HF.  
     The returned value is an array of strings. If ORDERED is true (non-nil  
     and non-zero),  the keywords get  sorted.  Note: the "END"  keyword is  
     always missing in a (non-corrupted) FITS handle.  
interpreted function, defined at i/fits.i   line 954  
SEE ALSO: fits,   sort,   strtok  
 
 
 
fits_get_naxis


             fits_get_naxis(fh)  
 
       -or- fits_get_naxis(fh, fix)  
     Get  NAXIS   value  from   current  HDU  in   FITS  handle   FH.   See  
     fits_get_special for the meaning of FIX.  
interpreted function, defined at i/fits.i   line 807  
SEE ALSO: fits,   fits_get_special,   fits_get_bitpix,  
fits_get_dims  
 
 
 
fits_get_special


             fits_get_special(fh, key, id, location, fix)  
 
     Get  value of  a special  FITS card  given its  key  string, numerical  
     identifier and absolute  LOCATION (1 for first FITS  card).  If FIX is  
     true,  various further  verifications  are made  and,  if FITS  strict  
     checking mode is  off, the header may be fixed  in case of unambiguous  
     error.  
interpreted function, defined at i/fits.i   line 869  
SEE ALSO: fits,   fits_get_bitpix,   fits_get_naxis,  
fits_get_dims,   fits_parse  
 
 
 
fits_get_xtension


             fits_get_xtension(fh)  
 
     Get XTENSION value  from current HDU in FITS  handle FH.  The returned  
     value is a  scalar string with the name of  the extension;  "IMAGE" is  
     returned for the primary HDU.  
interpreted function, defined at i/fits.i   line 845  
SEE ALSO: fits,   fits_get,   fits_parse  
 
 
 
fits_goto_hdu


             fits_goto_hdu(fh, hdu)  
 
     Move FITS handle FH to Header  Data Unit number HDU (starting at 1 for  
     the primary HDU) and parse the  header part of the new unit.  Contents  
     of FH  is updated with  header part of  new HDU.  To allow  for linked  
     calls, the returned value is FH.  
interpreted function, defined at i/fits.i   line 673  
SEE ALSO: fits,   fits_next_hdu,   fits_read_header,  
fits_rewind  
 
 
 
fits_id


 fits_id  
 
interpreted function, defined at i/fits.i   line 2577  
SEE fits_ids  
 
 
 
fits_ids


             fits_id(card)  
 
       -or- fits_ids(cards)  
     Convert  FITS  card(s) or  FITS  card  name(s)  into unique  numerical  
     indentifier.  CARD  is a  scalar string  and CARDS (with  an S)  is an  
     array  of  string(s) (including  a  scalar).   Only  the keyword  part  
     (characters  1:8)  of  CARD(S)  is  relevant;  cards  shorter  than  8  
     characters yield  the same  identifier as if  they were  padded (right  
     filled) with spaces.   In other words, all the  values returned by the  
     following expressions are identical:  
       fits_id("SIMPLE = T / conforming FITS file");  
       fits_id("SIMPLE ");  
       fits_id("SIMPLE");  
interpreted function, defined at i/fits.i   line 2577  
SEE ALSO: fits,   fits_key,   fits_rehash  
 
 
 
fits_init


             fits_init;  
 
     (Re)initializes FITS private  data.  Normally you do not  have to call  
     this  routine  because  this  routine  is  automatically  called  when  
     "fits2.i" is  parsed by Yorick.   You may however need  to explicitely  
     call  fits_init  if  you  suspect  that some  FITS  private  data  get  
     corrupted or if you want to tune FITS strict/sloopy behaviour.  
     If keyword SLOOPY  is true (non-nil and non-zero)  some discrepancy is  
     allowed (for reading FITS file only); otherwise strict FITS compliance  
     is applied.  If SLOOPY is true, lower case Latin letters have the same  
     meaning  as their  upper  case counterparts,  most control  characters  
     become identical to regular spaces.  
     According to FITS standard, the only characters permitted for keywords  
     are  upper  case  (capital)  Latin alphabetic,  numbers,  hyphen,  and  
     underscore.  Leading and embedded blanks are forbidden.  If you cannot  
     read a FITS file because it does not confrom to this rule, you can use  
     keyword ALLOW (a string or an array of characters) to allow additional  
     characters for FITS keywords.  For instance:  
       fits_init, allow="/."; // fix for invalid headers made by IRAF  
     make characters '/'  and '.'  acceptable in FITS  keywords.  Note that  
     you  must apply fits_rehash  (to see)  to _every_  FITS handle  in use  
     whenever you change  the set of allowed characters  (because this will  
     probably corrupt the values of numerical identifiers of FITS card) ...  
     It is  therefore a good idea  to change the set  of allowed characters  
     before using any FITS routines.  
     Keyword  BLANK can  be  used to  add  more characters  that should  be  
     considered as blanks (spaces)  when parsing FITS header/keywords.  The  
     value  of BLANK  must  be a  string  or an  array  of characters,  for  
     instance: BLANK="\t\r\v\n".  Note that this break strict compliance to  
     FITS standard.  
interpreted function, defined at i/fits.i   line 2793  
SEE ALSO: fits,   fits_rehash  
 
 
 
fits_is_integer


             fits_is_integer(x)  
 
     Returns true if array X is of integer type.  
interpreted function, defined at i/fits.i   line 2166  
SEE ALSO: fits_is_scalar  
 
 
 
fits_is_integer_scalar


             fits_is_integer_scalar(x)  
 
     Returns true if array X is a scalar of integer type.  
interpreted function, defined at i/fits.i   line 2173  
SEE ALSO: fits_is_real_scalar,   fits_is_scalar,  
fits_is_string_scalar  
 
 
 
fits_is_real_scalar


             fits_is_real_scalar(x)  
 
     Returns true if array X if of real type (i.e. double or float).  
interpreted function, defined at i/fits.i   line 2183  
SEE ALSO: fits_is_integer_scalar,   fits_is_scalar,  
fits_is_string_scalar  
 
 
 
fits_is_scalar


             fits_is_scalar(x)  
 
     Returns true if X is a scalar.  
interpreted function, defined at i/fits.i   line 2159  
SEE ALSO: fits_is_integer_scalar,   fits_is_real_scalar,  
fits_is_string_scalar  
 
 
 
fits_is_string_scalar


             fits_is_string_scalar(x)  
 
     Returns true if array X is a scalar of string type.  
interpreted function, defined at i/fits.i   line 2190  
SEE ALSO: fits_is_integer_scalar,   fits_is_real_scalar,  
fits_is_scalar  
 
 
 
fits_key


             fits_key(id)  
 
     Convert  (array   of)  FITS   numerical  identifier(s)  ID   into  the  
     corresponding string FITS keyword(s) without trailing spaces.  
interpreted function, defined at i/fits.i   line 2641  
SEE ALSO: fits,   fits_id  
 
 
 
fits_list


             fits_list, fh;  
 
       -or- fits_list(fh)  
     Get the names of  the FITS extensions in FH.  FH can  be the name of a  
     FITS file  or a FITS handle  FH (the input handle  is left unchanged).  
     When called  as a  subroutine, the list  is printed to  terminal; when  
     called as  a function, the returned  value is a string  array with the  
     names of the FITS extensions in FH.  
interpreted function, defined at i/fits.i   line 732  
SEE ALSO: fits,   fits_read_header,   fits_next_hdu  
 
 
 
fits_map


             fits_map(op, src)  
 
     Map scalar function OP onto array argument SRC to mimics element-wise  
     unary operation.  
interpreted function, defined at i/fits.i   line 2144  
SEE ALSO: fits  
 
 
 
fits_match


 fits_match  
 
keyword,  defined at i/fits.i   line 2504  
SEE _fits_match_id  
 
 
 
fits_move


             fits_move, a, i, j;  
 
     Move I-th element of array A  in place of J-th element.  The operation  
     is done in-place.  
interpreted function, defined at i/fits.i   line 984  
SEE ALSO: fits,   fits_move_card  
 
 
 
fits_move_card


             fits_move_card(fh, from, to);  
 
     Change location of FROM-th card to  index TO into FITS handle FH.  The  
     operation is made in place.  
interpreted function, defined at i/fits.i   line 973  
SEE ALSO: fits,   fits_move  
 
 
 
fits_new_bintable


             fits_new_bintable(fh)  
 
       -or- fits_new_bintable(fh, comment)  
         
     Starts a new  binary table FITS extension.  This  routine starts a new  
     FITS extension with  name "BINTABLE" and pre-set FITS  cards needed to  
     describe the  table with fake values  (the correct values  will be set  
     when  fits_write_bintable  is called  to  actually  write the  table).  
     After calling this  routine, the user can add new  FITS cards (but not  
     XTENSION,  BITPIX,   NAXIS,  NAXIS1,  NAXIS2,   GCOUNT,  nor  PCOUNT).  
     Optional argument COMMENT is the comment string for the XTENSION card.  
     The returned value is FH.  
interpreted function, defined at i/fits.i   line 1713  
SEE ALSO: fits,   fits_write_bintable  
 
 
 
fits_new_hdu


             fits_new_hdu(fh, xtension)  
 
       -or- fits_new_hdu(fh, xtension, comment)         
     Starts a new extension in FITS  file open for writing.  FH is the FITS  
     handle, XTENSION is  the name of the FITS extension  and COMMENT is an  
     optional string comment.  After calling fits_new_hdu, there is no need  
     to call:  
       fits_set, FH, "XTENSION", XTENSION, COMMENT;  
     since this is already done by this routine.  However, beware that FITS  
     standard requires that, if any  extension is present in the file, that  
     the keyword "EXTEND" with logical  value 'T' (true) must appear in the  
     primary header.  
interpreted function, defined at i/fits.i   line 1104  
SEE ALSO: fits,   fits_set,   fits_write_header,  
fits_write_array  
 
 
 
fits_new_image


             fits_new_image(fh, ...)  
 
     Starts a new image (array)  FITS extension.  This routine starts a new  
     FITS  extension with  name "IMAGE"  and pre-set  FITS cards  needed to  
     describe the array data according to keywords: BITPIX, DIMLIST, BZERO,  
     BSCALE.  The returned value is FH.  
       
interpreted function, defined at i/fits.i   line 1690  
SEE ALSO: fits,   fits_write_array  
 
 
 
fits_next_hdu


             fits_next_hdu(fh)  
 
     Move FITS handle FH to next Header Data Unit and parse the header part  
     of the  new unit.  Contents of FH  is updated with header  part of new  
     HDU.  To allow for linked calls, the returned value is FH.  
interpreted function, defined at i/fits.i   line 696  
SEE ALSO: fits,   fits_goto_hdu,   fits_read_header,  
fits_rewind  
 
 
 
fits_nth


             fits_nth(n)  
 
     Returns a string in the form "1st", "2nd", "3rd" or "#th" where # is  
     the human readable value of integer N.  
interpreted function, defined at i/fits.i   line 772  
SEE ALSO: fits,   fits_set_dims  
 
 
 
fits_open


             fits_open(filename)  
 
       -or- fits_open(filename, filemode)  
     Opens  the FITS  file FILENAME  according to  FILEMODE.   The returned  
     value is a FITS handle used  in most other FITS routines.  FILEMODE is  
     one of:  
       "r" or 'r' - read mode,  the header of the primary  HDU get read and  
                    is parsed.  
       "w" or 'w' - write   mode,  new  file  is  created  (unless  keyword  
                    OVERWRITE is true, FILENAME must not already exists).  
       "a" or 'a' - append  mode, stream  get positionned  at last HDU, the  
                    header of the last HDU get read and parsed.  
     The default FILEMODE is "r" -- open an existing FITS file for reading.  
     Keyword ENCODING can  be used to change the data  encoding of the FITS  
     file which is  "xdr" for a regular FITS file  (XDR means eXternal Data  
     Representation,  which is  natively  used by  all  IEEE compliant  big  
     endian machine).  The value of the keyword is a string like:  
       "xdr", "sun"    - eXternal Data Representation (the default)  
       "native"        - native data representation (i.e. no conversion)  
       "i86", "pc"     - IEEE little endian machines  
       ...  
     see documentation for "__sun" for  a list of supported encodings. Note  
     that  using  an encoding  different  from  IEEE  big endian  (or  XDR)  
     violates FITS standard.  
     Keyword OVERWRITE can be used to force overwriting of an existing file  
     (otherwise it is an error to create a file that already exists).  
interpreted function, defined at i/fits.i   line 368  
SEE ALSO: fits,   fits_read_header,   fits_write_header,  
fits_get,   fits_set,   fits_read_array,  
fits_write_array,   fits_next_hdu,   fits_new_hdu,  
fits_rewind,   __sun  
 
 
 
fits_parse


 fits_parse  
 
keyword,  defined at i/fits.i   line 2339  
SEE _fits_parse_comment  
 
 
 
fits_read


             fits_read(filename)  
 
       -or- local fh; a = fits_read(filename, fh)  
     Open  FITS file  FILENAME and  read data.   FH is  an  optional output  
     symbol where  the FITS handle  will be stored  for future use  such as  
     moving  to  a  FITS  extension  in  the  same  file  and  reading  its  
     header/data.  (Note:  a FITS handle is  a Yorick list  that contains a  
     file handle and all header information from the current HDU.)  
     By  default, the data  get read  from the  first HDU  but this  can be  
     changed with the HDU keyword (default HDU=1, i.e. primary HDU).  
     Keyword ENCODING can be used and  has the same meaning as in fits_open  
     (to see).  
     Keywords WHICH and RESCALE can be used and have the same meaning as in  
     fits_read_array (to see).   These keywords are ignored if  HDU to read  
     is not primary HDU nor an "image" extension.  
interpreted function, defined at i/fits.i   line 300  
SEE ALSO: fits,   fits_write,   fits_open,   fits_read_array,  
fits_read_bintable  
 
 
 
fits_read_array


             fits_read_array(fh)  
 
     Gets "image" (actually a Yorick array) from current HDU of FITS handle  
     FH.  Note that the result may be [] (nil) if the current unit contains  
     no data.  
     Keyword  WHICH may  be  used  to indicate  which  sub-array should  be  
     returned.  WHICH always  applies to the last dimension  of the "image"  
     data  stored in current  HDU.  For  instance, if  the array  DATA with  
     dimensions  (235,453,7)  is  stored  in  the  current  FITS  HDU,  the  
     sub-array DATA(,,4) can be obtained by:  
         fits_read_array(FH, which=4);  
     If keyword RESCALE is true,  returned values get rescaled according to  
     FITS keywords BSCALE and BZERO.  If RESCALE=2 and one of BSCALE and/or  
     BZERO exists in  the FITS header and  BITPIX was 8, 16, 32,  or -32, a  
     single precision  array (float)  is returned.  If  RESCALE is  not set  
     (nil), the  default is to  rescale data values  if BSCALE is not  1 or  
     BZERO is not  0 (i.e. the default is RESCALE=1).  In  order to get raw  
     data (i.e. as written in the file), use RESCALE=0.  
interpreted function, defined at i/fits.i   line 1447  
SEE ALSO: fits,   fits_open  
 
 
 
fits_read_bintable


             fits_read_bintable(fh)  
 
     Reads a binary table in current  HDU of FITS handle FH and returns the  
     fields of  the table as  a pointer array  (i-th field of the  table is  
     pointed  by  i-th  pointer  element).   Empty fields  and  fields  for  
     unsupported data  types (bit array  and array descriptor) result  in a  
     null pointer (&[]).  The geometry  of the arrays pointed by the result  
     will be  NCOLS(i) by NROWS  where NROWS is  the number of rows  in the  
     table and NCOLS(i) is the repeat  count of the i-th field in the table  
     (see fits_write_bintable).  
interpreted function, defined at i/fits.i   line 1903  
SEE ALSO: fits,   fits_write_bintable  
 
 
 
fits_read_header


             fits_read_header(fh)  
 
     (Re)read  and parse  header of  current  HDU of  FITS handle  FH.  
     Contents of FH is updated with  header part of new HDU.  To allow  
     for linked calls,  the returned value is FH.   If the current HDU  
     is empty (i.e. last HDU in the file), the header will be empty.  
interpreted function, defined at i/fits.i   line 572  
SEE ALSO: fits,   fits_open,   fits_read_array,  
fits_next_hdu  
 
 
 
fits_rehash


             fits_rehash(fh);  
 
     (Re)compute array of numerical identifier for FITS handle FH (operation  
     is done in-place) and return FH.  
interpreted function, defined at i/fits.i   line 2669  
SEE ALSO: fits,   fits_id  
 
 
 
fits_rewind


             fits_rewind(fh)  
 
     Move FITS handle FH to primary Header Data Unit and parse the header part  
     of the unit.  FH is returned when called as a function.  
interpreted function, defined at i/fits.i   line 711  
SEE ALSO: fits,   fits_read_header,   fits_next_hdu  
 
 
 
fits_set


             fits_set, fh, key, value;  
 
       -or- fits_set, fh, key, value, comment;  
     Set (or adds) FITS card in header  of FITS handle FH.  KEY is the card  
     name (FITS keyword)  and must be a scalar string,  VALUE is the scalar  
     value of the card and COMMENT is an optional string comment.  
     Commentary cards -- for which KEY  is one of "COMMENT, "HISTORY" or ""  
     (blank) -- get appended to the  existing cards in the header of FH (if  
     the VALUE of a commentary card is too long, it may occupy several FITS  
     cards).   For any  other  kind of  cards,  the new  card replaces  the  
     existing one, if any; or  get appended to the existing cards.  Special  
     cards that must appear in a precise order ("SIMPLE", "BITPIX", "NAXIS"  
     and "NAXIS#") must  be added in the correct order  (their value can be  
     modified afterward).  The "END"  card is not  needed since it  will be  
     automatically written when required.  
interpreted function, defined at i/fits.i   line 1153  
SEE ALSO: fits,   fits_open  
 
 
 
fits_set_dims


             fits_set_dims(fh, dimlist)  
 
      Set NAXIS  and NAXIS1,  NAXIS2, ... values  into current HDU  of FITS  
      handle FH according to dimension list DIMLIST.  DIMLIST may be empty.  
interpreted function, defined at i/fits.i   line 1660  
SEE ALSO: fits,   fits_get_dims  
 
 
 
fits_tolower


             fits_tolower(s)  
 
       -or- fits_toupper(s)  
     Converts a string or an array of strings S to lower/upper case letters.  
interpreted function, defined at i/fits.i   line 2118  
SEE ALSO: fits,   fits_trim  
 
 
 
fits_toupper


 fits_toupper  
 
interpreted function, defined at i/fits.i   line 2118  
SEE fits_tolower  
 
 
 
fits_trim


             fits_trim(s)  
 
     Removes trailing  spaces (character 0x20) from scalar  string S (note:  
     trailing spaces are not significant in FITS).  
interpreted function, defined at i/fits.i   line 2132  
SEE ALSO: fits,   fits_tolower,   fits_toupper  
 
 
 
fits_write


             fits_write, filename, data;  
 
       -or- fits_write(filename, data)  
     Creates a new FITS file FILENAME  and write array DATA in primary HDU.  
     When called  as a function,  the result is  a FITS handle that  can be  
     used to append extensions to the file.  
     FITS "bits-per-pixel"  can be specified by  keyword BITPIX; otherwise,  
     BITPIX   is   automatically   guessed   from  the   data   type   (see  
     fits_bitpix_of).  
     Keywords  EXTEND, TEMPLATE, HISTORY  COMMENT, BSCALE,  BZERO, ENCODING  
     and OVERWRITE have the same meaning as in fits_create (to see).  
interpreted function, defined at i/fits.i   line 335  
SEE ALSO: fits,   fits_bitpix_of,   fits_create,  
fits_write_header,   fits_write_array  
 
 
 
fits_write_array


             fits_write_array, fh, data;  
 
     Write  array DATA  into  curent HDU  of  FITS handle  FH.   DATA is  a  
     so-called "image"  in FITS jargon but  it can be a  numerical array of  
     any-dimension.   FITS cards BITPIX,  BSCALE and  BZERO are  taken into  
     account to convert data values into file values.  The file values are:  
         (DATA  - BZERO)/BSCALE  
     with BZERO=0 and  BSCALE=1 by default (i.e. if not found  in FH) or if  
     keyword RESCALE  is explicitely set  to zero.  The values  are further  
     subject to rounding  to the nearest integer and  clipping for positive  
     BITPIX.  If  keyword RESCALE is  explicitely set to false  (zero), the  
     file values get written without BSCALE/BZERO scale conversion.  
     The N dimensions of DATA must  match the values of the NAXIS1, NAXIS2,  
     ..., NAXISn  cards of  the FITS  file (it is  assumed that  the header  
     information  stored in  FH  are synchronized  to  the header  actually  
     written) extra dimensions in the  FITS file are considered as possible  
     data slices.  By  default, the first data slice  get written.  Keyword  
     WHICH may be used to write a given slice of data.  The value WHICH may  
     be less or equal zero to choose  a slice with respect to the last one.  
  EXAMPLE:  
     The following  example creates a FITS file  with a 100-by-45-by-4-by-7  
     "image" data made of random  values computed and written one 100-by-45  
     slice at a time:  
       fh = fits_create("newfile.fits", bitpix=16, dimlist=[4,100,45,4,7],  
                        bscale=1e-4, bzero=0.0);  
       fits_write_header, fh;  
       nslices = 4*7; // product of last FITS dimensions  
       for (i=1 ; i<=nslices ; ++i)  
         fits_write_array, fh, random(100, 45), which=i;  
       fits_close, fh;  
                          
interpreted function, defined at i/fits.i   line 1524  
SEE ALSO: fits,   fits_write,   fits_write_header  
 
 
 
fits_write_bintable


             fits_write_bintable(fh, ptr)  
 
     Writes contents  of pointer PTR in  a binary table in  FITS handle FH.  
     Arrays pointed  by PTR  become the  fields of the  table (in  the same  
     order as in  PTR) and must all have 2 dimensions  with the same second  
     dimension (i.e. the number of rows in the table), first dimensions can  
     have any values  and may all be different. In other words:  
       *PTR(i) = i-th field in  the table, is an NCOLS(i)ŚNROWS array where  
                 NROWS is the  number of rows in the  table and NCOLS(i) is  
                 the repeat count of the i-th field.  
       
     In the current  version of the routine, only  arrays of numbers (char,  
     short, int,  long, float,  double or complex)  and vectors  of strings  
     (you  can  use several  vectors  to  circumvent  this limitation)  are  
     supported.  Before writing  the data part of a  binary table, you must  
     creates proper header:  
        fits_new_bintable, fh;        // starts a new binary table  
        fits_set, fh, "...", ...;     // (optional) set more info. in header  
        fits_set, ...;  
        fits_write_bintable, fh, ptr; // write binary table  
     fits_write_bintable automatically  guess the  format of the  fields in  
     the binary table and accordingly set FITS cards "TFORM#" (with # equal  
     to the field number) in the header of the binary table.  
     If keyword LOGICAL is true (non nil and non-zero) then arrays of int's  
     in  PTR  are considered  as  logical arrays  and  saved  as arrays  of  
     characters: 'F' for false, 'T' for true or '\0' for bad/invalid value.  
     Following Yorick's convention, a "false"  value is integer zero in the  
     arrays of  int's and  a "true" is  any non-zero integer.   However, if  
     LOGICAL has the  special value 2, then strictly  positive integers are  
     treated as "true" values and strictly negative integers are treated as  
     invlaid  values.  Note  that this  only  affect arrays  of int's  (not  
     long's  nor short's nor  char's).  The  default is  to save  arrays of  
     int's as array of 32 bits integers.  
     The returned value is FH.  
interpreted function, defined at i/fits.i   line 1736  
SEE ALSO: fits,   fits_new_bintable,   fits_read_bintable  
 
 
 
fits_write_header


             fits_write_header(fh)  
 
     Write  header  information of  FITS  handle  FH  into current  HDU  of  
     associated file.   It is possible to  re-write header as  long as this  
     would not overwrite existing written data if any (i.e. the new header,  
     rounded up  to a multiple of 2880  bytes, must not be  longer than the  
     old one or there must be no data written.  
interpreted function, defined at i/fits.i   line 1007  
SEE ALSO: fits,   fits_open,   fits_write,  
fits_write_array