/* **********************************************************************
 * *                                                                    *
 * *          INCLUDE Definitions for IRIS Product Generator            *
 * *                                                                    *
 * **********************************************************************
 * File: iris/product/product_h.h
 *
 *    COPYRIGHT (c) 1989, 1993, 1996, 1997, 1998, 1999, 2000, 2001,
 *                        2002, 2003, 2004, 2005  BY
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.
 *
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED.
 */
#ifdef PRODUCT_H_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

#define     BAD_DATA       1
#define PRO_BAD_DATA      (PRO_FACILITY+BAD_DATA)
#define     BAD_PROTECT    2
#define PRO_BAD_PROTECT   (PRO_FACILITY+BAD_PROTECT)
#define     BAD_SCALE      3
#define PRO_BAD_SCALE     (PRO_FACILITY+BAD_SCALE)
#define     BAD_ZSCALE     4
#define PRO_BAD_ZSCALE    (PRO_FACILITY+BAD_ZSCALE)
#define     BIRD_WIND      5
#define PRO_BIRD_WIND     (PRO_FACILITY+BIRD_WIND)
#define     BEAM_ONEPPI    7
#define PRO_BEAM_ONEPPI   (PRO_FACILITY+BEAM_ONEPPI)
#define     BIRD_3D        8
#define PRO_BIRD_3D       (PRO_FACILITY+BIRD_3D)
#define     BIRD_WARN      9
#define PRO_BIRD_WARN     (PRO_FACILITY+BIRD_WARN)
#define     BWL_INS        10
#define PRO_BWL_INS       (PRO_FACILITY+BWL_INS)
#define     CANCEL         11
#define PRO_CANCEL        (PRO_FACILITY+CANCEL)
#define     GPPI_NODATA    12
#define PRO_GPPI_NODATA   (PRO_FACILITY+GPPI_NODATA)
#define     CAP_ONEPPI     13
#define PRO_CAP_ONEPPI    (PRO_FACILITY+CAP_ONEPPI)
#define     CAP_NOOVER     14
#define PRO_CAP_NOOVER    (PRO_FACILITY+CAP_NOOVER)
#define     GPPI_INTERNAL  15
#define PRO_GPPI_INTERNAL (PRO_FACILITY+GPPI_INTERNAL)
#define     GPPI_DATAMATCH 16
#define PRO_GPPI_DATAMATCH (PRO_FACILITY+GPPI_DATAMATCH)
#define     GPPI_CLIPRANGE 17
#define PRO_GPPI_CLIPRANGE (PRO_FACILITY+GPPI_CLIPRANGE)
#define     COMP_DATA      18
#define PRO_COMP_DATA     (PRO_FACILITY+COMP_DATA)
#define     COMP_MISSED    19
#define PRO_COMP_MISSED   (PRO_FACILITY+COMP_MISSED)
#define     COMP_WARN      20
#define PRO_COMP_WARN     (PRO_FACILITY+COMP_WARN)
#define     INGEST_SUM     21
#define PRO_INGEST_SUM    (PRO_FACILITY+INGEST_SUM)
#define     GETRAY_UNKP    22
#define PRO_GETRAY_UNKP   (PRO_FACILITY+GETRAY_UNKP)
#define     GPPI_HYB_ANG   23
#define PRO_GPPI_HYB_ANG  (PRO_FACILITY+GPPI_HYB_ANG)
#define     MATCH_DATA     24
#define PRO_MATCH_DATA    (PRO_FACILITY+MATCH_DATA)
#define     MATCH_HEIGHT   25
#define PRO_MATCH_HEIGHT  (PRO_FACILITY+MATCH_HEIGHT)
#define     MATCH_PROJ     26
#define PRO_MATCH_PROJ    (PRO_FACILITY+MATCH_PROJ)
#define     MATCH_SCALE    27
#define PRO_MATCH_SCALE   (PRO_FACILITY+MATCH_SCALE)
#define     MATCH_XYSIZE   28
#define PRO_MATCH_XYSIZE  (PRO_FACILITY+MATCH_XYSIZE)
#define     MATCH_ZSIZE    29
#define PRO_MATCH_ZSIZE   (PRO_FACILITY+MATCH_ZSIZE)
#define     MAX_BADPRM     30
#define PRO_MAX_BADPRM    (PRO_FACILITY+MAX_BADPRM)
#define     MATCH_TIME     31
#define PRO_MATCH_TIME    (PRO_FACILITY+MATCH_TIME)
#define     MAX_NOOVER     32
#define PRO_MAX_NOOVER    (PRO_FACILITY+MAX_NOOVER)
#define     MAX_ONEPPI     33
#define PRO_MAX_ONEPPI    (PRO_FACILITY+MAX_ONEPPI)
#define     NDOP_INTERR    34
#define PRO_NDOP_INTERR   (PRO_FACILITY+NDOP_INTERR)
#define     OVRW_BUSY      35
#define PRO_OVRW_BUSY     (PRO_FACILITY+OVRW_BUSY)
#define     OVRW_KEPT      36
#define PRO_OVRW_KEPT     (PRO_FACILITY+OVRW_KEPT)
#define     OVRW_OK        37
#define PRO_OVRW_OK       (PRO_FACILITY+OVRW_OK)
#define     PPI_NEEDED     38
#define PRO_PPI_NEEDED    (PRO_FACILITY+PPI_NEEDED)
#define     PRJ_FARAWAY    39
#define PRO_PRJ_FARAWAY   (PRO_FACILITY+PRJ_FARAWAY)
#define     PRJ_MISSING    40
#define PRO_PRJ_MISSING   (PRO_FACILITY+PRJ_MISSING)
#define     PROD_ERROR     42
#define PRO_PROD_ERROR    (PRO_FACILITY+PROD_ERROR)
#define     PROD_STOPPED   43
#define PRO_PROD_STOPPED  (PRO_FACILITY+PROD_STOPPED)
#define     RAINN_RAIN_SPAN 45
#define PRO_RAINN_RAIN_SPAN (PRO_FACILITY+RAINN_RAIN_SPAN)
#define     RAINN_TOOBIG    47
#define PRO_RAINN_TOOBIG    (PRO_FACILITY+RAINN_TOOBIG)
#define     RAIN1_GAGE_SPAN 49
#define PRO_RAIN1_GAGE_SPAN (PRO_FACILITY+RAIN1_GAGE_SPAN)
#define     RAIN1_CLTRES   50
#define PRO_RAIN1_CLTRES  (PRO_FACILITY+RAIN1_CLTRES)
#define     RAIN1_CLTRNG   51
#define PRO_RAIN1_CLTRNG  (PRO_FACILITY+RAIN1_CLTRNG)
#define     RAIN1_NOCLT    52
#define PRO_RAIN1_NOCLT   (PRO_FACILITY+RAIN1_NOCLT)
#define     RAIN1_NODATA   53
#define PRO_RAIN1_NODATA  (PRO_FACILITY+RAIN1_NODATA)
#define     RAIN1_PIPE     54
#define PRO_RAIN1_PIPE    (PRO_FACILITY+RAIN1_PIPE)
#define     RAIN1_TOOBIG   55
#define PRO_RAIN1_TOOBIG  (PRO_FACILITY+RAIN1_TOOBIG)
#define     SRI_NO_MELT    56
#define PRO_SRI_NO_MELT   (PRO_FACILITY+SRI_NO_MELT)
#define     SRI_NO_TFILE   57
#define PRO_SRI_NO_TFILE  (PRO_FACILITY+SRI_NO_TFILE)
#define     SRI_NO_TSITE   58
#define PRO_SRI_NO_TSITE  (PRO_FACILITY+SRI_NO_TSITE)
#define     SRI_NO_DBT     59
#define PRO_SRI_NO_DBT    (PRO_FACILITY+SRI_NO_DBT)
#define     RHI_NEEDED     60
#define PRO_RHI_NEEDED    (PRO_FACILITY+RHI_NEEDED)
#define     RTI_2RAYS      61
#define PRO_RTI_2RAYS     (PRO_FACILITY+RTI_2RAYS)
#define     SITE_BAD       62
#define PRO_SITE_BAD      (PRO_FACILITY+SITE_BAD)
#define     SHEAR_ELSCAN   63
#define PRO_SHEAR_ELSCAN  (PRO_FACILITY+SHEAR_ELSCAN)
#define     SHEAR_NOSEL    64
#define PRO_SHEAR_NOSEL   (PRO_FACILITY+SHEAR_NOSEL)
#define     SMOOTH_MEM     65
#define PRO_SMOOTH_MEM    (PRO_FACILITY+SMOOTH_MEM)
#define     SMOOTH_PROD    66
#define PRO_SMOOTH_PROD   (PRO_FACILITY+SMOOTH_PROD)
#define     SWP_NOTFOUND   67
#define PRO_SWP_NOTFOUND  (PRO_FACILITY+SWP_NOTFOUND)
#define     SWP_BADRANGE   68
#define PRO_SWP_BADRANGE  (PRO_FACILITY+SWP_BADRANGE)
#define     TOPS_ONEPPI    70
#define PRO_TOPS_ONEPPI   (PRO_FACILITY+TOPS_ONEPPI)
#define     TOPS_NOOVER     72
#define PRO_TOPS_NOOVER    (PRO_FACILITY+TOPS_NOOVER)
#define     TRACK_BADDTYPE  73
#define PRO_TRACK_BADDTYPE (PRO_FACILITY+TRACK_BADDTYPE)
#define     TRACK_BADPTYPE  74
#define PRO_TRACK_BADPTYPE (PRO_FACILITY+TRACK_BADPTYPE)
#define     MATCH_CENTER    75
#define PRO_MATCH_CENTER   (PRO_FACILITY+MATCH_CENTER)
#define     TRACK_DATA      76
#define PRO_TRACK_DATA     (PRO_FACILITY+TRACK_DATA)
#define     TRACK_MOTION    77
#define PRO_TRACK_MOTION   (PRO_FACILITY+TRACK_MOTION)
#define     TRACK_INTERNAL  78
#define PRO_TRACK_INTERNAL (PRO_FACILITY+TRACK_INTERNAL)
#define     TRACK_SIDESIZE  80
#define PRO_TRACK_SIDESIZE (PRO_FACILITY+TRACK_SIDESIZE)
#define     UNK_PROD        83
#define PRO_UNK_PROD       (PRO_FACILITY+UNK_PROD)
#define     VIL_LIMITS      84
#define PRO_VIL_LIMITS     (PRO_FACILITY+VIL_LIMITS)
#define     VIL_NOOVER      86
#define PRO_VIL_NOOVER     (PRO_FACILITY+VIL_NOOVER)
#define     VVP_GEOM        87
#define PRO_VVP_GEOM       (PRO_FACILITY+VVP_GEOM)
#define     VVP_INTERR      90
#define PRO_VVP_INTERR     (PRO_FACILITY+VVP_INTERR)
#define     VVP_LIMITS      91
#define PRO_VVP_LIMITS     (PRO_FACILITY+VVP_LIMITS)
#define     VVP_NOVEL       92
#define PRO_VVP_NOVEL      (PRO_FACILITY+VVP_NOVEL)
#define     VVP_SWITCH      93
#define PRO_VVP_SWITCH     (PRO_FACILITY+VVP_SWITCH)
#define     WARN_CENTER     94
#define PRO_WARN_CENTER    (PRO_FACILITY+WARN_CENTER)
#define     WARN_DATA       95
#define PRO_WARN_DATA      (PRO_FACILITY+WARN_DATA)
#define     WARN_PIC        96
#define PRO_WARN_PIC       (PRO_FACILITY+WARN_PIC)
#define     WARN_PROJ       97
#define PRO_WARN_PROJ      (PRO_FACILITY+WARN_PROJ)
#define     WARN_RADPOS     100
#define PRO_WARN_RADPOS    (PRO_FACILITY+WARN_RADPOS)
#define     WARN_SCALE      101
#define PRO_WARN_SCALE     (PRO_FACILITY+WARN_SCALE)
#define     WARN_SIZES      102
#define PRO_WARN_SIZES     (PRO_FACILITY+WARN_SIZES)
#define     WRONGDATA       103
#define PRO_WRONGDATA      (PRO_FACILITY+WRONGDATA)
#define     ZR_BAD          105
#define PRO_ZR_BAD         (PRO_FACILITY+ZR_BAD)
#define     BAD_BEAMWIDTH   106
#define PRO_BAD_BEAMWIDTH  (PRO_FACILITY+BAD_BEAMWIDTH)
#define     NO_DISDROMETER  107
#define PRO_NO_DISDROMETER  (PRO_FACILITY+NO_DISDROMETER)
#define     RAW_DATAMASK    108
#define PRO_RAW_DATAMASK    (PRO_FACILITY+RAW_DATAMASK)

