IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 11, 2005, 9:35:40 PM (21 years ago)
Author:
eugene
Message:

cleaned gaussdeviate, added vsmooth

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.data/gaussian.c

    r2598 r3894  
    11# include "data.h"
    22
    3 static int Ngaussint;
     3static int Ngaussint = 0;
    44static double *gaussint;
    55
     
    2424  double mean, sigma;
    2525 
     26  /* no need to generate this if it already exists */
     27  if (Ngaussint == Nbin) return;
     28
    2629  A = time(NULL);
    2730  for (B = 0; A == time(NULL); B++);
     
    4548          3.0*gaussian(x+dx3, mean, sigma)) * (dx1/8.0);
    4649    val += df;
    47     if (val > (i / (double) Ngaussint)) {
     50    if (val > (i + 0.5) / (double) Ngaussint) {
    4851      gaussint[i] = x + dx / 2.0;
    4952      i++;
     
    6568}
    6669 
     70double int_gauss (int i) {
     71  double y;
     72  y = gaussint[i];
     73  return (y);
     74}
     75 
Note: See TracChangeset for help on using the changeset viewer.