/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:08 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "issta2.h" #include #include /*++D Default ctypec = "double," *++S Default ctypec = "float, " *++ Replace "float, " = ctypec *++ CODE for .C. is active */ void sprpl(float, byte,byte[],long,float, float, LOGICAL32); /* PARAMETER translations */ #define NLEN 30 /* end of PARAMETER translations */ void /*FUNCTION*/ issta2( long istats[], float xstats[], long ihist[], long ilow, long ncells) { char image[31]; long int i, ival, maxcnt; float flmaxc; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const Ihist = &ihist[0] - 1; long *const Istats = &istats[0] - 1; float *const Xstats = &xstats[0] - 1; /* end of OFFSET VECTORS */ /*++ END * Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>> 2001-03-30 ISSTA2 Krogh Change for C conversion. *>> 1995-07-09 ISSTA2 Krogh Small modification for C conversion. *>> 1994-10-20 ISSTA2 Krogh Changes to use M77CON *>> 1994-06-22 ISSTA2 CLL Changed name to I[D/S]STA2. *>> 1989-04-26 ISTAT2 CLL Changed to use SPRPL instead of PRPL. *>> 1987-11-24 ISTAT2 Lawson Initial code. * * This subr produces a printer-plot of a histogram and prints * statistics given in ISTATS() and XSTATS(). It is * intended for use following the building of a histogram and * computation of statistics by ISTAT1. * See ISTAT1 for description of the subroutine arguments. * C. L. Lawson and S. Y. Chiu, JPL, Apr 1987. * ------------------------------------------------------------------ *--S replaces "?": I?STA2, ?PRPL *++D Default ctype = "(double)" *++ Default ctype = " (float)" *++ Replace " (float)" = ctype * ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ * Get max count to scale the plot. */ maxcnt = 0; for (i = 1; i <= ncells; i++) { maxcnt = max( Ihist[i], maxcnt ); } /* The following stmt converts from integer to float. */ flmaxc = maxcnt; printf(" VALUE COUNT PLOT OF COUNT\n"); if (Ihist[1] != 0) { /*++ CODE for .C. is active */ sprpl( (float)( Ihist[1] ), '*', image, NLEN, 0.e0, flmaxc, TRUE ); printf(" <%8ld%10ld %s\n", ilow, Ihist[1], image ); /*++ CODE for ~.C. is inactive * call SPRPL(real(IHIST(1)),'*',IMAGE,NLEN,0.E0,FLMAXC,.TRUE.) *++ End */ } ival = ilow - 1; for (i = 2; i <= (ncells - 1); i++) { ival += 1; /*++ CODE for .C. is active */ sprpl( (float)( Ihist[i] ), '*', image, NLEN, 0.e0, flmaxc, TRUE ); printf(" %8ld%10ld %s\n", ival, Ihist[i], image ); /*++ CODE for ~.C. is inactive * call SPRPL(real(IHIST(I)),'*',IMAGE,NLEN,0.E0,FLMAXC,.TRUE.) *++ End */ } if (Ihist[ncells] != 0) { /*++ CODE for .C. is active */ sprpl( (float)( Ihist[ncells] ), '*', image, NLEN, 0.e0, flmaxc, TRUE ); printf(" >%8ld%10ld %s\n", ival, Ihist[ncells], image); /*++ CODE for ~.C. is inactive * call SPRPL(real(IHIST(NCELLS)),'*',IMAGE,NLEN, * * 0.E0,FLMAXC,.TRUE.) *++ End */ } /* Finished with printer-plot of histogram. * */ printf(" \n Count Minimum Maximum Mean Std. Deviation\n"); printf(" \n %10ld%10ld%10ld%13.5g%14.5g\n", Istats[1], Istats[2], Istats[3], Xstats[1], Xstats[2]); return; } /* end of function */