#define     TEXT_BEEP      2000
#define PRO_TEXT_BEEP      (PRO_FACILITY+TEXT_BEEP)

#ifndef MESSAGE_ONLY 


#define GPPI_CONV_SIZE  (1024)	/* Max size of intermediate rays.  Do not raise > MAX_BINS */
#define GPPI_BIN_PIX    (1.05)  /* Cylindical ray bins/pixel */
#define INGEST_INPUTS     (15)  /* Max number of ingest files in one product */
#define PRODUCT_INPUTS   (100)  /* Max number of product files in one product */
#define DWELL_PROD_INPUTS (60)  /* Must be LE PRODUCT_INPUTS */

/* ********************************************
 * *                                          *
 * *            Common Storage                *
 * *    These values are initialized when     *
 * * the product process goes to the ON state *
 * *                                          *
 * ********************************************
 */

/* Contains the ingest directory path name
 */
EXTERN char sIngestDir_c[DIRECTORY_SIZE];

/* Contains the pointer to the surface_heights.conf file data.
 */
#ifdef SIGMET_PROJECTION_H
EXTERN struct terrain_site_header *pTerrain_c;
#endif  /* #ifdef SIGMET_PROJECTION_H */

/* Auxiliary warning results information.  This information is
 * not stored in the warning product, but may be used for other
 * products.
 */
