You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
#include <Python.h>
|
|
#include <numpy/arrayobject.h>
|
|
#include <stdio.h>
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
#include <stdarg.h>
|
|
#include <stdlib.h>
|
|
#include "Py_py-api.h"
|
|
#include "genlib.h"
|
|
#include "simpio.h"
|
|
#include "geostat.h"
|
|
#include "toolsIO.h"
|
|
#include "toolsFFTMA.h"
|
|
|
|
/* kgeneration */
|
|
/* Z is the GWN with 0-mean and 1-variance */
|
|
/* Y1 is the realization with 0-mean and variance wanted */
|
|
/* Y is the realization with mean and variance wanted */
|
|
|
|
void Py_kgeneration(long seed,struct grid_mod grid,struct statistic_mod stat,struct vario_mod variogram,struct realization_mod *Z,struct realization_mod *Y,struct realization_mod *Y1, int n[3])
|
|
{
|
|
int i,N;
|
|
int typelog;
|
|
|
|
printf("\nESTOY ACAAAAA\n");
|
|
|
|
|
|
/*generate Gaussian white noise*/
|
|
N = grid.NX*grid.NY*grid.NZ;
|
|
n[0] = 0;
|
|
n[1] = 0;
|
|
n[2] = 0;
|
|
|
|
|
|
|
|
|
|
generate(&seed,N,Z);
|
|
|
|
|
|
|
|
/*FFTMA*/
|
|
FFTMA2(variogram,grid,n,Z,Y);
|
|
|
|
/*add the statistics*/
|
|
//if (stat.mean[0] != 0 || stat.variance[0]!= 1)
|
|
//addstat2(Y,stat,Y1,Y);
|
|
|
|
/* make a log normal realization */
|
|
if (stat.type==1 || stat.type==2){
|
|
|
|
typelog=stat.type+2;
|
|
/* nor2log(Y1,typelog,Y1); */
|
|
nor2log(Y,typelog,Y);
|
|
}
|
|
|
|
return;
|
|
}
|