[Hpgl-support-eng] Ordinary Kriging on weather data - Reg. urgent help needed!
Brought to you by:
barskykd,
muharlyamovar
From: sonal a. <son...@gm...> - 2011-02-25 09:19:13
|
Hi, I am trying to interpolate weather data (temperature) to create contours. I tried to use ordinary kriging of HPGL. But the results are not satisfactory. Details of my codes is as follows : 1. stn_lat.txt, stn_lon.txt, stn_temp.txt : consists of latitudes, longitudes and temperature value respectively. [Just for testing purpose i kept it separately.] 2. one.txt consist of 1's and 0's for the masked value. 3. The latitude,longitude values are basically non-gridded data. Latitude /longitudes are not equally-spaced. I have Temperature value for all. But just for testing purpose i replaced some values by 99. and corresponding mask in one.txt is made 0 instead of 1. 4. the temperature values obtained by doing ordinary kriging is not matching the original values.What can be the possible reason?? 5. If i want to get temperature values for a grid. how do I do this?? Please help. My codes are as follows: *import geo_bsd from geo_bsd import * grid = SugarboxGrid(3,1,659) cov1 = CovarianceModel(type=0, ranges = (5, 5, 5), sill = 1) import numpy as np import array li=[] inp = open ("input/stn_lat.txt","r") #read line into array for line in inp.readlines(): for i in line.split(): li.append(float(i)) li2=[] inp2 = open ("input/stn_lon.txt","r") #read line into array for line in inp2.readlines(): for i in line.split(): li2.append(float(i)) li4=[] inp4 = open ("input/stn_temp.txt","r") #read line into array for line in inp4.readlines(): for i in line.split(): li4.append(float(i)) li3=[] inp3 = open ("input/one.txt","r") #read line into array for line in inp3.readlines(): for i in line.split(): li3.append(float(i)) array_prop=np.array(([li2],[li],[li4]),dtype='float32') array_mask=np.array(([li2],[li],[li3]),dtype='float32') # define grid. cont_property = ContProperty(array_prop, array_mask) prop_result = ordinary_kriging(cont_property, grid, radiuses = (20, 20, 1), max_neighbours = 12, cov_model = cov1) write_property(prop_result, "R_OK_with.INC", "OK_RESULT", -99) *Thanks and Regards, sonal. |