#ifdef SIGMET_HEADERS_H
struct warning_aux_stats
{
  FLT4 fmaxval;	 /* Maximum and summed values of the data */
  FLT4 fsumval;  /*  from each of the possible input products. */
  UINT4 icount;  /* Number of data values included in the sum, may differ */
  UINT4 idtype;  /* Data type of input data */
};
struct warning_aux_results8
{
  struct latlon8 Earth;         /* lat/lon in radians */
  struct lsquare8 lsq ;		/* Accumulated stats for area's points */
  SINT4 iploc ;			/* location of first point in the area */
  UINT4 imask ;			/* Used for merging centroids together */
  FLT4  fXScale ;		/* Scale in km/pixel */
  FLT4  fYScale ;  
  struct XYPoint8 Pixels;       /* Centroid in pixels */
  struct warning_aux_stats stats[WARN_MAX_INPUTS]; /*Statistics from each input */
} ;
#endif /* #ifdef SIGMET_HEADERS_H */


#ifdef SIGMET_PROJECTION_H
struct catch_loop
{
  const struct catch_file_header8 *pCatchFile;
  struct catch_results *pResults;
  const UINT1 *pHeap;
  UINT4 *pRegionList[CATCHMENT_MAX];  /*List of all the points in the catchment */
};
union rain1_loop_results
{
  UINT4 *pRainnSum;
  struct catch_loop Catch;
};
#endif  /* #ifdef SIGMET_PROJECTION_H */


/* -------------------- VVP Structures -------------------- */
#define VVP_ORDER  (6)		/* Maximum number of parameters in VVP model */
#define VVP_MORDER ((VVP_ORDER*(VVP_ORDER+1)) / 2)
#define VVP_MAX_INTERVALS (100) /* Max number of height intervals */
#define VVP_FITS  (22)		/* Number of wind fields for blind fits */

struct vvp_pass_final8
{
  int iztotal ;			 /* # of terms contributing to Z sums */
  char ipad4x4[4] ;
  double dZLinSumSq, dZLinSum ;  /* Sum of Z and Z squared in linear space */
  double dZLogSumSq, dZLogSum ;	 /* Sum of dBZ and dBZ squared in log space */
  double dvsumsq ;	         /* Sum of velocity squared terms */
  double dmatrix[VVP_MORDER] ;	 /* Upper triangular matrix terms */
  double dvector[VVP_ORDER] ;	 /* Velocity vector terms */
};

struct vvp_pass_unfolding8
{
  double mj11, mj22, mj12 ;
  double dsums[VVP_FITS][3] ;
};

struct vvp_interval_info8	/* Information about each height interval */
{
  struct vvp_pass_unfolding8 fits ;
  struct vvp_pass_final8 vvp ;
  double dznom ;			 /* Nominal height in km */
  double du, dv ;		         /* (u,v) approximation for unfolding*/

  int iadded, itotal ;		         /* # of terms added and total count */
  int iquota ;			         /* Desired # of terms to add */
  char ipad588x4[4] ;
} ;

#define VVP_BIN_INFO_SIZE (16)
struct vvp_bin_info8		/* Information about each bin in a ray */
{
  double drange ;			     /* Range in km of this bin */
  struct vvp_interval_info8 *interval_info ;  /* ==> Interval structure for this bin */
  char ipad12x4[4] ;
} ;

#define VVP_RAY_INFO_SIZE (12)
struct VVP_Ray_Info
{       /* Information about each ray in a sweep */
  FLT4 fcos, fsin ;			  /* Cosine and Sine of Ray azimuth */
  UINT2 iraynum ;		          /* Number of ray within file */
  char ipad10x2[2] ;
} ;

/* - - - - - Cross Section Column Information Table - - - - - */
struct XSECT_Column_Info {
  SINT4 iheight ;		/* Height of data point in pixels*16 */
  UINT2 idata ;			/* Data value at the above height */
  char ipad6x2[2] ;
  FLT4  fMinDetectable;         /* Minimum detectable value in user units */
} ;

/* - - - - - CAPPI Conversion Table - - - - - */
struct CAPPI_Convert
{
  UINT1 iflags ;		/* Processing flags */
#define CCFLG_LOWSWEEP 0x01	/*   Use single low sweep, rather than both */

  UINT1 iswp ;			/* Sweep # of lower ray, and byte offset */
  SINT2 ioff_a, ioff_b ;	/*  into lower and upper rays            */
  UINT2 imul_a ;		/* Multiplier for (a1,a2) interpolation */
  UINT2 imul_b ;		/* Multiplier for (b1,b2) interpolation */
  UINT2 imul_ab ;		/* Multiplier for (a,b) interpolation   */
  UINT2 ivnorm_a, ivnorm_b ;    /* Velocity normalizing multipliers, if non zero */
  FLT4  fmul_ab;                /* Floating version of imul_ab */
  FLT4  fGradient;              /* Gradient in user units/inter-elevation height */
  FLT4  fMinDetectable;         /* Minimum detectable value in user units */
} ;

#define VIL_CONVERT_SIZE (204)
struct VIL_Convert {
  UINT2 inswps ;		 /* Number of sweeps to consider */
  char  ipad2x2[2];
  UINT1 iswps[NUM_GPPI_SWEEPS] ; /* Sweep numbers themselves */
  SINT2 ioffs[NUM_GPPI_SWEEPS] ; /* Offsets of bins in each ray */
  UINT2 imuls[NUM_GPPI_SWEEPS] ; /* Multipliers for each bin */
} ;

/* Structure used to control range and elevation shear */
#define MAX_WINDOW_SIZE (15)         /* Max window width */
struct shear_range_convert
{
  SINT4 irng_conv ;                  /* Multiplier: velocity diff --> shear units */

  UINT1 lRngDiscardPositive;         /* Discard positive radial shear */
  char  ipad_5x3[3];
  FLT4  fel_conv1, fel_conv2 ;       /* Conversion multipliers */
  FLT4  *pelcorr ;		     /* ==> Elevation shear correction table */

  FLT4  fbin_start;                  /* Range start in bins */
  UINT4 iwindow_size;		     /* Window stats for smoothing in range */
  SINT4 iwindow[MAX_WINDOW_SIZE];
  UINT1 *pray1, *pray2 ;             /* ==> temporary ray buffers, sized MAX_BINS-1 */
  UINT1 *pvct1, *pvct2 ;             /* ==> velocity clutter filtered rays */
} ;

/* Structure used to control azimuthal shear */
struct shear_az_convert8
{
  SINT4 iray_count;
  SINT4 ibin_count;
  UINT4 lfullcircle ;		     /* Data rays span a full circle */
  FLT4  faz_step;                     /* Azimuth step in radians */
  FLT4  fbin_start;                  /* Range start in bins */
  FLT4  faz_start;		     /* Azimuth start in radians */
  UINT4 iwindow_size;		     /* Window stats for smoothing in AZ */
  SINT4 iwindow[MAX_WINDOW_SIZE];
  UINT1 *pazheap ;		     /* ==> internal memory for shear computation */
  SINT4 iheap_size, iheap_rays ;     /* # of rays in heap is widened by window */
  UINT1 *pTempAzRay;                 /* ==> temporary ray buffer, sized MAX_INGEST_RAYS+MAX_WINDOW_SIZE */
} ;

