|
POST
|
Reply from Dan Patterson If the rasters aren't huge convert to points, then Ordinary Least Squares (OLS)—Help | ArcGIS for Desktop I think the report allows for a graph
... View more
10-11-2016
05:54 AM
|
0
|
0
|
7304
|
|
POST
|
Thank you. I am not getting your points. i am trying plot two variable of raster like this ...
... View more
10-11-2016
05:53 AM
|
0
|
1
|
7304
|
|
POST
|
Reply from Dan Patterson before you go off into a side tangent of graphing and trying to 'correlate', 'predict' or extrapolate see... Geographically Weighted Regression (GWR)—Help | ArcGIS for Desktop Only if you are working with interval/ratio and there is some real predictive behaviour between the two variables. Looking for correlations, relationships between two variables via a magical statistical test is overused. But if you are looking for an association then the above and other substitutes will save a flurry of activity in the wrong direction For nominal data... Combine—Help | ArcGIS for Desktop gives you the basis for tests of Association such as the chi-squared test. And at worst it gives you a tabular output for discussion Make your intent clear and specific... otherwise people with keep throwing suggestions out that will meet vague goals ... not necessary specific ones.
... View more
10-11-2016
05:52 AM
|
0
|
2
|
7304
|
|
POST
|
Dan Patterson Thank you. I want to do on cell by cell basis. I have two different parameters of raster data, so one parameter i want to plot in X axis and another one Y axis to make it relation between two parameters. How do i convert it in row and column format. can i convert it in ASCII format? Data is tiff format same as which we got from our above scrip suggested by xander_bakker
... View more
10-11-2016
05:49 AM
|
0
|
3
|
7304
|
|
POST
|
xander_bakker, Thank you for the suggestion. I am extremely sorry. Next time surely i will follow your suggestion. Sorry for the inconvenience.
... View more
10-11-2016
05:41 AM
|
0
|
0
|
636
|
|
POST
|
Thank you. I am not getting your points. i am trying plot two variable of raster like this ...
... View more
10-11-2016
01:48 AM
|
0
|
4
|
1916
|
|
POST
|
Dan Patterson. Thank you. I want to do on cell by cell basis. I have two different parameters of raster data, so one parameter i want to plot in X axis and another one Y axis to make it relation between two parameters. How do i convert it in row and column format. can i convert it in ASCII format? Data is tiff format same as which we got from our above scrip suggested by Xander Bakker.
... View more
10-11-2016
01:21 AM
|
0
|
2
|
1737
|
|
POST
|
Xander Bakker and Dan Patterson , Kindly your cooperation is highly appreciate. I have two raster file, i want to perform Scatter plot of those raster . I found one code that is written by Dan Patterson Below code from matplotlib import pyplot as plt
xs = [1,3,2,5,6,4] # Which fomart of data i have to give here?
ys = [3,2,1,5,3,2]
plt.scatter(xs, ys)
main_title ="My first graph"
plt.title(main_title, loc='center') #loc is either left, right or center
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2)
plt.tick_params(which='minor', direction='in', length=4, width=2)
plt.show() Earlier Dan suggest to someone convert those raster to arrays. I followed the same but could not solve it. How to process tiff to array. how do i execute two raster in X and Y axis. I have tiff images. Branched from Perform Raster Calculation from Multiple Sub-folder Using ArcPy
... View more
10-11-2016
12:19 AM
|
0
|
24
|
15285
|
|
POST
|
xander_bakker. Thank you very much. Above Code running perfectly. Regarding error issue which you got different error massage, because i corrected that line before running script.
... View more
10-09-2016
12:19 PM
|
0
|
1
|
1916
|
|
POST
|
Thank you very much all of you for your kind cooperation. Xander Bakker I ran the above code , but i am getting error. I think not having problem with code. Might be we need more explanation what i am trying to do, please follow the below Message File Name Line Position
Traceback
<module> <module1> 20
CellStatistics C:\Program Files\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\Functions.py 2951
swapper C:\Program Files\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\Utils.py 53
Wrapper C:\Program Files\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\Functions.py 2947
RuntimeError: ERROR 999998: Unexpected Error.
I am giving here what I am trying to do, I have three sub-folder (Name : NPP_2008, NPP_2009, NPP_2010), NPP_2008 NPP_2009 NPP_2010 MEAN_NPP (output Folder)
r001_NPP.tif r001_npp.tif r001_NPP.tif r001_MEAN_NPP.tif (mean of all r001_NPP)
r002_NPP.tif r002_npp.tif r002_NPP.tif r002_MEAN_NPP.tif (mean of all r002_NPP)
So on ..............
Every sub-folder hold monthly raster data for different year with the name of e.g r001_NPP, r002_NPP……..r012_NPP. So I want calculate mean of those raster which is r001_NPP series in every sub-folder, similarly program will loop through till r012_NPP series of all raster to calculate mean and save it another subfolder (Name : Mean_NPP) with output name 001_MEAN_NPP(which is mean of all r001_NPP), 002_MEAN NPP…..012_MEAN_NPP. Here with i have attached reference raster which i am using for my raster calculation
... View more
10-08-2016
10:52 PM
|
0
|
3
|
1916
|
|
POST
|
Dan , thanks . I have solved the indentation error, and i updated my code but still i could not solve the problem, updated code below error masage ile "<module1>", line 18
sum.save(os.path.join(out_workspace, 'r{0}_MEAN_NPP.TIF'.format(ras_num)
^
SyntaxError: invalid syntax Updated Code import arcpy
arcpy.CheckOutExtension("spatial")
from arcpy.sa import *
# generate list of rasters
workspace = r"D:\TEST"
out_workplace = "D:\TEST\MEAN_NPP"
for ras_num in [str(i).zfill(3) for i in range(1, 12)]:
rasters = []
walk = arcpy.da.Walk(workspace, datatype="RasterDataset", type="TIF")
for dirpath, dirnames, filenames in walk:
for filename in filenames:
rasters.append(os.path.join(dirpath, filename))
# calculate mean
sum = CellStatistics(rasters, "MEAN")
sum.save(os.path.join(out_workspace, 'r{0}_MEAN_NPP.TIF'.format(ras_num)
... View more
10-08-2016
02:34 AM
|
0
|
2
|
2594
|
|
POST
|
xander_bakker, We need your cooperation to solve above problem. Kindly cooperate with us.
... View more
10-08-2016
01:36 AM
|
0
|
0
|
1916
|
|
POST
|
Dan . thanks , you are right. I didn't post the error massage. Line no 13 i am getting the Indentation Error massage. I tried to fix it but not solved yet. error massage below File "<module1>", line 13
rasters.append(os.path.join(dirpath, filename))
^
IndentationError: expected an indented block
... View more
10-07-2016
11:29 PM
|
0
|
5
|
2594
|
|
POST
|
Thank you. I have updated my suggested by you, problem still persist, i am not understanding how to iterate through each folder, take all series of 001_NPP from all folder and calculate average oh them and save it as 001_NPP_MEAN, below is my updated code and along with code i have attached reference raster also which i am using for my raster calculation, import arcpy
arcpy.CheckOutExtension("spatial")
from arcpy.sa import *
# generate list of rasters
workspace = r"D:\TEST"
out_workplace = "D:\TEST\MEAN_NPP"
rasters = []
walk = arcpy.da.Walk(workspace, datatype="RasterDataset", type="TIF")
for dirpath, dirnames, filenames in walk:
for filename in filenames:
rasters.append(os.path.join(dirpath, filename))
# calculate mean
sum = CellStatistics(rasters, "MEAN")
sum.save(os.path.join(out_workspace, "npp_sum.tif")
... View more
10-07-2016
10:27 PM
|
0
|
1
|
2594
|
|
POST
|
I have five subfolders with Rasters name with the same parameter. I am trying to figure out a way to Loop average of all raster and save output raster in outfolder . For instance Subfolder1 Subfolder2 Subfolder3 Subfolder4 Subfolder5 Outfolder
r001_NPP.tif r001_npp.tif r001_NPP.tif r_001_NPP.tif r001_NPP.tif r001_MEAN_NPP.tif
I have tried to write code for this, Below i post my code what i have so far import arcpy, os, glob
arcpy.CheckOutExtension("Spatial")
ws1 = glob.glob(r'D:\subfolder1\*.tif')
ws2 = glob.glob(r'D:\subfolder2\*.tif')
ws3 = glob.glob(r'D:\subfolder3\*.tif')
ws4 = glob.glob(r'D:\subfolder4\*.tif')
ws5 = glob.glob(r'D:\subfolder5\*.tif')
outws = r'D:\outfolder'
for r in ws1, ws2, ws3, ws4:
basename = os.path.basename(r).split("_")[0]
r1 = arcpy.sa.Raster(os.path.join(ws1, basename + "r_NPP.tif"))
r2 = arcpy.sa.Raster(os.path.join(ws2, basename + "r_NPP.tif"))
r3 = arcpy.sa.Raster(os.path.join(ws3, basename + "r_NPP.tif"))
r4 = arcpy.sa.Raster(os.path.join(ws4, basename + "r_NPP.tif"))
r5 = arcpy.sa.Raster(os.path.join(ws5, basename + "r_NPP.tif"))
result = (r1 + r2 + r3 + r4 + r5) / 5
outname = basename + "r_Mean_NPP.tif"
result.save(os.path.join(outws, outname))
... View more
10-07-2016
05:14 AM
|
0
|
23
|
6351
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-01-2017 09:56 PM | |
| 1 | 01-19-2017 08:03 AM | |
| 1 | 07-31-2017 11:57 AM | |
| 1 | 08-25-2016 09:38 AM | |
| 1 | 08-17-2016 11:13 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:25 AM
|