TPCCLIB
Loading...
Searching...
No Matches
ranoise.c
Go to the documentation of this file.
1
4/*****************************************************************************/
5#include "tpcclibConfig.h"
6/*****************************************************************************/
7#include <stdio.h>
8#include <stdlib.h>
9#include <math.h>
10#include <time.h>
11#include <string.h>
12/*****************************************************************************/
13#include "tpcisotope.h"
14/*****************************************************************************/
15
16/*****************************************************************************/
28 double y,
30 double t1,
32 double dt,
35 int isotope,
37 double a
38) {
39 /* Frame start time must be >=0 and frame duration must be >0 */
40 if(isnan(y) || !(t1>=0.0) || !(dt>0.0) || !(a>=0.0)) return(nan(""));
41 /* If concentration is not positive, then its SD is zero */
42 if(!(y>0.0)) return(0.0);
43
44 /* Calculate decay factor (<=1) */
45 double df;
47 df=1.0;
48 } else {
50 if(!(df>0.0 && df<=1.0)) return(nan(""));
51 }
52
53 /* Calculate SD */
54 return(sqrt((a*y)/(dt*df)));
55}
56/*****************************************************************************/
57
58/*****************************************************************************/
double decayCorrectionFactorFromIsotope(int isotope, double starttime, double duration)
Definition decay.c:107
double noiseSD4Frame(double y, double t1, double dt, int isotope, double a)
Definition ranoise.c:26
Header file for library libtpcisotope.
isotope
Definition tpcisotope.h:50
@ ISOTOPE_UNKNOWN
Unknown.
Definition tpcisotope.h:51