struct shear_vvp_convert
{
  struct polynomial xpoly, ypoly ;  /* Best fits to mean wind */
};

struct shear_convert8
{
  UINT1 lRangeValid;     /* Radial shear is being computed */
  UINT1 lElValid ;       /* Elevation shear is being computed */
  UINT1 lAzValid;        /* Azimiuth shear is being computed */
  UINT1 lVvpValid;       /* VVP based mean wind correction is being used */
  UINT1 *pBuffers;       /* Pointer to heap used for buffers */
  struct shear_az_convert8    Azs[NUM_GPPI_SWEEPS];
  struct shear_range_convert  Ranges[NUM_GPPI_SWEEPS];
  struct shear_vvp_convert    Vvp;       /* VVP Profile used for az and el shear */

  UINT4               iFlags;    /* Shear flags */
  FLT4                fAzSmooth; /* Azimuth smoothing in degrees */
};

#define TOPS_CONVERT_SIZE (208)
struct tops_convert
{
  SINT4 imindetect ;		 /* Min Z (8 times Z byte units) */
  UINT2 inswps ;		 /* Number of sweeps to consider */
  char ipad6x2[2] ;
  SINT2 ioffs[NUM_GPPI_SWEEPS] ; /* Offsets of bins in each ray */
  UINT2 ihgts[NUM_GPPI_SWEEPS] ; /* Heights of each bin in Km*640 */
  UINT1 iswps[NUM_GPPI_SWEEPS] ; /* Sweep numbers themselves */
} ;

struct sri_convert
{
  struct tops_convert Tops;      /* Tops structure makes it easier to call tops */
  UINT2 iSweepsData ;		 /* Number of sweeps to consider for data */
  UINT2 iTerrainBin;             /* Terrain map range bin to use, if any */
  FLT4  fProfile[NUM_GPPI_SWEEPS] ; /* Widened profile values */
} ;

union generic_convert
{
  struct CAPPI_Convert Cappi[GPPI_CONV_SIZE];
  struct sri_convert   Sri[GPPI_CONV_SIZE];
  struct tops_convert  Tops[GPPI_CONV_SIZE];
  struct VIL_Convert   Vil[GPPI_CONV_SIZE];
  struct shear_convert8 Shear;
};

struct warn_prod_stats 
{
  struct product_hdr const * pPHdr;  /* Ptr to input product header, data may not follow */
  UINT1 const *pData;               /* Ptr to input data */
  SINT4 isize, ichan ;        /* Open file parameters */
  SINT4 iResolution ;	      /* Data resolution, 0 if no data */
} ;

/* Table used to convert data to R */
struct rainrate_table
{
  UINT2 iTable[256];
};

/* Function prototypes follow */

