include include "vpthit.h" define NCOL 19 # vpt_out -- write the result of vpthit to an output table # # Description: # ------------ # # Version Date Author Description # 1 05-19-87 J.-C. Hsu design and coding # 2 09-09-87 J.-C. Hsu new F77 interface # 3 11-09-90 J.-C. Hsu rewrite in SPP #------------------------------------------------------------------------------- procedure vpt_out (tbname, root, scheme, rate, drate, exclude, sigmas, dthresh, athresh, smpltm, epoch, tp, nrows, initial) char tbname[SZ_FNAME] # input: output table name char root[SZ_ROOT], scheme[SZ_SCHEME] real rate[NFILES], drate[NFILES] int exclude[NFILES] real sigmas, athresh, dthresh real smpltm[*] double epoch char colnam[SZ_COLNAME, NCOL], unit[SZ_COLUNITS, NCOL] char colfmt[SZ_COLFMT, NCOL] # column name(s), unit(s), and format(s) int dtype[NCOL] # number of columns, data types pointer tp # output: pointer to table descripter pointer colidn[NCOL] # output: pointers to column descripters real rbuff[20] int ibuff[10] int nrows # number of rows existed in output table int i bool initial int strsearch() #------------------------------------------------------------------------------ begin # initialize column attributes if first time if (initial) { # define the column names call strcpy ("ROOTNAME", colnam[1, 1], SZ_COLNAME) call strcpy ("SCHEME", colnam[1, 2], SZ_COLNAME) call strcpy ("DOBJ", colnam[1, 3], SZ_COLNAME) call strcpy ("DSKY", colnam[1, 4], SZ_COLNAME) call strcpy ("AOBJ", colnam[1, 5], SZ_COLNAME) call strcpy ("ASKY", colnam[1, 6], SZ_COLNAME) call strcpy ("DOBJ_ERR", colnam[1, 7], SZ_COLNAME) call strcpy ("DSKY_ERR", colnam[1, 8], SZ_COLNAME) call strcpy ("AOBJ_ERR", colnam[1, 9], SZ_COLNAME) call strcpy ("ASKY_ERR", colnam[1, 10], SZ_COLNAME) call strcpy ("DTHRESH", colnam[1, 11], SZ_COLNAME) call strcpy ("ATHRESH", colnam[1, 12], SZ_COLNAME) call strcpy ("OBJ_SAMPTIME",colnam[1, 13], SZ_COLNAME) call strcpy ("SKY_SAMPTIME",colnam[1, 14], SZ_COLNAME) call strcpy ("DOBJ_REMOVED",colnam[1, 15], SZ_COLNAME) call strcpy ("DSKY_REMOVED",colnam[1, 16], SZ_COLNAME) call strcpy ("AOBJ_REMOVED",colnam[1, 17], SZ_COLNAME) call strcpy ("ASKY_REMOVED",colnam[1, 18], SZ_COLNAME) call strcpy ("EPOCH", colnam[1, 19], SZ_COLNAME) # define the data type dtype[1] = -SZ_ROOT dtype[2] = -SZ_SCHEME do i = 3, 14 dtype[i] = TY_REAL do i = 15, 18 dtype[i] = TY_INT dtype[19] = TY_DOUBLE # define the units do i = 1, NCOL unit[1, i] = EOS # define the column print format do i = 1, NCOL colfmt[1, i] = EOS call outtbl_init (tbname, colnam, unit, colfmt, dtype, NCOL, tp, colidn, nrows) } # define the contents of output columns do i = 1, NFILES { rbuff[i] = rate[i] rbuff[i+NFILES] = drate[i] } if (strsearch (scheme, "stat") > 0) { rbuff[9] = sigmas rbuff[10] = sigmas } else { rbuff[9] = dthresh rbuff[10] = athresh } rbuff[11] = smpltm[1] rbuff[12] = smpltm[2] do i = 1, NFILES { ibuff[i] = exclude[i] } # write one row of vpthit result iferr { call tbrptt (tp, colidn[1], root, SZ_ROOT, 1, nrows+1) call tbrptt (tp, colidn[2], scheme, SZ_SCHEME, 1, nrows+1) call tbrptr (tp, colidn[3], rbuff, 12, nrows+1) call tbrpti (tp, colidn[15], ibuff, 4, nrows+1) call tbrptd (tp, colidn[19], epoch, 1, nrows+1) } then { call eprintf ("cannot write column %d to output table\n") call pargi(nrows+1) call error (1, "") } end