|
POST
|
if your value field is numeric then you will have to str value99, and I am not sure what the purpose of the last + is for gp.SingleOutputMapAlgebra_sa("CON( " + raster + " >= " + str(value99) + ", 99, 0)", Output)
... View more
06-30-2010
01:52 PM
|
0
|
0
|
616
|
|
POST
|
showing the script would help perhaps it is supposed to be argv as in sys.argv
... View more
06-29-2010
02:15 AM
|
0
|
0
|
956
|
|
POST
|
to all, I was reading the 10 help files http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000007000000.htm which indicates The input conditional raster does not affect whether the output data type is integer or floating point. If the input false raster (or constant value) contains floating-point values, the output raster will be floating point. If it contains all integer values, the output will be an integer raster. which I didn't compare to the 9.3.x help files, if that clarifies, with Bill's cavaet about range issues.
... View more
06-15-2010
03:30 PM
|
0
|
0
|
1116
|
|
POST
|
setnull http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?topicname=setting_values_to_nodata:setnull
... View more
06-12-2010
02:29 AM
|
0
|
0
|
1116
|
|
POST
|
http://arcscripts.esri.com/details.asp?dbid=14127 will do it if you select a unique ID field for the export (ie FID)
... View more
06-11-2010
01:38 AM
|
0
|
0
|
457
|
|
POST
|
perhaps, getcount http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1967&pid=1961&topicname=Get_Count_%28Data_Managementhttp://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Get_Count_(Data_Management)
... View more
06-10-2010
12:04 AM
|
0
|
0
|
3251
|
|
POST
|
I discovered that you could spend a lifetime studying random number generators and there are rabidly held beliefs as to which is the best BUTapparently MERSENNE_TWISTER, which is a pseudo-random number generator gets a relucant nod in many quarters (as long as you aren't doing cryptography). In any event, Python nods to this one in its stand "random" module, so it is good enough for me. I will defer to others to comment on the merits or lack thereof of the various generators. But as Bill has suggested several times in the above threads....testing is important if the results are to have any value.
... View more
06-08-2010
02:54 AM
|
0
|
0
|
287
|
|
POST
|
things changed between 9.2 and 9.3, specifically many "list***" methods now return python lists rather than enumerations. The nice thing is if you change the geoprocessor creation back to arcgisscripting.create() #9.2 version it will run as if 9.2 was used...not much lost either, give it a try it will save rewriting sections of the code
... View more
06-08-2010
02:49 AM
|
0
|
0
|
527
|
|
POST
|
LOL! Excellent summary! At least a framework for further testing is available. As Bill points out, none of the environment settings are available through the SA toolbar but are through Arctoolbox the equivalent links for 10 are: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000000w000000.htm http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000t5000000.htm
... View more
06-06-2010
09:12 AM
|
0
|
0
|
2235
|
|
POST
|
It appears that you can specify the type of random number generator to use since version 9.2 http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Random_number_generator It is well hidden but still there, as shown in the image. They have also added a section on distributions http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?topicname=distributions_for_assigning_random_values
... View more
06-06-2010
04:09 AM
|
0
|
0
|
2235
|
|
POST
|
Bill we would expect the chi-square statistic to be near 63 [the correct value is about 62.3]. I presume that this would be on average? Using Python's random module, a test of 100 runs it appears to be, but not for any individual case: Average chi_sq 62.3514575195 N runs: 100 Minimum chi_sq 39.1962890625 Maximum chi_sq 94.0982666016 using the attached code. I can confirm your observations about the SA generated grids in 9.3.1 In any event, if Python's random module is suitable, then you can use the following to create ascii files which can be converted (Conversion tools, To Raster, ASCII to Raster) to grids.
'''
write_ascii.py
specify the filename, classes etc below
'''
import random
output_file = "c:/temp/demo_ascii.asc"
classes = 64
ncols = 10
nrows = 10
xllcorner = 0
yllcorner = 0
cellsize = 1
NODATA_value = -9999
header = ["ncols " + str(ncols) + "\n",
"nrows " + str(nrows) + "\n",
"xllcorner " + str(xllcorner) + "\n",
"yllcorner " + str(yllcorner) + "\n",
"cellsize " + str(cellsize) + "\n",
"NODATA_value " + str(NODATA_value)]
out_file = open(output_file,'w')
for i in header:
out_file.write(i)
for i in range(nrows):
a_line = "\n"
for j in range(ncols):
a_val = int(random.random() * classes)
a_line += str(a_val) + " "
out_file.write(a_line)
out_file.close()
I forgot to mention, that you can also use: randint( a, b) random integer between a and b uniform( a, b) random float between a and b betavariate( alpha, beta) gammavariate( alpha, beta) gauss( mu, sigma) lognormvariate( mu, sigma) amongst others, in place of random.random, check the Python random module documentation
... View more
06-04-2010
03:27 AM
|
0
|
0
|
2235
|
|
POST
|
did you copy and paste the equation from the raster calculator? the first subtraction says Ratser 2 also, did you type in the equation or did you select rasters and the operands to form the expression?
... View more
05-24-2010
02:38 AM
|
0
|
0
|
814
|
|
POST
|
that pow syntax is for Arcview 3.x, check the help for your version of arcmap, ie for 9.3 http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=6335&pid=6312&topicname=Pow
... View more
05-24-2010
02:34 AM
|
0
|
0
|
508
|
|
POST
|
did you google "dbase Python" since there are a number out there ie http://code.activestate.com/recipes/362715-dbf-reader-and-writer/
... View more
05-18-2010
02:49 AM
|
0
|
0
|
1366
|
|
POST
|
Ok, large grid...presuming that the output is a table, perhaps, the display is just set to 6 decimal points. If you had any capabilities to get the raster out to a numpy array, then the summation is simple (raster shown as a list of lists)
>>> import numpy
>>> a = numpy.array([[1,1],[2,2]])
>>> a.sum()
6
and all your conversion could be done to arrays using Python as your programming platform
... View more
05-10-2010
01:45 PM
|
0
|
0
|
1902
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-05-2019 05:21 PM | |
| 1 | 09-02-2016 08:05 AM | |
| 1 | 01-15-2018 01:10 PM | |
| 1 | 09-17-2018 12:48 AM | |
| 1 | 02-20-2020 02:55 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|