/* Take the absolute value of a velocity array */
void AbsVelocity                /* File: comp.C */
( UINT1 *pOutData_a,
  SINT4 iOutDataBytes_a );

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE BeamKernel              /* File: beam.C */
(const struct ingest_header *ihd_a,
 SINT2 inum_a,
 struct product_hdr *phed_a,  /* Sun position gets filled in */
 UINT1 *ioutput_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void bump_scheduling_times      /* File: product.h */
(volatile struct psc_entry *entry_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

void cappi_convert              /* File: cappi_c.c */
  (const struct CAPPI_Convert *conv_a,
   SINT2 count_a, 
   const UINT1 * const rays_a[], 
   const SINT2 *lengths_a,
   const struct GPPI_Global8 *pGlobal_a, 
   UINT1 *out_a );

void cappi_convert_rain         /* File: cappi_c.c */
  (const struct CAPPI_Convert *conv_a,
   SINT2 count_a, 
   const UINT1 * const rays_a[], 
   const SINT2 *lengths_a,
   const struct GPPI_Global8 *pGlobal_a, 
   UINT2 *out_a,
   const struct rainrate_table *pRainTable_a,
   BIN2 iAngle_a );  /* Insertion angle, used for debugging */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE CappiKernel           /* File: cappi.C */
(const struct ingest_header sum_a[],
 SINT2 inum_a,
 const char sprod_a[40],
 const struct product_hdr *phed_a,
 UINT1 *ioutput_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void cappi_schedule
(volatile struct psc_entry *pentry_a,
 SINT2 *ingd_num_a,		  /* Number of major tasks found */
 SINT4 ingd_index_a[3],
 SINT2 *prod_num_a,		  /* Number of product files found (either 0 or 1) */
 volatile struct one_product_file **pProdFile_a, /* returns Pointer to product file */
 struct ymds_time *epoch_time_a,  /* Updated epoch time */
 struct ymds_time *ing_time_a);   /* Updated ingest time */
#endif  /* #ifdef SIGMET_PRODUCT_H */

void cappi_table_gen            /* File: cappi.C */
(const struct GPPI_Global8 *global_a,
 const struct GPPI_Sweep  sweeps_a[],
 struct CAPPI_Convert *conv_a,
 SINT2 ilimits_a[2]
);

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_SETUP_H
void catch_file_add             /* File: catch.c */
  (const UINT2 *in_a,
   const struct product_hdr *pHead_a,
   UINT1 lAdd_a,  /* False for the first call */
   struct catch_loop *pCatch_a,
   SINT4 iAge_a );
#endif  /* #ifdef SIGMET_SETUP_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE catch_prod              /* File: catch.c */
  (volatile const struct product_configuration *pcf_a,
   const char sprod_a[PRODUCT_INPUTS][40],
   volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS],
   SINT2 ipnum_a,
   struct product_hdr *phdr_a,
   char *sfile_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

MESSAGE check_protected_regions /* File: sline.c */
(void);

#ifdef SIGMET_HEADERS_H
typedef void (*GET_POINTER_PROC) \
     (SINT4 iray, void **ptr, BIN2 *angle, SINT2 *icnt, UINT2* last, \
      struct GPPI_Global8 *global_a, const struct GPPI_Sweep sweeps_a[], \
      const union generic_convert *pConv_a, \
      UINT2 iRayStorage[2][MAX_BINS], const struct rainrate_table *pTable );
#endif  /* #ifdef SIGMET_HEADERS_H */

#ifdef SIGMET_PRODUCT_H
UINT1 lCompareCenterLocation    /* File: dwell.C */
( const struct product_hdr *pPhdr1_a,
  const struct product_hdr *pPhdr2_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
UINT1 lCompareProjection        /* File: dwell.C */
( const struct product_hdr *pPhdr1_a,
  const struct product_hdr *pPhdr2_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void CompDwellSchedule          /* File: dwell.C */
(volatile struct psc_entry *entry_a, /* Product schedule entry */
 SINT2 *pProdNum_a,               /* Number of product files, zero means do not run */
 volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS], /* Array of product pts */
 struct ymds_time *pEpochTime_a,  /* Current starting time, possibly updated */
 UINT4 iSiteNumber_a,             /* Site to schedule for */
 UINT1 iPType_a,
 const char sPName_a[12],
 SINT4 iTimeSpan_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE comp_prod
(volatile const struct product_configuration *pcf_a, /* Product configuration to make */
 const char sprod_a[][40],   /* Array of input product names */
 SINT2 iNum_a,               /* Number of input products */
 struct product_hdr *phdr_a, /* Header of produced product */
 char *sfile_a );            /* Name of product file that was produced */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void comp_schedule
(volatile struct psc_entry *entry_a,
 SINT2 *iprd_num_a,             /* Number of product files, zero means do not run */
 volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS],
 struct ymds_time *epoch_time_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void DrawSweep                /* File: insert_ray.C */
( GET_POINTER_PROC get_pointer_a,
  const FLT4 fbinscale[2],
  FLT4  fstart,
  SINT2 ibins,
  const struct product_configuration *pcf,
  SINT4 iresolution,
  UINT1 *ioutput,
  struct GPPI_Global8 *global_a, 
  const struct GPPI_Sweep sweeps_a[],
  const union generic_convert *pConv_a,
  UINT2 iRayStorage_a[2][MAX_BINS], 
  const struct rainrate_table *pRainTable_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE dwell_prod
( volatile const struct product_configuration *pcf_a, /* Product configuration structure */
  const char sprod_a[PRODUCT_INPUTS][40],  /* Array of product file names */
  SINT2  iProductInCnt_a,                  /* Number of inputs products required */
  struct product_hdr *phdr_a,              /* Header for file produced */
  char *sfile_a,                           /* Returns actual file name made */
  UINT2 *lWarningFound_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void dwell_schedule                  /* File: dwell.C */
(volatile struct psc_entry *pEntry_a, /* Product schedule entry */
 SINT2 *pProdNum_a,               /* Number of product files, zero means do not run */
 volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS], /* Array of product pts */
 struct ymds_time *pEpochTime_a ); /* Current starting time, possibly updated */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE fcast_prod             /* File: fcast.c */
  (volatile const struct product_configuration *pcf_a,
   const char sprod_a[2][40],
   struct product_hdr *phdr_a,
   char *sfile_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void fcast_schedule
( volatile struct psc_entry *entry_a,
  SINT2 *iprd_num_a,             /* Number of product files, zero means do not run */
  volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS],
  struct ymds_time *epoch_time_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void FillCompositeHeader  /* File: comp.c */
( struct product_hdr *phdr_a,                /* Header for file produced */
  struct cartesian_product *pInProducts_a[PRODUCT_INPUTS],
  SINT4 iProductInCnt_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_SETUP_H
FLT4 fuser_from_pix
 (UINT2 ipix_a,
  UINT2 idtype_a,
  const struct color_scale_def *colordef_a) ;
#endif

#ifdef SIGMET_INGEST_H
void get_az_info                /* File: ppi_c.c */
(const struct ray_header *pray_a,
 BIN2  *iazimuth_a,
 SINT2 *ibincnt_a );
#endif  /* #ifdef SIGMET_INGEST_H */

#ifdef SIGMET_INGEST_H
void get_el_info
(const struct ray_header *pray_a,
 BIN2  *ielevation_a,
 SINT2 *ibincnt_a );
#endif  /* #ifdef SIGMET_INGEST_H */

#ifdef SIGMET_HEADERS_H
void GetRayGppi                 /* File: gppi.c */
(SINT4 iray_a,
 void  **pointer_a,
 BIN2  *iangle_a,
 SINT2 *ibincnt_a,
 UINT2 *last_a,
 struct GPPI_Global8 *global_a, 
 const struct GPPI_Sweep sweeps_a[], 
 const union generic_convert *pConv_a,
 UINT2 iRayStorage_a[2][MAX_BINS],
 const struct rainrate_table *pRainTable_a);
#endif  /* #ifdef SIGMET_HEADERS_H */

#ifdef SIGMET_INGEST_H
void GetRayRhiRadShear
(SINT4 iray_a,
 void  **ppointer_a,
 BIN2  *iangle_a,
 SINT2 *ibincnt_a, 
 UINT2 *plast_a,
 struct GPPI_Global8 *Unused1_a,
 const struct GPPI_Sweep sweeps_a[], 
 const union generic_convert *pConv_a,
 UINT2 iRayStorage_a[2][MAX_BINS],
 const struct rainrate_table *pUnused_a);
#endif  /* #ifdef SIGMET_INGEST_H */

void gppi_close_files		/* File: gppi.c */
(const struct GPPI_Sweep sweeps_a[],
 UINT4 isweeps_a );

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
void GppiOpenFiles		/* File: gppi.C */
(const struct ingest_header ping_a[],
 SINT2 inum_a,
 UINT2 iData1_a,
 UINT2 iData2_a,
 struct GPPI_Sweep sweeps_a[NUM_GPPI_SWEEPS],
 SINT2 *isweeps_a,
 const FLT4 felimits_a[2] );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE GppiOpenOneSweep          /* File: gppi.c */
(const struct ingest_header *pIng_a,
 UINT2 iData1_a, UINT2 iData2_a,     /* Data types DB_NULL if unwanted */
 SINT4 iSweep_a,                 /* Sweep number, origin 1 */
 struct GPPI_Sweep *pSweep_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
void header_from_ingest         /* File: make_header.c */
  (struct product_hdr *phdr_a,
   const struct ingest_header *sum_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void header_from_product        /* File: make_header.c */
  (struct product_hdr *phdr_a,
   const struct product_hdr *input_phdr_a,
   SINT4 icount_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE i2d_checkup             /* File: i2d_prod_c.c */
(struct product_configuration *pcf,
 const struct ingest_header *ihd_a,
 UINT2 *lchanged_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE i2d_prod_many_prod      /* File: i2d_prod_c.c */
(volatile const struct product_configuration *pco_a,
 const char sprod_a[PRODUCT_INPUTS][40],  /* Array of product file names */
 volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS],
 SINT2 iprod_cnt_a,
 struct product_hdr *phdr_a,
 char *sfile_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE i2d_prod_one_ingest     /* File: i2d_prod_c.c */
(volatile const struct product_configuration *pco_a,
 const char ssum_a[3*INGEST_INPUTS][20],
 const char sprod_a[PRODUCT_INPUTS][40],
 struct product_hdr *phdr_a,
 char *sfile_a,           
 struct product_hdr **pfinal_a,
 const struct projection_configuration *proj_a,
 volatile const UINT2 *isch_a ) ;
#endif  /* #ifdef SIGMET_PRODUCT_H */

SINT2 ifind_sweep_angle         /* File: ppi_c.c */
(volatile const SINT2 *isweep_count_a,
 volatile const BIN2 iangle_list_a[],
 BIN2 *iangle_a );

#ifdef SIGMET_PRODUCT_H
MESSAGE ifind_sweep_pcf 	/* File: ppi_c.c */
(volatile const struct product_configuration *pcf,
 SINT2 *isweep_a,
 UINT4 isite_num_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE igppi_global_init       /* File: gppi.c */
(const struct ingest_header ping_a[],
 SINT2 inum_a,
 const struct product_hdr *phead_a,
 struct GPPI_Global8 *pglobal_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE imapopen_ingest_param   /* In ingest_subs.c */
  (const struct ingest_header *sum_a,
   SINT4 iswp_a,
   SINT4 idata_a,
   void **iaddr_a,
   SINT4 *isize_a,
   SINT4 *ichan_a) ;
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
      
#ifdef SIGMET_PRODUCT_H
MESSAGE indop_prod		/* File: ndop.c */
( volatile const struct product_configuration *pcf_a,
  const char ssum_a[INGEST_INPUTS][3][20],
  SINT2 ingd_num_a,
  struct product_hdr *phdr_a,
  char *sfile_a ) ;
#endif  /* #ifdef SIGMET_PRODUCT_H */

void insert_init_               /* File: insert_ray.c */
  (UINT4  xsize_a,
   UINT4  ysize_a,
   UINT1 *addr_a,
   UINT1  bwl_a,
   UINT1  unit_a );

void insert_ray                 /* File: insert_ray.c */
  (UINT4 xpos_a,
   UINT4 ypos_a,
   SINT4 xinc_a,
   SINT4 yinc_a,
   UINT1 *data_a,
   SINT4 count_a,
   SINT4 repi_a, 
   SINT4 reps_a,
   UINT1 unit_a );

#ifdef SIGMET_PRODUCT_H
MESSAGE iprod_image_motion
  (const struct product_hdr *phdr1_a,
   const struct product_hdr *phdr2_a,
   SINT4 ithresh_a,		/* Data "knee" point (in hundredths) */
   FLT4 flength_a,		/* Length in KM over which to correlate */
   FLT4 *fxvel_a,		/* Exit: X velocity in km/hr */
   FLT4 *fyvel_a);		/* Exit: Y velocity in km/hr */
#endif  /* #ifdef SIGMET_PRODUCT_H */

SINT4 iProductNext 		/* In file schedule_c.c */          
( SINT4 index_a,
  UINT4 iSite_a );

SINT4 iProductPrevious 		/* In file schedule_c.c */          
( SINT4 index_a,
  UINT4 iSite_a );

#ifdef SIGMET_PRODUCT_H
SINT4 iprod_to_run              /* In file schedule_c.c */
(struct ymds_time *epoch_time_a,
 struct ymds_time *ing_time_a,
 SINT2 *ingd_num_a,
 SINT4 ingd_a[INGEST_INPUTS][3],
 SINT2 *iprd_num_a,
 volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS] );
#endif  /* #ifdef SIGMET_PRODUCT_H */

SINT4 iproduct_search           /* File: schedule_c.c */
(const struct ymds_time *time_a,
 UINT2 iptype_a,
 volatile const char sprod_a[12],
 UINT4 isite_a,     /* Site number, -1 means don't care */
 UINT2 lforward_a );

#ifdef SIGMET_PRODUCT_H
MESSAGE irain1_kernel           /* File: rain_c.c */
(const char sprod_a[][40],
 volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS],
 SINT2 iprod_cnt_a,
 struct product_hdr *phed_a,
 UINT2 ioutput_a[] );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE irainn_kernel
(const char sprod_a[][40],
 SINT2 iprod_cnt_a, 
 struct product_hdr *phed_a,
 UINT2 ioutput_a[] );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_MISC_LIB_H
void *iSmoothDataPanel        /* File: i2d_prod.C */
( void *in_a,
  void *ibuf_a,
  FLT4 fxwidth_a, 
  FLT4 fywidth_a,
  SINT4 ixsize_a, 
  SINT4 iysize_a,
  SINT4 ixpos_a, 
  SINT4 iypos_a,
  SINT4 iyline_a,
  UINT2 idata_a,
  struct filter_info *info_a,
  SINT4 iCoverage_a,      /* Coverage factor 0-255 */
  SINT4 iSkipControl_a ); /* Skip control, 0=none */
#define NO_SKIP (0)
#endif /* #ifdef SIGMET_MISC_LIB_H */

#ifdef SIGMET_MISC_LIB_H
const void *iSmoothDataSimple       /* File: i2d_prod.C */
( const void *in_a,
  void *ibuf_a,
  FLT4 fxwidth_a, 
  FLT4 fywidth_a,
  SINT4 ixsize_a, 
  SINT4 iysize_a,
  SINT4 ixpos_a, 
  SINT4 iypos_a,
  SINT4 iyline_a,
  UINT2 idata_a,
  struct filter_info *info_a );
#endif /* #ifdef SIGMET_MISC_LIB_H */
  

#ifdef SIGMET_PRODUCT_H
void *ismooth_data_product      /* File: i2d_prod.C */
(const struct product_configuration *pcf_a, 
 void *input_a,
 void *ibuffer_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

UINT1 iTopsConvertOne           /* File: tops.C */
(const struct tops_convert *pConv_a,
 const UINT1 * const rays_a[NUM_GPPI_SWEEPS],
 const SINT2 lengths_a[NUM_GPPI_SWEEPS],
 SINT4 iZThresh_a,
 UINT1 lNoTop_a );
      
#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE ivvp_prod_int           /* File: vvp_c.c */
  (const struct vvp_psi_struct *vvpsi_a,
   const struct ingest_header *ismy_a,
   struct GPPI_Sweep *sweeps_a,
   SINT4 isweeps_a,
   SINT2 iReferenceOffset_a,    /* Offset between radar and zero height */
   struct vvp_results *results_a ) ;
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE ivvp_open_files         /* File: vvp_c.c */
  (const struct ingest_header *ismy_a,
   SINT4 ismynum_a,
   struct GPPI_Sweep *sweeps_a,
   SINT4 *isweeps_a,
   FLT4 fmaxel_a ) ;
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */

#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE ivvp_read_and_check_smy	/* File: vvp_c.c */
  (const char ssum_a[3][20],
   struct ingest_header *ismy_a,
   SINT4 *ismynum_a ) ;
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_PROJECTION_H
SINT4 iwarn_coalesce_regions	/* File: warn_c.c */
  (struct warning_results results_a[],
   struct warning_aux_results8 aux_a[],
   SINT4 icount_a,
   const struct mpj_projection8 *proj_a,
   const struct mpj_region8 *region_a,
   FLT4 fMinSeparation_a ) ;    /* Distance in km */
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE iwarn_one_input         /* File: warn_c.c */
  (volatile const union product_specific_info *psi_a,
   const struct product_hdr *in_phdr_a,
   SINT2 ipnum_a,
   SINT2 islot_a,
   struct product_hdr *phdr_a,
   UINT1 **parea_a,
   UINT1 *ivvp_results_a,
   SINT4 *iResolution_a ) ;  /* Resolution in bits/pixel, zero means n/a */
#endif  /* #ifdef SIGMET_PRODUCT_H */

UINT1 lDataCanComposite         /* File: comp.C */
( UINT2 iDType_a );

#ifdef SIGMET_HEADERS_H
UINT1 limmediate_prod           /* File: schedule.C */
( SINT2 iptype_a,
  volatile const PSI *psi_a ) ;
#endif  /* #ifdef SIGMET_HEADERS_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE load_immediate_angles   /* File: i2d_prod_c.c */
( struct product_configuration *pcf_a,
  const struct ingest_header *sum_a,
  SINT2 *isweep_a ) ;		/* Sweep index to use */

MESSAGE LoadImmediateShear
( struct product_configuration *pcf_a,
  const struct ingest_header *sum_a,
  SINT2 *psweep_a,    /* Sweep index to use */
  UINT1 lImmediate_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_H
MESSAGE load_projection_file    /* File: i2d_prod_c.c */
(struct product_hdr *phdr_a,
 const struct ingest_header *pIhdr_a,
 const struct projection_configuration *proj_a ) ;
#endif  /* #ifdef SIGMET_INGEST_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_H
MESSAGE load_projection_file2
(struct product_hdr *phdr_a,                 /* Region def fields to be loaded */
 const struct ingest_header *pIhdr_a,        /* Input ingest header, NULL ok */
 const struct product_hdr *pPhdr_a );     /* Optional Input product header */
#endif  /* #ifdef SIGMET_INGEST_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

UINT1 lStopProduct(void);       /* File: product.C */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
#ifdef SIGMET_MISC_LIB_H
MESSAGE make_any_projection     /* File: projection.C */
(struct product_hdr *phdr_a,           /* .pcf section already filled in */
 const struct ingest_header ihdr_a[3], /* Array of ingest headers */
 SINT2 inum_a,                         /* Number of ingest_headers available */
 const char sprod_a[40],
 UINT1 *pdata_a,
 volatile const UINT2 *isch_a,
 SINT2 isweep_a );
#endif  /* #ifdef SIGMET_MISC_LIB_H */
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE MaxKernel		/* File: maximum.C */
(const struct ingest_header *sum_a,
 SINT2 inum_a,
 const struct product_hdr *phed_a,
 UINT1 ioutput_a[] );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

void MergeAverage          /* File: comp.C */
(UINT1 *pOutData_a,
 UINT1 *pInData_a[PRODUCT_INPUTS],
 SINT4 iSizeInPixels_a,
 SINT4 iProductInCnt_a,
 UINT4 iData_a,              /* Data type */
 const struct data_convert *pConvert_a );

void MergeMaximum          /* File: comp.C */
(UINT1 *pOutData_a,
 const UINT1 *pInData_a,
 SINT4 iSizeInPixels_a,
 UINT4 iData_a,            /* Data type */
 const struct data_convert *pConvert_a );


#ifdef SIGMET_PRODUCT_H
void ndop_schedule       /* File: ndop.c */
( volatile const struct psc_entry *pentry_a,
  SINT2 *ingd_num_a,		     /* Number of major tasks found (>= 2) */
  SINT4 ingd_index_a[INGEST_INPUTS][3],
  struct ymds_time *epoch_time_a ) ; /* Updated epoch time */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void pcf_from_product
  (struct product_configuration *pcf_a,
   const struct product_hdr *inphdr_a) ;
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE PpiAndRhi
(const struct ingest_header *ingsum_a,
 const struct product_hdr *pheader_a,
 UINT1 ioutput_a[],
 SINT2 isweep_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_SETUP_H
#ifdef SIGMET_PROJECTION_H
SINT4 process_cartesian_warning /* File: warn_c.c */
(SINT4 imin_area_a,
 UINT1 *iarea_a,
 const struct product_configuration *pPcf_a,  /* Input PFC holding geometry */
 const struct mpj_projection8 *proj_a,
 const struct mpj_region8 *region_a,
 struct warning_results results_a[],
 struct warning_aux_results8 aux_a[],
 SINT4 imax_warnings_a,
 volatile const struct one_protected_region prot_a[],
 SINT4 iorder_a,
 const struct warn_prod_stats wpstats_a[] ) ;
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_SETUP_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_PROJECTION_H
MESSAGE ProcessInputRain1s      /*File: rain_c.c */
( const char sprod_a[][40],     /* Array of product file names */
  SINT2 iprod_cnt_a,            /* Number of input products */
  struct product_hdr *phed_a,
  union rain1_loop_results *pResults_a );
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_HEADERS_H
void product_scheduler_args
( volatile const char stname_a[12],
  volatile const PSI *psi_a,
  UINT4 iptype_a,
  UINT4 isite_num_a,
  SINT2 *ingd_num_a,
  SINT4 ingd_index_a[3],
  struct ymds_time *epoch_time_a,
  struct ymds_time *ing_time_a,
  UINT2 *ldone_a ) ;
#endif  /* #ifdef SIGMET_HEADERS_H */

#ifdef SIGMET_PRODUCT_H
void product_scheduler          /* In file schedule_c.c */
( volatile const struct psc_entry *pentry_a,
  SINT2 *ingd_num_a,
  SINT4 ingd_index_a[3],
  struct ymds_time *epoch_time_a,
  struct ymds_time *ing_time_a,
  UINT2 *ldone_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void Rain1GageCorrection        /* In file rain_c.c */
( char *sRain1File_a,   /* Rain1 filename must be changed to reflect the output */
  const char sGageFile_a[40],
  volatile const struct one_product_file *pFile_a,  /* Pointer to gage file */
  const struct product_hdr *pPHeader_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void rainrate_table_gen         /* In file cappi_c.c */
  (const struct product_hdr *phead_a,
   struct rainrate_table *pRainTable_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void rain1_schedule             /* File: rain_c.c */
( volatile struct psc_entry *pentry_a,
  SINT2 *iprd_num_a,
  volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS],
  struct ymds_time *nominal_time );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void rainn_schedule             /* File: rain_c.c */
( volatile struct psc_entry *pentry_a,
  SINT2 *iprd_num_a,
  volatile struct one_product_file *pFiles_a[PRODUCT_INPUTS],
  struct ymds_time *nominal_time );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE raw_prod               /* File: raw_c.c */
(volatile const struct product_configuration *pcf_a,
 const char ssum_a[20],
 struct product_hdr *phdr_a,
 char sfile_a[] );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_PROJECTION_H
MESSAGE ReprojectProduct       /* File: projection.C */
( const struct product_hdr     *pInHeader_a,
  const UINT1                  *pInData_a,      /* Input data */
  const struct product_hdr     *pOutHeader_a,
  UINT1                        *pOutData_a,     /* Output data */
  const struct mpj_projection8 *pOutProjection_a,
  const struct mpj_region8     *pOutRegion_a,
  SINT4                         iSurfaces_a );
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE RtiKernel
(const struct ingest_header *ingsum_a, /* The ingest summary for the ingest data */
 struct product_hdr *pheader_a,        /* The product header, partially filled in already. */
 UINT1 *ioutput_a,                     /* The output array */
 SINT2 isweep_a );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE ShearFillConv
( struct shear_convert8 *pConv_a,
  const struct product_hdr   *phed_a,
  const struct GPPI_Global8  *pGlobal_a,
  const struct GPPI_Sweep     Sweeps_a[],
  const char sprod_a[40] );                  /* Name of VVP product file */
#endif  /* #ifdef SIGMET_PRODUCT_H */

void ShearEmptyConv
( struct shear_convert8     *pConv_a,
  const struct GPPI_Global8 *pGlobal_a );

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE ShearKernel             /* File: shear.C */
(const struct ingest_header *sum_a,
 const char sprod_a[40],
 const struct product_hdr *phed_a, 
 UINT1 ioutput_a[],
 SINT2 ispeep_a ) ;
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE ShearBuildSweep
( struct GPPI_Global8       *pGlobal_a,
  const struct GPPI_Sweep    Sweeps_a[],
  UINT1 *pOutput_a,          /* Cartesian data output here */
  const struct product_configuration *pPcf_a,
  const union generic_convert *pShearConv_a,
  SINT4 *pDataHitCount_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void shear_schedule            /* File: shear_c.c */
( volatile struct psc_entry *pentry_a,
  SINT2 *ingd_num_a,		  /* Number of major tasks found (either 0 or 1 ) */
  SINT4 ingd_index_a[3],
  SINT2 *prod_num_a,		  /* Number of product files found (either 0 or 1) */
  volatile struct one_product_file **pFile_a, /* Pointer to product file */
  struct ymds_time *epoch_time_a, /* Updated epoch time */
  struct ymds_time *ing_time_a);  /* Updated ingest time */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE sline_prod
(volatile const struct product_configuration *pcf_a,
 const char ssum_a[20],
 const char sprod_a[2][40],
 struct product_hdr *phdr_a, 
 char sfile_a[80] );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void SriConvert                 /* File: sri.C */
(const struct sri_convert *conv_a,
 BIN2  iAzimuth_a,
 SINT2 count_a,
 const UINT1 * const rays_a[GPPI_MOMENTS][NUM_GPPI_SWEEPS],
 const SINT2 *lengths_a,
 struct GPPI_Global8 *pGlobal_a,
 UINT1 *out_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void SriConvertRain
(const struct sri_convert *conv_a,
 BIN2  iAzimuth_a,
 SINT2 iCount_a,
 const UINT1 * const pRayData_a[GPPI_MOMENTS][NUM_GPPI_SWEEPS],
 const SINT2 lengths_a[NUM_GPPI_SWEEPS],
 struct GPPI_Global8 *pGlobal_a,
 UINT2 *out_a,
 const struct rainrate_table *pRainTable_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE SriKernel               /* File: sri.C */
(const struct ingest_header *sum_a,
 SINT2 inum_a,
 struct product_hdr *phed_a,
 UINT1 ioutput_a[] );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

void tops_convert               /* File: tops.C */
(const struct tops_convert *conv_a,
 SINT2 count_a,
 const UINT1 * const rays_a[],
 const SINT2 *lengths_a,
 const struct GPPI_Global8 *pGlobal_a,
 UINT1 *out_a );

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE TopsKernel
(const struct ingest_header *sum_a,
 SINT2 inum_a,
 const struct product_hdr *phed_a,
 UINT1 ioutput_a[] );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_SETUP_H
MESSAGE track_prod
  (volatile const struct product_configuration *pcf_a,
   const char sprod_a[3][40],
   struct product_hdr *phdr_a,
   char *sfile_a,
   volatile const struct one_protected_region prot_a[],
   UINT2 *lwarning_found_a );
#endif  /* #ifdef SIGMET_SETUP_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

void vil_convert                /* File: vil.C */
(const struct VIL_Convert *conv_a,
 SINT2 count_a,
 const UINT1 * const rays_a[],
 const SINT2 *lengths_a,
 const struct GPPI_Global8 *global_a,
 const struct rainrate_table *pWaterTable_a,
 UINT2 *out_a );

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE VilKernel              /* File: vil.C */
(const struct ingest_header *sum_a,
 SINT2 inum_a,
 const struct product_hdr *phed_a,
 UINT1 ioutput_a[] );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE vvp_prod               /* File: vvp_c.c */
(volatile const struct product_configuration *pcf_a,
 const char ssum_a[3][20],
 struct product_hdr *phdr_a,
 char *sfile_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

void warn_byte_merge		/* File: warn.C */
(const UINT1* words_a,   /* WORDS_A  ==> Array of bytes */
 SINT4 ixsize_a,
 SINT4 iysize_a,
 SINT4 ixskip_a,
 UINT1 iwthresh_a,
 UINT1 lLessThan_a,
 UINT1 imax_a,
 UINT1 imask_a,
 UINT1* output_a );

void warn_byte_merge_simple      /* File: warn.C */
(const UINT1* bytes_a, /* BYTES_A  ==> Array of bytes */
 SINT4 ixsize_a,       /* X dimension of the data array */
 SINT4 iysize_a,       /* Y dimension of the data array */
 UINT1 iwthresh_a,     /* Threshold value */
 UINT1 lLessThan_a,    /* Direction of comparison */
 UINT1 imask_a,        /* Mask to OR into output array */
 UINT1* output_a );    /* Output byte array */

void warn_filter		/* File: warn_c.c */
(UINT1 *array_a,
 SINT4 xsize_a,
 SINT4 ysize_a,
 UINT1 test_a,
 UINT1 set_a );

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_SETUP_H
MESSAGE warn_prod              /* File: warn_c.c */
  (volatile const struct product_configuration *pcf_a,
   const char sprod_a[3][40],
   SINT2 ipnum_a,
   struct product_hdr *phdr_a,
   char *sfile_a,
   volatile struct one_protected_region prot_a[],
   UINT2 *lwarning_found_a );
#endif  /* #ifdef SIGMET_SETUP_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

void warn_region_finder		/* File: warn_c.c */
(UINT1 *image_a,  /* Array is cleared while region is found */
 SINT4 xsize_a,
 SINT4 ysize_a,
 SINT4 point_a,
 SINT4 maxxy_a,
 UINT2 *xypts_a,
 SINT4 *xycount_a,
 SINT4 *xyfull_a );

#ifdef SIGMET_PRODUCT_H
MESSAGE wind_prod		/* File: wind.c */
  (volatile const struct product_configuration *pcf_a,
   const char ssum_a[3][20],
   struct product_hdr *phdr_a,
   char *sfile_a) ;
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void WriteDiagnosticMask	/* File: sline.c */
(const struct product_hdr *phdr_a,
 const UINT1 *parea,
 const char  *sSuffix_a);
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE XsectKernel             /* File: xsect.C */
(const struct ingest_header *sum_a,
 SINT2 inum_a,
 const struct product_hdr *phed_a,
 UINT1 ioutput_a[] );
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#endif  /* #ifndef MESSAGE_ONLY */
