Commit c9468014 authored by Wei Chengliang's avatar Wei Chengliang
Browse files

add CTI/1*16/prescan/overscan

parent d84594ad
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "nrutil.h"
void creattraps(long *seed,int ntrap,int ny,int nmax,float c,float beta,float **sp)
{
//creat ntrap traps along one column
//sp[i][0] the number of trap in the ith pixle;
//sp[i][j] (c,1+c) the height of the jth trap in the ith pixle;
float ran1(long *idum);
void sort(unsigned long n, float arr[]);
float tmp,betare,height;
int i,nyt,ntmp,j;
float *tmpv;
tmpv = vector(1,100);
if(nmax>50){printf(" the upper limite of trap in each pixe is too large, nmax=%d\n",nmax); getchar();}
betare=1./beta;
for(i=0;i<ny;i++)sp[i][0]=0;
for(i=0;i<ntrap;i++){
nyt=ran1(seed)*ny;
sp[nyt][0]++;
}
for(i=0;i<ny;i++){
ntmp=sp[i][0];
if(ntmp==1){
height=ran1(seed)-c;
if(height<=0){sp[i][1]=0;}
else{
sp[i][1]=pow(height,betare);
}
}
if(ntmp>1){
if(ntmp>nmax)sp[i][0]=ntmp=nmax; // upper limite of trap in each pixel is nmax
for(j=1;j<=ntmp;j++)tmpv[j]=ran1(seed)-c;
sort(ntmp, tmpv);
for(j=1;j<=ntmp;j++){
height=tmpv[j];
if(height<=0){sp[i][j]=0;}
else{sp[i][j]=pow(height,betare);}
}
}
sp[i][ntmp+1]=999999;
}
free_vector(tmpv,1,100);
}
#include <math.h>
float gammln(float xx)
{
double x,y,tmp,ser;
static double cof[6]={76.18009172947146,-86.50532032941677,
24.01409824083091,-1.231739572450155,
0.1208650973866179e-2,-0.5395239384953e-5};
int j;
y=x=xx;
tmp=x+5.5;
tmp -= (x+0.5)*log(tmp);
ser=1.000000000190015;
for (j=0;j<=5;j++) ser += cof[j]/++y;
return -tmp+log(2.5066282746310005*ser/x);
}
/* (C) Copr. 1986-92 Numerical Recipes Software )1!. */
#include <math.h>
float gasdev(long *idum)
{
float ran1(long *idum);
static int iset=0;
static float gset;
float fac,rsq,v1,v2;
if (iset == 0) {
do {
v1=2.0*ran1(idum)-1.0;
v2=2.0*ran1(idum)-1.0;
rsq=v1*v1+v2*v2;
} while (rsq >= 1.0 || rsq == 0.0);
fac=sqrt(-2.0*log(rsq)/rsq);
gset=v1*fac;
iset=1;
return v2*fac;
} else {
iset=0;
return gset;
}
}
/* (C) Copr. 1986-92 Numerical Recipes Software )1!. */
#if defined(__STDC__) || defined(ANSI) || defined(NRANSI) /* ANSI */
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#define NR_END 1
#define FREE_ARG char*
void nrerror(char error_text[])
/* Numerical Recipes standard error handler */
{
fprintf(stderr,"Numerical Recipes run-time error...\n");
fprintf(stderr,"%s\n",error_text);
fprintf(stderr,"...now exiting to system...\n");
exit(1);
}
float *vector(long nl, long nh)
/* allocate a float vector with subscript range v[nl..nh] */
{
float *v;
v=(float *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(float)));
if (!v) nrerror("allocation failure in vector()");
return v-nl+NR_END;
}
int *ivector(long nl, long nh)
/* allocate an int vector with subscript range v[nl..nh] */
{
int *v;
v=(int *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(int)));
if (!v) nrerror("allocation failure in ivector()");
return v-nl+NR_END;
}
unsigned char *cvector(long nl, long nh)
/* allocate an unsigned char vector with subscript range v[nl..nh] */
{
unsigned char *v;
v=(unsigned char *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(unsigned char)));
if (!v) nrerror("allocation failure in cvector()");
return v-nl+NR_END;
}
long *lvector(long nl, long nh)
/* allocate an long vector with subscript range v[nl..nh] */
{
long *v;
v=(long *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(long)));
if (!v) nrerror("allocation failure in lvector()");
return v-nl+NR_END;
}
double *dvector(long nl, long nh)
/* allocate a double vector with subscript range v[nl..nh] */
{
double *v;
v=(double *)malloc((size_t) ((nh-nl+1+NR_END)*sizeof(double)));
if (!v) nrerror("allocation failure in dvector()");
return v-nl+NR_END;
}
float **matrix(long nrl, long nrh, long ncl, long nch)
/* allocate a float matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
float **m;
/* allocate pointers to rows */
m=(float **) malloc((size_t)((nrow+NR_END)*sizeof(float*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(float *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(float)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
double **dmatrix(long nrl, long nrh, long ncl, long nch)
/* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
double **m;
/* allocate pointers to rows */
m=(double **) malloc((size_t)((nrow+NR_END)*sizeof(double*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(double *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(double)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
int **imatrix(long nrl, long nrh, long ncl, long nch)
/* allocate a int matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
int **m;
/* allocate pointers to rows */
m=(int **) malloc((size_t)((nrow+NR_END)*sizeof(int*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(int *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(int)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
float **submatrix(float **a, long oldrl, long oldrh, long oldcl, long oldch,
long newrl, long newcl)
/* point a submatrix [newrl..][newcl..] to a[oldrl..oldrh][oldcl..oldch] */
{
long i,j,nrow=oldrh-oldrl+1,ncol=oldcl-newcl;
float **m;
/* allocate array of pointers to rows */
m=(float **) malloc((size_t) ((nrow+NR_END)*sizeof(float*)));
if (!m) nrerror("allocation failure in submatrix()");
m += NR_END;
m -= newrl;
/* set pointers to rows */
for(i=oldrl,j=newrl;i<=oldrh;i++,j++) m[j]=a[i]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
float **convert_matrix(float *a, long nrl, long nrh, long ncl, long nch)
/* allocate a float matrix m[nrl..nrh][ncl..nch] that points to the matrix
declared in the standard C manner as a[nrow][ncol], where nrow=nrh-nrl+1
and ncol=nch-ncl+1. The routine should be called with the address
&a[0][0] as the first argument. */
{
long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1;
float **m;
/* allocate pointers to rows */
m=(float **) malloc((size_t) ((nrow+NR_END)*sizeof(float*)));
if (!m) nrerror("allocation failure in convert_matrix()");
m += NR_END;
m -= nrl;
/* set pointers to rows */
m[nrl]=a-ncl;
for(i=1,j=nrl+1;i<nrow;i++,j++) m[j]=m[j-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
float ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
/* allocate a float 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
{
long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1,ndep=ndh-ndl+1;
float ***t;
/* allocate pointers to pointers to rows */
t=(float ***) malloc((size_t)((nrow+NR_END)*sizeof(float**)));
if (!t) nrerror("allocation failure 1 in f3tensor()");
t += NR_END;
t -= nrl;
/* allocate pointers to rows and set pointers to them */
t[nrl]=(float **) malloc((size_t)((nrow*ncol+NR_END)*sizeof(float*)));
if (!t[nrl]) nrerror("allocation failure 2 in f3tensor()");
t[nrl] += NR_END;
t[nrl] -= ncl;
/* allocate rows and set pointers to them */
t[nrl][ncl]=(float *) malloc((size_t)((nrow*ncol*ndep+NR_END)*sizeof(float)));
if (!t[nrl][ncl]) nrerror("allocation failure 3 in f3tensor()");
t[nrl][ncl] += NR_END;
t[nrl][ncl] -= ndl;
for(j=ncl+1;j<=nch;j++) t[nrl][j]=t[nrl][j-1]+ndep;
for(i=nrl+1;i<=nrh;i++) {
t[i]=t[i-1]+ncol;
t[i][ncl]=t[i-1][ncl]+ncol*ndep;
for(j=ncl+1;j<=nch;j++) t[i][j]=t[i][j-1]+ndep;
}
/* return pointer to array of pointers to rows */
return t;
}
double ***d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
/* allocate a double 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
{
long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1,ndep=ndh-ndl+1;
double ***t;
/* allocate pointers to pointers to rows */
t=(double ***) malloc((size_t)((nrow+NR_END)*sizeof(double**)));
if (!t) nrerror("allocation failure 1 in f3tensor()");
t += NR_END;
t -= nrl;
/* allocate pointers to rows and set pointers to them */
t[nrl]=(double **) malloc((size_t)((nrow*ncol+NR_END)*sizeof(double*)));
if (!t[nrl]) nrerror("allocation failure 2 in f3tensor()");
t[nrl] += NR_END;
t[nrl] -= ncl;
/* allocate rows and set pointers to them */
t[nrl][ncl]=(double *) malloc((size_t)((nrow*ncol*ndep+NR_END)*sizeof(double)));
if (!t[nrl][ncl]) nrerror("allocation failure 3 in f3tensor()");
t[nrl][ncl] += NR_END;
t[nrl][ncl] -= ndl;
for(j=ncl+1;j<=nch;j++) t[nrl][j]=t[nrl][j-1]+ndep;
for(i=nrl+1;i<=nrh;i++) {
t[i]=t[i-1]+ncol;
t[i][ncl]=t[i-1][ncl]+ncol*ndep;
for(j=ncl+1;j<=nch;j++) t[i][j]=t[i][j-1]+ndep;
}
/* return pointer to array of pointers to rows */
return t;
}
char **cmatrix(long nrl, long nrh, long ncl, long nch)
/* allocate a int matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
char **m;
/* allocate pointers to rows */
m=(char **) malloc((size_t)((nrow+NR_END)*sizeof(char*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(char *) malloc((size_t)((nrow*ncol+NR_END)*sizeof(char)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
void free_vector(float *v, long nl, long nh)
/* free a float vector allocated with vector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_ivector(int *v, long nl, long nh)
/* free an int vector allocated with ivector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_cvector(unsigned char *v, long nl, long nh)
/* free an unsigned char vector allocated with cvector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_lvector(long *v, long nl, long nh)
/* free an long vector allocated with lvector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_dvector(double *v, long nl, long nh)
/* free a double vector allocated with dvector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_matrix(float **m, long nrl, long nrh, long ncl, long nch)
/* free a float matrix allocated by matrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch)
/* free a double matrix allocated by dmatrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch)
/* free an int matrix allocated by imatrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
void free_submatrix(float **b, long nrl, long nrh, long ncl, long nch)
/* free a submatrix allocated by submatrix() */
{
free((FREE_ARG) (b+nrl-NR_END));
}
void free_convert_matrix(float **b, long nrl, long nrh, long ncl, long nch)
/* free a matrix allocated by convert_matrix() */
{
free((FREE_ARG) (b+nrl-NR_END));
}
void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch,
long ndl, long ndh)
/* free a float f3tensor allocated by f3tensor() */
{
free((FREE_ARG) (t[nrl][ncl]+ndl-NR_END));
free((FREE_ARG) (t[nrl]+ncl-NR_END));
free((FREE_ARG) (t+nrl-NR_END));
}
void free_d3tensor(double ***t, long nrl, long nrh, long ncl, long nch,
long ndl, long ndh)
/* free a double f3tensor allocated by f3tensor() */
{
free((FREE_ARG) (t[nrl][ncl]+ndl-NR_END));
free((FREE_ARG) (t[nrl]+ncl-NR_END));
free((FREE_ARG) (t+nrl-NR_END));
}
void free_cmatrix(char **m, long nrl, long nrh, long ncl, long nch)
/* free a character matrix allocated by matrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
#else /* ANSI */
/* traditional - K&R */
#include <stdio.h>
#define NR_END 1
#define FREE_ARG char*
void nrerror(error_text)
char error_text[];
/* Numerical Recipes standard error handler */
{
void exit();
fprintf(stderr,"Numerical Recipes run-time error...\n");
fprintf(stderr,"%s\n",error_text);
fprintf(stderr,"...now exiting to system...\n");
exit(1);
}
float *vector(nl,nh)
long nh,nl;
/* allocate a float vector with subscript range v[nl..nh] */
{
float *v;
v=(float *)malloc((unsigned int) ((nh-nl+1+NR_END)*sizeof(float)));
if (!v) nrerror("allocation failure in vector()");
return v-nl+NR_END;
}
int *ivector(nl,nh)
long nh,nl;
/* allocate an int vector with subscript range v[nl..nh] */
{
int *v;
v=(int *)malloc((unsigned int) ((nh-nl+1+NR_END)*sizeof(int)));
if (!v) nrerror("allocation failure in ivector()");
return v-nl+NR_END;
}
unsigned char *cvector(nl,nh)
long nh,nl;
/* allocate an unsigned char vector with subscript range v[nl..nh] */
{
unsigned char *v;
v=(unsigned char *)malloc((unsigned int) ((nh-nl+1+NR_END)*sizeof(unsigned char)));
if (!v) nrerror("allocation failure in cvector()");
return v-nl+NR_END;
}
long *lvector(nl,nh)
long nh,nl;
/* allocate an unsigned long vector with subscript range v[nl..nh] */
{
long *v;
v=(long *)malloc((int) ((nh-nl+1+NR_END)*sizeof(long)));
if (!v) nrerror("allocation failure in lvector()");
return v-nl+NR_END;
}
double *dvector(nl,nh)
long nh,nl;
/* allocate a double vector with subscript range v[nl..nh] */
{
double *v;
v=(double *)malloc((unsigned int) ((nh-nl+1+NR_END)*sizeof(double)));
if (!v) nrerror("allocation failure in dvector()");
return v-nl+NR_END;
}
float **matrix(nrl,nrh,ncl,nch)
long nch,ncl,nrh,nrl;
/* allocate a float matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
float **m;
/* allocate pointers to rows */
m=(float **) malloc((unsigned int)((nrow+NR_END)*sizeof(float*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(float *) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(float)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
double **dmatrix(nrl,nrh,ncl,nch)
long nch,ncl,nrh,nrl;
/* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
double **m;
/* allocate pointers to rows */
m=(double **) malloc((unsigned int)((nrow+NR_END)*sizeof(double*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(double *) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(double)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
int **imatrix(nrl,nrh,ncl,nch)
long nch,ncl,nrh,nrl;
/* allocate a int matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
int **m;
/* allocate pointers to rows */
m=(int **) malloc((unsigned int)((nrow+NR_END)*sizeof(int*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(int *) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(int)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
float **submatrix(a,oldrl,oldrh,oldcl,oldch,newrl,newcl)
float **a;
long newcl,newrl,oldch,oldcl,oldrh,oldrl;
/* point a submatrix [newrl..][newcl..] to a[oldrl..oldrh][oldcl..oldch] */
{
long i,j,nrow=oldrh-oldrl+1,ncol=oldcl-newcl;
float **m;
/* allocate array of pointers to rows */
m=(float **) malloc((unsigned int) ((nrow+NR_END)*sizeof(float*)));
if (!m) nrerror("allocation failure in submatrix()");
m += NR_END;
m -= newrl;
/* set pointers to rows */
for(i=oldrl,j=newrl;i<=oldrh;i++,j++) m[j]=a[i]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
float **convert_matrix(a,nrl,nrh,ncl,nch)
float *a;
long nch,ncl,nrh,nrl;
/* allocate a float matrix m[nrl..nrh][ncl..nch] that points to the matrix
declared in the standard C manner as a[nrow][ncol], where nrow=nrh-nrl+1
and ncol=nch-ncl+1. The routine should be called with the address
&a[0][0] as the first argument. */
{
long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1;
float **m;
/* allocate pointers to rows */
m=(float **) malloc((unsigned int) ((nrow+NR_END)*sizeof(float*)));
if (!m) nrerror("allocation failure in convert_matrix()");
m += NR_END;
m -= nrl;
/* set pointers to rows */
m[nrl]=a-ncl;
for(i=1,j=nrl+1;i<nrow;i++,j++) m[j]=m[j-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
double ***d3tensor(nrl,nrh,ncl,nch,ndl,ndh)
long nch,ncl,ndh,ndl,nrh,nrl;
/* allocate a float 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
{
long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1,ndep=ndh-ndl+1;
double ***t;
/* allocate pointers to pointers to rows */
t=(double ***) malloc((unsigned int)((nrow+NR_END)*sizeof(double**)));
if (!t) nrerror("allocation failure 1 in f3tensor()");
t += NR_END;
t -= nrl;
/* allocate pointers to rows and set pointers to them */
t[nrl]=(double **) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(double*)));
if (!t[nrl]) nrerror("allocation failure 2 in f3tensor()");
t[nrl] += NR_END;
t[nrl] -= ncl;
/* allocate rows and set pointers to them */
t[nrl][ncl]=(double *) malloc((unsigned int)((nrow*ncol*ndep+NR_END)*sizeof(double)));
if (!t[nrl][ncl]) nrerror("allocation failure 3 in f3tensor()");
t[nrl][ncl] += NR_END;
t[nrl][ncl] -= ndl;
for(j=ncl+1;j<=nch;j++) t[nrl][j]=t[nrl][j-1]+ndep;
for(i=nrl+1;i<=nrh;i++) {
t[i]=t[i-1]+ncol;
t[i][ncl]=t[i-1][ncl]+ncol*ndep;
for(j=ncl+1;j<=nch;j++) t[i][j]=t[i][j-1]+ndep;
}
/* return pointer to array of pointers to rows */
return t;
}
float ***f3tensor(nrl,nrh,ncl,nch,ndl,ndh)
long nch,ncl,ndh,ndl,nrh,nrl;
/* allocate a float 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh] */
{
long i,j,nrow=nrh-nrl+1,ncol=nch-ncl+1,ndep=ndh-ndl+1;
float ***t;
/* allocate pointers to pointers to rows */
t=(float ***) malloc((unsigned int)((nrow+NR_END)*sizeof(float**)));
if (!t) nrerror("allocation failure 1 in f3tensor()");
t += NR_END;
t -= nrl;
/* allocate pointers to rows and set pointers to them */
t[nrl]=(float **) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(float*)));
if (!t[nrl]) nrerror("allocation failure 2 in f3tensor()");
t[nrl] += NR_END;
t[nrl] -= ncl;
/* allocate rows and set pointers to them */
t[nrl][ncl]=(float *) malloc((unsigned int)((nrow*ncol*ndep+NR_END)*sizeof(float)));
if (!t[nrl][ncl]) nrerror("allocation failure 3 in f3tensor()");
t[nrl][ncl] += NR_END;
t[nrl][ncl] -= ndl;
for(j=ncl+1;j<=nch;j++) t[nrl][j]=t[nrl][j-1]+ndep;
for(i=nrl+1;i<=nrh;i++) {
t[i]=t[i-1]+ncol;
t[i][ncl]=t[i-1][ncl]+ncol*ndep;
for(j=ncl+1;j<=nch;j++) t[i][j]=t[i][j-1]+ndep;
}
/* return pointer to array of pointers to rows */
return t;
}
char **cmatrix(nrl,nrh,ncl,nch)
long nch,ncl,nrh,nrl;
/* allocate a int matrix with subscript range m[nrl..nrh][ncl..nch] */
{
long i, nrow=nrh-nrl+1,ncol=nch-ncl+1;
char **m;
/* allocate pointers to rows */
m=(char **) malloc((unsigned int)((nrow+NR_END)*sizeof(char*)));
if (!m) nrerror("allocation failure 1 in matrix()");
m += NR_END;
m -= nrl;
/* allocate rows and set pointers to them */
m[nrl]=(char *) malloc((unsigned int)((nrow*ncol+NR_END)*sizeof(char)));
if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
m[nrl] += NR_END;
m[nrl] -= ncl;
for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol;
/* return pointer to array of pointers to rows */
return m;
}
void free_vector(v,nl,nh)
float *v;
long nh,nl;
/* free a float vector allocated with vector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_ivector(v,nl,nh)
int *v;
long nh,nl;
/* free an int vector allocated with ivector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_cvector(v,nl,nh)
long nh,nl;
unsigned char *v;
/* free an unsigned char vector allocated with cvector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_lvector(v,nl,nh)
long nh,nl;
long *v;
/* free an long vector allocated with lvector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_dvector(v,nl,nh)
double *v;
long nh,nl;
/* free a double vector allocated with dvector() */
{
free((FREE_ARG) (v+nl-NR_END));
}
void free_matrix(m,nrl,nrh,ncl,nch)
float **m;
long nch,ncl,nrh,nrl;
/* free a float matrix allocated by matrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
void free_dmatrix(m,nrl,nrh,ncl,nch)
double **m;
long nch,ncl,nrh,nrl;
/* free a double matrix allocated by dmatrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
void free_imatrix(m,nrl,nrh,ncl,nch)
int **m;
long nch,ncl,nrh,nrl;
/* free an int matrix allocated by imatrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
void free_submatrix(b,nrl,nrh,ncl,nch)
float **b;
long nch,ncl,nrh,nrl;
/* free a submatrix allocated by submatrix() */
{
free((FREE_ARG) (b+nrl-NR_END));
}
void free_convert_matrix(b,nrl,nrh,ncl,nch)
float **b;
long nch,ncl,nrh,nrl;
/* free a matrix allocated by convert_matrix() */
{
free((FREE_ARG) (b+nrl-NR_END));
}
void free_f3tensor(t,nrl,nrh,ncl,nch,ndl,ndh)
float ***t;
long nch,ncl,ndh,ndl,nrh,nrl;
/* free a float f3tensor allocated by f3tensor() */
{
free((FREE_ARG) (t[nrl][ncl]+ndl-NR_END));
free((FREE_ARG) (t[nrl]+ncl-NR_END));
free((FREE_ARG) (t+nrl-NR_END));
}
void free_d3tensor(t,nrl,nrh,ncl,nch,ndl,ndh)
double ***t;
long nch,ncl,ndh,ndl,nrh,nrl;
/* free a float f3tensor allocated by f3tensor() */
{
free((FREE_ARG) (t[nrl][ncl]+ndl-NR_END));
free((FREE_ARG) (t[nrl]+ncl-NR_END));
free((FREE_ARG) (t+nrl-NR_END));
}
void free_cmatrix(m,nrl,nrh,ncl,nch)
char **m;
long nch,ncl,nrh,nrl;
/* free a double matrix allocated by dmatrix() */
{
free((FREE_ARG) (m[nrl]+ncl-NR_END));
free((FREE_ARG) (m+nrl-NR_END));
}
#endif /* ANSI */
/* CAUTION: This is the ANSI C (only) version of the Numerical Recipes
utility file nrutil.h. Do not confuse this file with the same-named
file nrutil.h that may be supplied in a 'misc' subdirectory.
*That* file is the one from the book, and contains both ANSI and
traditional K&R versions, along with #ifdef macros to select the
correct version. *This* file contains only ANSI C. */
#ifndef _NR_UTILS_H_
#define _NR_UTILS_H_
static float sqrarg;
#define SQR(a) ((sqrarg=(a)) == 0.0 ? 0.0 : sqrarg*sqrarg)
static double dsqrarg;
#define DSQR(a) ((dsqrarg=(a)) == 0.0 ? 0.0 : dsqrarg*dsqrarg)
static double dmaxarg1,dmaxarg2;
#define DMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\
(dmaxarg1) : (dmaxarg2))
static double dminarg1,dminarg2;
#define DMIN(a,b) (dminarg1=(a),dminarg2=(b),(dminarg1) < (dminarg2) ?\
(dminarg1) : (dminarg2))
static float maxarg1,maxarg2;
#define FMAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\
(maxarg1) : (maxarg2))
static float minarg1,minarg2;
#define FMIN(a,b) (minarg1=(a),minarg2=(b),(minarg1) < (minarg2) ?\
(minarg1) : (minarg2))
static long lmaxarg1,lmaxarg2;
#define LMAX(a,b) (lmaxarg1=(a),lmaxarg2=(b),(lmaxarg1) > (lmaxarg2) ?\
(lmaxarg1) : (lmaxarg2))
static long lminarg1,lminarg2;
#define LMIN(a,b) (lminarg1=(a),lminarg2=(b),(lminarg1) < (lminarg2) ?\
(lminarg1) : (lminarg2))
static int imaxarg1,imaxarg2;
#define IMAX(a,b) (imaxarg1=(a),imaxarg2=(b),(imaxarg1) > (imaxarg2) ?\
(imaxarg1) : (imaxarg2))
static int iminarg1,iminarg2;
#define IMIN(a,b) (iminarg1=(a),iminarg2=(b),(iminarg1) < (iminarg2) ?\
(iminarg1) : (iminarg2))
#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
void nrerror(char error_text[]);
float *vector(long nl, long nh);
int *ivector(long nl, long nh);
unsigned char *cvector(long nl, long nh);
long *lvector(long nl, long nh);
double *dvector(long nl, long nh);
float **matrix(long nrl, long nrh, long ncl, long nch);
double **dmatrix(long nrl, long nrh, long ncl, long nch);
int **imatrix(long nrl, long nrh, long ncl, long nch);
float **submatrix(float **a, long oldrl, long oldrh, long oldcl, long oldch,
long newrl, long newcl);
float **convert_matrix(float *a, long nrl, long nrh, long ncl, long nch);
float ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
void free_vector(float *v, long nl, long nh);
void free_ivector(int *v, long nl, long nh);
void free_cvector(unsigned char *v, long nl, long nh);
void free_lvector(long *v, long nl, long nh);
void free_dvector(double *v, long nl, long nh);
void free_matrix(float **m, long nrl, long nrh, long ncl, long nch);
void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch);
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch);
void free_submatrix(float **b, long nrl, long nrh, long ncl, long nch);
void free_convert_matrix(float **b, long nrl, long nrh, long ncl, long nch);
void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch,
long ndl, long ndh);
int ***i3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
void free_i3tensor(int ***t, long nrl, long nrh, long ncl, long nch,
long ndl, long ndh);
unsigned char ***b3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
void free_b3tensor(unsigned char ***t, long nrl, long nrh, long ncl, long nch,
long ndl, long ndh);
double ***d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
void free_d3tensor(double ***t, long nrl, long nrh, long ncl, long nch,
long ndl, long ndh);
char **cmatrix(long nrl, long nrh, long ncl, long nch);
void free_cmatrix(char **m, long nrl, long nrh, long ncl, long nch);
#endif /* _NR_UTILS_H_ */
#include <math.h>
#define PI 3.141592654
float poidev(float xm, int *idum)
{
float gammln(float xx);
float ran1(int *idum);
static float sq,alxm,g,oldm=(-1.0);
float em,t,y;
if (xm < 12.0) {
if (xm != oldm) {
oldm=xm;
g=exp(-xm);
}
em = -1;
t=1.0;
do {
++em;
t *= ran1(idum);
} while (t > g);
} else {
if (xm != oldm) {
oldm=xm;
sq=sqrt(2.0*xm);
alxm=log(xm);
g=xm*alxm-gammln(xm+1.0);
}
do {
do {
y=tan(PI*ran1(idum));
em=sq*y+xm;
} while (em < 0.0);
em=floor(em);
t=0.9*(1.0+y*y)*exp(em*alxm-gammln(em+1.0)-g);
} while (ran1(idum) > t);
}
return em;
}
float poidev_copy(float xm, int *idum)
{
float gammln(float xx);
float ran1_copy(int *idum);
static float sq1,alxm1,g1,oldm1=(-1.0);
float em,t,y;
if (xm < 12.0) {
if (xm != oldm1) {
oldm1=xm;
g1=exp(-xm);
}
em = -1;
t=1.0;
do {
++em;
t *= ran1_copy(idum);
} while (t > g1);
} else {
if (xm != oldm1) {
oldm1=xm;
sq1=sqrt(2.0*xm);
alxm1=log(xm);
g1=xm*alxm1-gammln(xm+1.0);
}
do {
do {
y=tan(PI*ran1_copy(idum));
em=sq1*y+xm;
} while (em < 0.0);
em=floor(em);
t=0.9*(1.0+y*y)*exp(em*alxm1-gammln(em+1.0)-g1);
} while (ran1_copy(idum) > t);
}
return em;
}
#undef PI
/* (C) Copr. 1986-92 Numerical Recipes Software )1!. */
#define IA 16807
#define IM 2147483647
#define AM (1.0/IM)
#define IQ 127773
#define IR 2836
#define NTAB 32
#define NDIV (1+(IM-1)/NTAB)
#define EPS 1.2e-7
#define RNMX (1.0-EPS)
float ran1(int *idum)
{
int j;
int k;
//static
static int iy=0;
static int iv[NTAB];
float temp;
if (*idum <= 0 || !iy) {
if (-(*idum) < 1) *idum=1;
else *idum = -(*idum);
for (j=NTAB+7;j>=0;j--) {
k=(*idum)/IQ;
*idum=IA*(*idum-k*IQ)-IR*k;
if (*idum < 0) *idum += IM;
if (j < NTAB) iv[j] = *idum;
}
iy=iv[0];
}
k=(*idum)/IQ;
*idum=IA*(*idum-k*IQ)-IR*k;
if (*idum < 0) *idum += IM;
j=iy/NDIV;
iy=iv[j];
iv[j] = *idum;
if ((temp=AM*iy) > RNMX) return RNMX;
else return temp;
}
float ran1_copy(int *idum)
{
int j;
int k;
//static
static int iy1=0;
static int iv1[NTAB];
float temp;
if (*idum <= 0 || !iy1) {
if (-(*idum) < 1) *idum=1;
else *idum = -(*idum);
for (j=NTAB+7;j>=0;j--) {
k=(*idum)/IQ;
*idum=IA*(*idum-k*IQ)-IR*k;
if (*idum < 0) *idum += IM;
if (j < NTAB) iv1[j] = *idum;
}
iy1=iv1[0];
}
k=(*idum)/IQ;
*idum=IA*(*idum-k*IQ)-IR*k;
if (*idum < 0) *idum += IM;
j=iy1/NDIV;
iy1=iv1[j];
iv1[j] = *idum;
if ((temp=AM*iy1) > RNMX) return RNMX;
else return temp;
}
#undef IA
#undef IM
#undef AM
#undef IQ
#undef IR
#undef NTAB
#undef NDIV
#undef EPS
#undef RNMX
/* (C) Copr. 1986-92 Numerical Recipes Software )1!. */
#define IM1 2147483563
#define IM2 2147483399
#define AM (1.0/IM1)
#define IMM1 (IM1-1)
#define IA1 40014
#define IA2 40692
#define IQ1 53668
#define IQ2 52774
#define IR1 12211
#define IR2 3791
#define NTAB 32
#define NDIV (1+IMM1/NTAB)
#define EPS 1.2e-7
#define RNMX (1.0-EPS)
float ran2(long *idum)
{
int j;
long k;
static long idum2=123456789;
static long iy=0;
static long iv[NTAB];
float temp;
if (*idum <= 0) {
if (-(*idum) < 1) *idum=1;
else *idum = -(*idum);
idum2=(*idum);
for (j=NTAB+7;j>=0;j--) {
k=(*idum)/IQ1;
*idum=IA1*(*idum-k*IQ1)-k*IR1;
if (*idum < 0) *idum += IM1;
if (j < NTAB) iv[j] = *idum;
}
iy=iv[0];
}
k=(*idum)/IQ1;
*idum=IA1*(*idum-k*IQ1)-k*IR1;
if (*idum < 0) *idum += IM1;
k=idum2/IQ2;
idum2=IA2*(idum2-k*IQ2)-k*IR2;
if (idum2 < 0) idum2 += IM2;
j=iy/NDIV;
iy=iv[j]-idum2;
iv[j] = *idum;
if (iy < 1) iy += IMM1;
if ((temp=AM*iy) > RNMX) return RNMX;
else return temp;
}
#undef IM1
#undef IM2
#undef AM
#undef IMM1
#undef IA1
#undef IA2
#undef IQ1
#undef IQ2
#undef IR1
#undef IR2
#undef NTAB
#undef NDIV
#undef EPS
#undef RNMX
/* (C) Copr. 1986-92 Numerical Recipes Software )1!. */
#define NRANSI
#include "nrutil.h"
#define SWAP(a,b) temp=(a);(a)=(b);(b)=temp;
#define M 7
#define NSTACK 50
void sort(unsigned long n, float arr[])
{
unsigned long i,ir=n,j,k,l=1;
int jstack=0,*istack;
float a,temp;
istack=ivector(1,NSTACK);
for (;;) {
if (ir-l < M) {
for (j=l+1;j<=ir;j++) {
a=arr[j];
for (i=j-1;i>=1;i--) {
if (arr[i] <= a) break;
arr[i+1]=arr[i];
}
arr[i+1]=a;
}
if (jstack == 0) break;
ir=istack[jstack--];
l=istack[jstack--];
} else {
k=(l+ir) >> 1;
SWAP(arr[k],arr[l+1])
if (arr[l+1] > arr[ir]) {
SWAP(arr[l+1],arr[ir])
}
if (arr[l] > arr[ir]) {
SWAP(arr[l],arr[ir])
}
if (arr[l+1] > arr[l]) {
SWAP(arr[l+1],arr[l])
}
i=l+1;
j=ir;
a=arr[l];
for (;;) {
do i++; while (arr[i] < a);
do j--; while (arr[j] > a);
if (j < i) break;
SWAP(arr[i],arr[j]);
}
arr[l]=arr[j];
arr[j]=a;
jstack += 2;
if (jstack > NSTACK) nrerror("NSTACK too small in sort.");
if (ir-i+1 >= j-l) {
istack[jstack]=ir;
istack[jstack-1]=i;
ir=j-1;
} else {
istack[jstack]=j-1;
istack[jstack-1]=l;
l=i;
}
}
}
free_ivector(istack,1,NSTACK);
}
#undef M
#undef NSTACK
#undef SWAP
#undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software )1!. */
......@@ -15,7 +15,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"32": {
"chip_name": "FGS1A-D2",
......@@ -33,7 +37,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"33": {
"chip_name": "FGS1B-D1",
......@@ -51,7 +59,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"34": {
"chip_name": "FGS1B-D2",
......@@ -69,7 +81,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"35": {
"chip_name": "FGS2A-D1",
......@@ -87,7 +103,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"36": {
"chip_name": "FGS2A-D2",
......@@ -105,7 +125,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"37": {
"chip_name": "FGS2B-D1",
......@@ -123,7 +147,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"38": {
"chip_name": "FGS2B-D2",
......@@ -141,7 +169,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"39": {
"chip_name": "FGS3-D1",
......@@ -159,7 +191,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"40": {
"chip_name": "FGS3-D2",
......@@ -177,7 +213,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"41": {
"chip_name": "FGS4-D1",
......@@ -195,7 +235,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"42": {
"chip_name": "FGS4-D2",
......@@ -213,7 +257,11 @@
"df_strength": 2.3,
"bias_level": 2000.0,
"gain": 1.0,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"1": {
"chip_name": "GI-1",
......@@ -231,7 +279,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"2": {
"chip_name": "GV-1",
......@@ -249,7 +301,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"3": {
"chip_name": "GU-1",
......@@ -267,7 +323,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"4": {
"chip_name": "GU-2",
......@@ -285,7 +345,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"5": {
"chip_name": "GV-2",
......@@ -303,7 +367,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"6": {
"chip_name": "y-1",
......@@ -321,7 +389,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"7": {
"chip_name": "i-1",
......@@ -339,7 +411,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"8": {
"chip_name": "g-1",
......@@ -357,7 +433,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"9": {
"chip_name": "r-1",
......@@ -375,7 +455,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"10": {
"chip_name": "GI-2",
......@@ -393,7 +477,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"11": {
"chip_name": "z-1",
......@@ -411,7 +499,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"12": {
"chip_name": "NUV-1",
......@@ -429,7 +521,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"13": {
"chip_name": "NUV-2",
......@@ -447,7 +543,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"14": {
"chip_name": "u-1",
......@@ -465,7 +565,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"15": {
"chip_name": "y-2",
......@@ -483,7 +587,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"16": {
"chip_name": "y-3",
......@@ -501,7 +609,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"17": {
"chip_name": "u-2",
......@@ -519,7 +631,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"18": {
"chip_name": "NUV-3",
......@@ -537,7 +653,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"19": {
"chip_name": "NUV-4",
......@@ -555,7 +675,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"20": {
"chip_name": "z-2",
......@@ -573,7 +697,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"21": {
"chip_name": "GI-3",
......@@ -591,7 +719,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"22": {
"chip_name": "r-2",
......@@ -609,7 +741,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"23": {
"chip_name": "g-2",
......@@ -627,7 +763,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"24": {
"chip_name": "i-2",
......@@ -645,7 +785,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"25": {
"chip_name": "y-4",
......@@ -663,7 +807,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"26": {
"chip_name": "GV-3",
......@@ -681,7 +829,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"27": {
"chip_name": "GU-3",
......@@ -699,7 +851,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"28": {
"chip_name": "GU-4",
......@@ -717,7 +873,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"29": {
"chip_name": "GV-4",
......@@ -735,7 +895,11 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
},
"30": {
"chip_name": "GI-4",
......@@ -753,6 +917,10 @@
"df_strength": 2.3,
"bias_level": 500,
"gain": 1.1,
"full_well": 90000
"full_well": 90000,
"prescan_x": 27,
"overscan_x": 71,
"prescan_y": 0,
"overscan_y": 84
}
}
\ No newline at end of file
}
......@@ -9,15 +9,14 @@
# Base diretories and naming setup
# Can add some of the command-line arguments here as well;
# OK to pass either way or both, as long as they are consistent
<<<<<<< HEAD
work_dir: "/share/home/zhangxin/CSST_SIM/CSST_new_sim/csst-simulation/"
=======
work_dir: "/share/home/fangyuedong/new_sim/workplace/"
# work_dir: "/share/C6_new_sim_2sq"
>>>>>>> new_sim
##<<<<<<< HEAD
##work_dir: "/share/home/zhangxin/CSST_SIM/CSST_new_sim/csst-simulation/"
##=======
work_dir: "/share/home/weichengliang/CSST_git/test_new_sim/outputs/"
##>>>>>>> new_sim
data_dir: "/share/simudata/CSSOSDataProductsSims/data/"
run_name: "C6_new_sim_2sq_run1"
project_cycle: 6
run_name: "testRun2"
project_cycle: 8
run_counter: 1
# Whether to use MPI
......@@ -71,7 +70,7 @@ obs_setting:
# "Spectroscopic": simulate slitless spectroscopic chips only
# "FGS": simulate FGS chips only (31-42)
# "All": simulate full focal plane
survey_type: "Spectroscopic"
survey_type: "Photometric"
# Exposure time [seconds]
exp_time: 150.
......@@ -107,7 +106,7 @@ obs_setting:
# - give a list of indexes of chips: [ip_1, ip_2...]
# - run all chips: null
# Note: for all pointings
run_chips: [10]
run_chips: [8]
# Whether to enable astrometric modeling
enable_astrometric_model: True
......@@ -178,12 +177,14 @@ ins_effects:
non_linear: YES # Whether to add non-linearity
cosmic_ray: YES # Whether to add cosmic-ray
cray_differ: YES # Whether to generate different cosmic ray maps CAL and MS output
cte_trail: YES # Whether to simulate CTE trails
cte_trail: YES # Whether to simulate CTE trails, CTI_lgl_v0.3.tar.gz
saturbloom: YES # Whether to simulate Saturation & Blooming
add_badcolumns: YES # Whether to add bad columns
add_hotpixels: YES # Whether to add hot pixels
add_deadpixels: YES # Whether to add dead(dark) pixels
bright_fatter: YES # Whether to simulate Brighter-Fatter (also diffusion) effect
add_prescan: YES # Whether to add pre/over-scan
format_output: YES ##1*16 output
# Values:
# default values have been defined individually for each chip in:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment