hpgl-support-eng Mailing List for HPGL
Brought to you by:
barskykd,
muharlyamovar
You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mohammed R. <moh...@gm...> - 2011-07-17 08:39:05
|
Dear HPGL developers As I asked in subject line it is clear that how can I use HPGL with c++. I am satisfied with HPGL performance. Now I need to bring the power of HPGL to web using Wt a C++ web toolkit. Is it possible? -- Thanks && Regards Mohammed Rashad K.M +919642945690 |
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. |
From: Aman T. <ama...@gm...> - 2011-01-10 20:22:44
|
Solved. This issue was the C++ Redistributable package. Here is the update link for XP SP3, Vista, 7, etc. http://www.microsoft.com/downloads/en/details.aspx?familyid=766a6af7-ec73-40ff-b072-9112bab119c2&displaylang=en -Aman On Mon, Jan 10, 2011 at 1:54 PM, Aman Thakral <ama...@gm...>wrote: > Hi, > > I've recently downloaded the library, but when I tried the import I got the > following error: > > In [2]: from geo_bsd import * > --------------------------------------------------------------------------- > WindowsError Traceback (most recent call last) > > C:\Python25\Scripts\<ipython console> in <module>() > > C:\Python25\lib\site-packages\geo_bsd\__init__.py in <module>() > 2 > 3 > ----> 4 from geo import * > 5 from sgs import sgs_simulation > 6 from sis import sis_simulation > > C:\Python25\lib\site-packages\geo_bsd\geo.py in <module>() > 3 import ctypes as C > 4 > ----> 5 from hpgl_wrap import _HPGL_SHAPE, _HPGL_CONT_MASKED_ARRAY, > _HPGL_IND_MA > SKED_ARRAY, _HPGL_UBYTE_ARRAY, _HPGL_FLOAT_ARRAY, _HPGL_OK_PARAMS, > _HPGL_SK_PARA > MS, _HPGL_IK_PARAMS, _HPGL_MEDIAN_IK_PARAMS, __hpgl_cov_params_t, > __hpgl_cockrig > ing_m1_params_t, __hpgl_cockriging_m2_params_t, _hpgl_so > 6 from hpgl_wrap import hpgl_output_handler, hpgl_progress_handler > 7 > > C:\Python25\lib\site-packages\geo_bsd\hpgl_wrap.py in <module>() > 144 _hpgl_so = NC.load_library('hpgl_d', __file__) > 145 else: > --> 146 _hpgl_so = NC.load_library('hpgl', __file__) > 147 > 148 _hpgl_so.hpgl_set_output_handler.restype = None > > C:\Python25\lib\site-packages\numpy\ctypeslib.pyc in load_library(libname, > loade > r_path) > 120 pass > 121 > --> 122 raise e > 123 > 124 ctypes_load_library = deprecate(load_library, > 'ctypes_load_library', > > > WindowsError: [Error 126] The specified module could not be found > > > I think this may have to do with the version of numpy I'm using (1.5.1). > What version should I install? I'm running python 2.5.4. > > Any help you can provide would be greatly appreciated. > > Thanks, > Aman > |
From: Aman T. <ama...@gm...> - 2011-01-10 18:54:36
|
Hi, I've recently downloaded the library, but when I tried the import I got the following error: In [2]: from geo_bsd import * --------------------------------------------------------------------------- WindowsError Traceback (most recent call last) C:\Python25\Scripts\<ipython console> in <module>() C:\Python25\lib\site-packages\geo_bsd\__init__.py in <module>() 2 3 ----> 4 from geo import * 5 from sgs import sgs_simulation 6 from sis import sis_simulation C:\Python25\lib\site-packages\geo_bsd\geo.py in <module>() 3 import ctypes as C 4 ----> 5 from hpgl_wrap import _HPGL_SHAPE, _HPGL_CONT_MASKED_ARRAY, _HPGL_IND_MA SKED_ARRAY, _HPGL_UBYTE_ARRAY, _HPGL_FLOAT_ARRAY, _HPGL_OK_PARAMS, _HPGL_SK_PARA MS, _HPGL_IK_PARAMS, _HPGL_MEDIAN_IK_PARAMS, __hpgl_cov_params_t, __hpgl_cockrig ing_m1_params_t, __hpgl_cockriging_m2_params_t, _hpgl_so 6 from hpgl_wrap import hpgl_output_handler, hpgl_progress_handler 7 C:\Python25\lib\site-packages\geo_bsd\hpgl_wrap.py in <module>() 144 _hpgl_so = NC.load_library('hpgl_d', __file__) 145 else: --> 146 _hpgl_so = NC.load_library('hpgl', __file__) 147 148 _hpgl_so.hpgl_set_output_handler.restype = None C:\Python25\lib\site-packages\numpy\ctypeslib.pyc in load_library(libname, loade r_path) 120 pass 121 --> 122 raise e 123 124 ctypes_load_library = deprecate(load_library, 'ctypes_load_library', WindowsError: [Error 126] The specified module could not be found I think this may have to do with the version of numpy I'm using (1.5.1). What version should I install? I'm running python 2.5.4. Any help you can provide would be greatly appreciated. Thanks, Aman |
From: nobu i <ito...@gm...> - 2010-04-13 04:42:34
|
Hello Hannes! First of all, thanks for the letter :) It's always nice to see feedback and questions about our software. Now, about Ordinary Kriging. Actually, it is known thing about Ordinary Kriging and we saw it on GSLIB/SGEMS tests as well. I think ArcGis adjust some parameters to make it more 'smooth', that's because the picture is nice. The reason for this behavior is the mean calculation process in OK. While Simple Kriging considered mean to be constant at all points, OK assumes that mean is varying from point to point (and the neighbors points around the interpolated one is used for mean calculation). So, if you have areas which has different mean values (calculated from initial data points in some radius), you will see this artifacts on the borders of the areas. Besides that, there are two strange things about your covariance model: 1) Sill is too high, in most cases it is laying from 0 to 1 and it represents variance of the data. Why 3500? Is it from variogram you calculated before? 2) Same thing about nugget. cov_krig = CovarianceModel(type=1, ranges=(150,150,1), sill=3500, nugget=600) try to use Sill = 1 and nugget = 0, if it helps, maybe you should consider more appropriate variogram model for your data. Also, you can use Simple Kriging with mean value calculated by the whole area. Another approach for varying mean data interpolation is to subtract mean trend from initial data after performing Kriging, and add it to the result later. Feel free to ask more questions and good luck! Arthur M. On Tue, Apr 13, 2010 at 10:08 AM, < hpg...@li...> wrote: > Send Hpgl-support-eng mailing list submissions to > hpg...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/hpgl-support-eng > or, via email, send a message with subject or body 'help' to > hpg...@li... > > You can reach the person managing the list at > hpg...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Hpgl-support-eng digest..." > > > Today's Topics: > > 1. Errors in ordinary kriging ? (hannes) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 11 Apr 2010 16:03:19 +0200 > From: hannes <ha...@gi...> > Subject: [Hpgl-support-eng] Errors in ordinary kriging ? > To: hpg...@li... > Message-ID: <1270994599.4762.61.camel@hirubu> > Content-Type: text/plain; charset="us-ascii" > > Dear HPGL authors, > > I performed on a 64bit maschine in python 2.6 with the xmas edition some > ordinary kriging. However, the results are rather disappointing, circles > and lines appearing in the results. Did I select some erronous arguments > for my OK, or is that an error somewhere in the library. Looks different > in other software packages like arcgis > > Please find attached a screenshot of some area in question, the input > data as well as the code used. > > Sincerely Yours Hannes Reuter > > > import numpy as np > import pylab > from numpy import * > from osgeo import gdal > import os > import sys > from geo_bsd import * # for gslib support > from geo_bsd.routines import * > from geo_bsd.cvariogram import * # for sample variogram calculations > > inRastername='/workubu/airbase/modell/auxdata/blank.tif' # specify base > image, where all stats should be based on > outRastername='/workubu/airbase/modell/auxdata/krigedresult.tif' # > specify output kriged > th_num=1 # number of threats > > set_thread_num(th_num) > print('run on '+str(get_thread_num())+' number of threads') > # display=0 # set to 1 if you want to see all results > # inmcdatarange='/workubu/airbase/modell/source/pcacoeff.txt' # specify > output pca image, > if os.path.exists(outRastername): > print "Output File already exists\n" > sys.exit( 1 ) > if not os.path.exists(inRastername): > print "Input Grid does not exists\n" > sys.exit( 1 ) > # if not os.path.exists(inmcdatarange): > # print "Input MC data range does not exists - use 1/10 of inherent > data range \n" > > driver = gdal.GetDriverByName("GTiff") # drivers create for ENVI > print (' Kriging for Data in: '+inRastername+' in Raster: > '+outRastername) > dataset = gdal.Open(inRastername, gdal.GA_ReadOnly) > geotransform = dataset.GetGeoTransform() > bandmax = dataset.RasterCount > rows = dataset.RasterYSize > cols = dataset.RasterXSize > #create matrix to store all flattened images > print(' Load data from file into memory') > data = SugarboxGrid(rows, cols, bandmax) # define grid > matrix = dataset.GetRasterBand(1).ReadAsArray() # read data > matrix.resize((rows, cols,1)) # add third dimension > matrix_mask = matrix <>0 # return boolean array > offset = matrix.min() # loose negative values - > if offset < 0: > matrix=matrix+abs(offset)+1 > offset = abs(offset)+1 > prop = ContProperty(matrix, matrix_mask) > lag_width = 50 > lag_separation = 50 > tol_distance = 25 > num_lags = 10 > first_lag_distance = 0 > r1, r2, r3 = 1, 1, 1 > a1, a2, a3 = 0, 0, 0 > > lags, variograms = CalcVariograms( > VariogramSearchTemplate( > lag_width, > lag_separation, > tol_distance, > num_lags, > first_lag_distance, > Ellipsoid( > r1, r2, r3, > a1, a2, a3)), > prop) > pylab.figure() > pylab.plot( lags, variograms, '.') > pylab.plot( lags, variograms, 'g') > pylab.show() > cov_krig = CovarianceModel(type=1, ranges=(150,150,1), sill=3500, > nugget=600) > prop_result = ordinary_kriging(prop, data, > radiuses = (300, 300, 1), > max_neighbours = 100, > cov_model = cov_krig, > ) > # how to set nodata value > outds = driver.Create(outRastername,dataset.RasterXSize, > dataset.RasterYSize, bandmax,gdal.GDT_Float32) # create a in ENVI file > for bands specified in bandmax file > outds.SetGeoTransform(dataset.GetGeoTransform()) > outds.SetProjection(dataset.GetProjection()) > outds.GetRasterBand(1).WriteArray(prop_result[0][:,:,0]) > outds = None # close output file > print (' Stored Results in: '+outRastername) > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: blankupload.tif.tar.gz > Type: application/x-compressed-tar > Size: 105576 bytes > Desc: not available > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: krigingfunny.png > Type: image/png > Size: 329471 bytes > Desc: not available > > ------------------------------ > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > > ------------------------------ > > _______________________________________________ > Hpgl-support-eng mailing list > Hpg...@li... > https://lists.sourceforge.net/lists/listinfo/hpgl-support-eng > > > End of Hpgl-support-eng Digest, Vol 1, Issue 1 > ********************************************** > |
From: hannes <ha...@gi...> - 2010-04-11 14:20:41
|
Dear HPGL authors, I performed on a 64bit maschine in python 2.6 with the xmas edition some ordinary kriging. However, the results are rather disappointing, circles and lines appearing in the results. Did I select some erronous arguments for my OK, or is that an error somewhere in the library. Looks different in other software packages like arcgis Please find attached a screenshot of some area in question, the input data as well as the code used. Sincerely Yours Hannes Reuter import numpy as np import pylab from numpy import * from osgeo import gdal import os import sys from geo_bsd import * # for gslib support from geo_bsd.routines import * from geo_bsd.cvariogram import * # for sample variogram calculations inRastername='/workubu/airbase/modell/auxdata/blank.tif' # specify base image, where all stats should be based on outRastername='/workubu/airbase/modell/auxdata/krigedresult.tif' # specify output kriged th_num=1 # number of threats set_thread_num(th_num) print('run on '+str(get_thread_num())+' number of threads') # display=0 # set to 1 if you want to see all results # inmcdatarange='/workubu/airbase/modell/source/pcacoeff.txt' # specify output pca image, if os.path.exists(outRastername): print "Output File already exists\n" sys.exit( 1 ) if not os.path.exists(inRastername): print "Input Grid does not exists\n" sys.exit( 1 ) # if not os.path.exists(inmcdatarange): # print "Input MC data range does not exists - use 1/10 of inherent data range \n" driver = gdal.GetDriverByName("GTiff") # drivers create for ENVI print (' Kriging for Data in: '+inRastername+' in Raster: '+outRastername) dataset = gdal.Open(inRastername, gdal.GA_ReadOnly) geotransform = dataset.GetGeoTransform() bandmax = dataset.RasterCount rows = dataset.RasterYSize cols = dataset.RasterXSize #create matrix to store all flattened images print(' Load data from file into memory') data = SugarboxGrid(rows, cols, bandmax) # define grid matrix = dataset.GetRasterBand(1).ReadAsArray() # read data matrix.resize((rows, cols,1)) # add third dimension matrix_mask = matrix <>0 # return boolean array offset = matrix.min() # loose negative values - if offset < 0: matrix=matrix+abs(offset)+1 offset = abs(offset)+1 prop = ContProperty(matrix, matrix_mask) lag_width = 50 lag_separation = 50 tol_distance = 25 num_lags = 10 first_lag_distance = 0 r1, r2, r3 = 1, 1, 1 a1, a2, a3 = 0, 0, 0 lags, variograms = CalcVariograms( VariogramSearchTemplate( lag_width, lag_separation, tol_distance, num_lags, first_lag_distance, Ellipsoid( r1, r2, r3, a1, a2, a3)), prop) pylab.figure() pylab.plot( lags, variograms, '.') pylab.plot( lags, variograms, 'g') pylab.show() cov_krig = CovarianceModel(type=1, ranges=(150,150,1), sill=3500, nugget=600) prop_result = ordinary_kriging(prop, data, radiuses = (300, 300, 1), max_neighbours = 100, cov_model = cov_krig, ) # how to set nodata value outds = driver.Create(outRastername,dataset.RasterXSize, dataset.RasterYSize, bandmax,gdal.GDT_Float32) # create a in ENVI file for bands specified in bandmax file outds.SetGeoTransform(dataset.GetGeoTransform()) outds.SetProjection(dataset.GetProjection()) outds.GetRasterBand(1).WriteArray(prop_result[0][:,:,0]) outds = None # close output file print (' Stored Results in: '+outRastername) |