00001 #ifndef IMGDECODE_IRIS_INCL 00002 #define IMGDECODE_IRIS_INCL 1 00003 00004 #ifndef PACKETHEADERWORDS 00005 #define PACKETHEADERWORDS 19 00006 #endif 00007 #ifndef PACKETDATAWORDS 00008 #define PACKETDATAWORDS 869 00009 #endif 00010 #ifndef PACKETWORDS 00011 #define PACKETWORDS 888 00012 #endif 00013 00014 #if 0 00015 #ifndef IMGX 00016 #define IMGX 1096 00017 #endif 00018 00019 #ifndef IMGY 00020 #define IMGY 4144 00021 #endif 00022 00023 #define MAXPIXELS (IMGX*IMGY) 00024 #endif 00025 00026 #define MAXPIXELS (1096*4144) 00027 00028 #define MAXHIST 32768 00029 00030 #ifndef TABLE_DIR 00031 #define TABLE_DIR "/home/prodtest/cvs/TBL_JSOC/lev0" 00032 #endif 00033 00034 #define APID_IRIS_SCIENCE 768 00035 00036 #define isIRIS(x) ((x) == APID_IRIS_SCIENCE) 00037 00038 #define IMGDECODE_DECOMPRESS_ERROR (-1) 00039 #define IMGDECODE_TOO_MANY_PIXELS (-2) 00040 00041 #define IMGDECODE_BAD_N (-101) 00042 #define IMGDECODE_BAD_APID (-102) 00043 #define IMGDECODE_NO_LOOKUP_TABLE (-103) 00044 #define IMGDECODE_LOOKUP_ID_MISMATCH (-104) 00045 #define IMGDECODE_BAD_LOOKUP_TABLE (-105) 00046 #define IMGDECODE_NO_CROP_TABLE (-106) 00047 #define IMGDECODE_CROP_ID_MISMATCH (-107) 00048 #define IMGDECODE_BAD_CROP_GEOMETRY (-108) 00049 #define IMGDECODE_BAD_CROP_TABLE (-109) 00050 #define IMGDECODE_BAD_CROP_SKIP_TAKE (-110) 00051 #define IMGDECODE_BAD_OFFSET (-111) 00052 00053 #define IMGDECODE_OUT_OF_MEMORY (-201) 00054 00055 #define BLANK (-32768) 00056 00057 typedef struct { 00058 unsigned short width, height; 00059 unsigned totalpix; 00060 unsigned short *skip; 00061 unsigned short *take; 00062 unsigned *offset; 00063 } CROPTABLE; 00064 00065 typedef struct { 00066 int initialized; 00067 int reopened; 00068 unsigned telnum; 00069 unsigned fsn; 00070 unsigned fid; 00071 unsigned isysn; 00072 unsigned apid; 00073 unsigned cropid; 00074 unsigned luid; 00075 unsigned tap; 00076 unsigned N, K, R; 00077 unsigned totalvals; 00078 unsigned datavals; 00079 unsigned npackets; 00080 unsigned nerrors; 00081 unsigned nx; 00082 unsigned ny; 00083 int last_pix_err; 00084 int overflow; 00085 int headerr; 00086 uint64_t first_packet_time; 00087 short dat[MAXPIXELS]; 00088 unsigned hist[MAXHIST]; 00089 } IMG; 00090 00091 typedef struct { 00092 short min; 00093 short max; 00094 short median; 00095 double mean; 00096 double rms; 00097 double skew; 00098 double kurt; 00099 } STAT; 00100 00101 int imgdecode_iris(unsigned short *impdu, IMG *img); 00102 int imgdecode_iris_init_hack(IMG *img); 00103 int imgstat_iris(IMG *img, STAT *stat); 00104 00105 #endif