plate.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #define RAD(x) ((x)*PI_180)
  2. #define DEG(x) ((x)/PI_180)
  3. #define ARCSECONDS_PER_RADIAN (DEG(1)*3600)
  4. #define input_nybble(infile) input_nbits(infile,4)
  5. typedef float Angle; /* in radians */
  6. enum
  7. {
  8. /*
  9. * parameters for plate
  10. */
  11. Pppo1 = 0,
  12. Pppo2,
  13. Pppo3,
  14. Pppo4,
  15. Pppo5,
  16. Pppo6,
  17. Pamdx1,
  18. Pamdx2,
  19. Pamdx3,
  20. Pamdx4,
  21. Pamdx5,
  22. Pamdx6,
  23. Pamdx7,
  24. Pamdx8,
  25. Pamdx9,
  26. Pamdx10,
  27. Pamdx11,
  28. Pamdx12,
  29. Pamdx13,
  30. Pamdx14,
  31. Pamdx15,
  32. Pamdx16,
  33. Pamdx17,
  34. Pamdx18,
  35. Pamdx19,
  36. Pamdx20,
  37. Pamdy1,
  38. Pamdy2,
  39. Pamdy3,
  40. Pamdy4,
  41. Pamdy5,
  42. Pamdy6,
  43. Pamdy7,
  44. Pamdy8,
  45. Pamdy9,
  46. Pamdy10,
  47. Pamdy11,
  48. Pamdy12,
  49. Pamdy13,
  50. Pamdy14,
  51. Pamdy15,
  52. Pamdy16,
  53. Pamdy17,
  54. Pamdy18,
  55. Pamdy19,
  56. Pamdy20,
  57. Ppltscale,
  58. Pxpixelsz,
  59. Pypixelsz,
  60. Ppltra,
  61. Ppltrah,
  62. Ppltram,
  63. Ppltras,
  64. Ppltdec,
  65. Ppltdecd,
  66. Ppltdecm,
  67. Ppltdecs,
  68. Pnparam,
  69. };
  70. typedef struct Plate Plate;
  71. struct Plate
  72. {
  73. char rgn[7];
  74. char disk;
  75. Angle ra;
  76. Angle dec;
  77. };
  78. typedef struct Header Header;
  79. struct Header
  80. {
  81. float param[Pnparam];
  82. int amdflag;
  83. float x;
  84. float y;
  85. float xi;
  86. float eta;
  87. };
  88. typedef long Type;
  89. typedef struct Image Image;
  90. struct Image
  91. {
  92. int nx;
  93. int ny; /* ny is the fast-varying dimension */
  94. Type a[1];
  95. };
  96. int nplate;
  97. Plate plate[2000]; /* needs to go to 2000 when the north comes */
  98. double PI_180;
  99. double TWOPI;
  100. int debug;
  101. struct
  102. {
  103. float min;
  104. float max;
  105. float del;
  106. double gamma;
  107. int neg;
  108. } gam;
  109. char* hms(Angle);
  110. char* dms(Angle);
  111. double xsqrt(double);
  112. Angle dist(Angle, Angle, Angle, Angle);
  113. Header* getheader(char*);
  114. char* getword(char*, char*);
  115. void amdinv(Header*, Angle, Angle, float, float);
  116. void ppoinv(Header*, Angle, Angle);
  117. void xypos(Header*, Angle, Angle, float, float);
  118. void traneqstd(Header*, Angle, Angle);
  119. Angle getra(char*);
  120. Angle getdec(char*);
  121. void getplates(void);
  122. Image* dssread(char*);
  123. void hinv(Type*, int, int);
  124. int input_bit(Biobuf*);
  125. int input_nbits(Biobuf*, int);
  126. void qtree_decode(Biobuf*, Type*, int, int, int, int);
  127. void start_inputing_bits(void);
  128. Bitmap* image(Angle, Angle, Angle, Angle);
  129. int dogamma(int);