home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11.lha / ccs-lib / include / fits_def.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-24  |  3.1 KB  |  129 lines

  1. /*
  2. %    FITS_DEF . H
  3. %
  4. %    for FITS and some other images
  5. %
  6. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7.  
  8. This software is copyright (C) by the Lawrence Berkeley Laboratory.
  9. Permission is granted to reproduce this software for non-commercial
  10. purposes provided that this notice is left intact.
  11.  
  12. It is acknowledged that the U.S. Government has rights to this software
  13. under Contract DE-AC03-765F00098 between the U.S.  Department of Energy
  14. and the University of California.
  15.  
  16. This software is provided as a professional and academic contribution
  17. for joint exchange. Thus, it is experimental, and is provided ``as is'',
  18. with no warranties of any kind whatsoever, no support, no promise of
  19. updates, or printed documentation. By using this software, you
  20. acknowledge that the Lawrence Berkeley Laboratory and Regents of the
  21. University of California shall have no liability with respect to the
  22. infringement of other copyrights by any part of this software.
  23.  
  24. For further information about this notice, contact William Johnston,
  25. Bld. 50B, Rm. 2239, Lawrence Berkeley Laboratory, Berkeley, CA, 94720.
  26. (wejohnston@lbl.gov)
  27.  
  28. For further information about this software, contact:
  29.     Jin Guojun
  30.     Bld. 50B, Rm. 2275, Lawrence Berkeley Laboratory, Berkeley, CA, 94720.
  31.     g_jin@lbl.gov
  32.  
  33. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  34. %
  35. % AUTHOR:    Jin Guojun - LBL    8/1/90
  36. */
  37.  
  38. #ifndef    F_ICH
  39. #define    F_ICH
  40.  
  41. #include <ctype.h>
  42. #include <stdio.h>
  43.  
  44. #define    index    strchr
  45. #define    rindex    strrchr
  46.  
  47. typedef short   FITSType;
  48.  
  49. typedef    struct    {
  50.     char    sample, *datatype, *format, *date, *history;
  51.     int    bits_pxl,
  52.         naxis, naxis1, naxis2, naxis3,
  53.         naux, minval, maxval;
  54.     float    scale,        /* Compression scale factor    */
  55.         bscale, bzero,    /*    convert factor        */
  56.         crval1, crval2, seeing;    /* convert coefficient    */
  57. }    FITS_BASE;
  58.  
  59. #ifndef    MaxUNIXFortranBlock
  60. #define    MaxUNIXFortranBlock    0x1BD6E
  61. #endif
  62. #ifndef    MaxVAXFortranBlock
  63. #define    MaxVAXFortranBlock    2044
  64. #endif
  65. #ifndef    MaxPCFortranBlock
  66. #define    MaxPCFortranBlock    128
  67. #endif
  68. #ifndef    FITSBlock
  69. #define    FITSBlock    2880
  70. #endif
  71.  
  72. #define SEEK_SET    0
  73. #define SEEK_CUR    1
  74. #define SEEK_END    2
  75.  
  76. #ifdef    TC_Need
  77. #define    _DEBUG_
  78. /*   pc i/o defines    */
  79. #ifndef    O_RDONLY
  80. #define O_RDONLY    0x0000    /* open for reading only    */
  81. #define O_BINARY    0x8000    /* file mode is binary        */
  82. #endif
  83. #endif    TC_Need
  84.  
  85. extern    FITS_BASE    fhd;
  86.  
  87. typedef    char    Elem;
  88. typedef char*    MAT;
  89. typedef    unsigned short    MCtrlV;
  90.  
  91. extern    MCtrlV    N;    /* dimension of matrixes */
  92.  
  93. /* Tool to provide variable sized matrix indexing */
  94.  
  95. #define M(m,i,j)    m[(i)*N + j]
  96. #define    MatCopy(a,b)    memcpy(b, a, N*N*sizeof(Elem))
  97.  
  98. typedef    union    {
  99.     char    c;
  100.     char*    s;
  101.     short    h;
  102.     long    l;
  103.     float    f;
  104.     double    d;
  105.     } convts;
  106.  
  107. typedef    union /* this union is used to swap 16 and 32 bit integers    */
  108.     {
  109.     char    ichar[4];
  110.     short    slen;
  111.     long    llen;
  112.     } SwapUnion;
  113.  
  114. typedef    union    {
  115.     char    ichar[2];
  116.     short    ilen;
  117.     } Sonion;
  118.  
  119. extern    FILE    *get_infile(), *get_outfile();
  120. extern    long    read_var();
  121. extern    int    check_host(), hostype;
  122. extern    bool    FORTRAN,/* Fortran file flag    */
  123.         FTy,    /* Fortran file type    */
  124.         FFCL,    /* Fortran Ctrl word length:    UNIX = 4, PC = 1. */
  125.         DCMP, Msg,
  126.         CONVT;    /* default convert type is byte    */
  127.  
  128. #endif    F_ICH
  129.