예제 #1
0
Y = data["NH4N"]
Eastings = data["X_COORD"]
Northings = data["Y_COORD"]

good = np.where(1 - ((np.isnan(X[:,0])) +
    (np.isnan(X[:,1])) +
    (np.isnan(X[:,2])) + 
    (np.isnan(Y)) +
    (np.isnan(Eastings)) +
    (np.isnan(Northings))))

Y = Y[good]
X = X[good]
Eastings = Eastings[good]
Northings = Northings[good]




k = krige.bayes(Y, 
                Eastings, 
                Northings, 
                X
                #np.vstack([data["Monitor_Classification"], data["Monitor_Radius_km"]]).transpose()
                )

#import cProfile
#cProfile.run("k.Converge()")
k.Converge()

from spatial import krige as krige
import numpy as np

data = np.genfromtxt("./chicagomondataR.csv", dtype = None, delimiter =",", names = True)

X = np.array([1]*data.shape[0]) 
X.shape = (len(X), 1)
k = krige.bayes(data["PM25_ugm3"], 
                data["EW_Coord_km"], 
                data["NS_Coord_km"], 
                X
                #np.vstack([data["Monitor_Classification"], data["Monitor_Radius_km"]]).transpose()
                )

k.Converge()