POST
|
Thanks Xander for the reply. Please download the attached data for the investigation. https://bft.usu.edu/9hqtv
... View more
12-23-2017
07:44 AM
|
0
|
25
|
968
|
POST
|
Thanks. Dan. I did not quite understand what you mentioned above. In fact, I have converted the polygon raster file to the same projection as with the soil moisture raster. I ran the "Zonal Statistics as Table" tool but still it did not solve the problem. I am kind of frustrated why this is not working.
... View more
12-21-2017
01:28 PM
|
0
|
1
|
2130
|
POST
|
Dan, The missing grids are shown in Black color in the image below.
... View more
12-21-2017
12:27 PM
|
0
|
3
|
2130
|
POST
|
Thanks Dan for the input. I had some luck but not 100%. As you suggested, I set the environment variables, as follows in the image below. Extent as the polygon raster layer and snap raster as my soil moisture raster layer. (See image below). I got 16 T_R IDs (Zonal mean) values with setting up the environment variable. (See the table below for the values for 16 T_R IDs). Any idea why not values for all T_R IDs even after setting the environment variables? Thanks gain.
... View more
12-21-2017
11:57 AM
|
0
|
1
|
2129
|
POST
|
Xander, Thanks again for your input. I have converted the polygon to raster and please see the image below. Polygon raster contains all the T_R IDs. (See the table). As a test, I have used the polygon raster as shown above and did the Zonal Statistics as Table but still it contains only less number of T_R IDs. (Please see the image below). Any idea why still its happening? Thanks.
... View more
12-21-2017
11:16 AM
|
0
|
1
|
2129
|
POST
|
Hi, I need to estimate zonal statistics (MEAN) using the "Zonal Statistics as Table" tool in ArcGIS. I have the underlying raster in color (see the image below) and the polygon (grid, TownWilson) in pink color. As you can see, there are 20 grids in the TownWilson grid (shapefile). The grid IDs (T_R) are shown in the table below. "Zonal Statistics as Table" tool and set up the environment variables as shown below. The output table and after the Zonal Statistics as Table run is complete is as follows. It shows zonal mean statistics for ONLY 12 grid IDs (T_R) out of 20 grid IDs in the original TownWilson table above. Can somebody help me to obtain the statistics for all the T_R IDs in the grid? I cant understand what I am doing wrong here. Thanks in advance for help.
... View more
12-21-2017
08:54 AM
|
0
|
35
|
7546
|
POST
|
Hi, I have the following python script to create a TEXT column called "SEC" and then I need to perform a Field calculator operation for the SEC column. I want to read the corresponding string in the "mtrs" column and and fill in SEC column. I have performed this task manually and it worked. I need to slice the "mtrs" string like this "S{}".format(int( !mtrs! [17:19]))" and fill in SEC column. My script below give me an error in line 14. SyntaxError. invalid syntax. Can somebody help me to fix this and make this work? Thanks in advance, # Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "H:/Test/Points.gdb"
# Set local variables
inFeatures = "plsssection_test_p1"
fieldName1 = "SEC"
length = 20
expression = ""S{}".format(int( !mtrs! [17:19]))"
# Execute AddField twice for two new fields
arcpy.AddField_management(inFeatures, fieldName1, "TEXT", length, "", "")
arcpy.CalculateField_management(inFeatures, "SEC",expression, "PYTHON_9.3")
... View more
12-14-2017
03:20 PM
|
0
|
4
|
1614
|
POST
|
I need to add "_var86" to the filename which will be the output name for the raster.
... View more
11-27-2017
08:24 AM
|
0
|
0
|
1742
|
POST
|
No. I need to change the file name for the "outRaster" not the "TempLayerFile"
... View more
11-27-2017
08:22 AM
|
0
|
3
|
1742
|
POST
|
HI, I need to add "_var86" to the output file in the code below. How can I achieve it in the code below. Thanks in advance. import arcpy, sys
from arcpy import env
from arcpy.sa import *
# Input data source
arcpy.env.workspace = r"C:/Users/Desktop/weekly_avg_project"
arcpy.env.overwriteOutput = True
# Set output folder
OutputFolder = r"C:/Users/Desktop/weekly_avg_project/output"
# Loop through a list of files in the workspace
NCfiles = arcpy.ListFiles("*.nc")
for filename in NCfiles:
print("Processing: " + filename)
inNCfiles = arcpy.env.workspace + "//" + filename
fileroot = filename[0:(len(filename)-3)]
TempLayerFile = "SM_amount"
outRaster = OutputFolder + "//" + fileroot
# Process: Make NetCDF Raster Layer
outfile = arcpy.MakeNetCDFRasterLayer_md(filename, "var86", "lon", "lat", TempLayerFile, "", "", "BY_VALUE")
proj_ras = arcpy.ProjectRaster_management(outfile, "C:/Users/Desktop/weekly_avg_project/project_ras","GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "NEAREST", "0.125 0.125", "NAD_1983_To_WGS_1984_1", "", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]")
# Process: Copy Raster
arcpy.CopyRaster_management(proj_ras, outRaster + ".tif", "", "", "", "NONE", "NONE", "")
... View more
11-27-2017
08:09 AM
|
0
|
5
|
5337
|
POST
|
Thanks for your reply David. No there is no pattern. I checked it by doing manually suing the "zonal statistics as Table" tool but still produced the same output identical to the output by the script. Then I stored the shape file (County_Grid.shp) and the raster in the geodatabase and ran the script but no luck. The grids the shapefile are in 1 mile x 1 mile. Instead, as a trial, I used a county shapfile across the state of Kansas, USA and used the FIPS codes as the ID and it worked by producing zonal means for all the counties for the KS state. But, I really want to make it run for the County_Grid.shp in which grids are in 1 mile x 1 mile resolution to obtain the zonal means for all S_R_T. Any idea?
... View more
10-27-2017
07:48 AM
|
0
|
1
|
1059
|
Title | Kudos | Posted |
---|---|---|
1 | 02-03-2015 12:04 PM | |
1 | 01-23-2015 04:00 PM | |
1 | 01-29-2015 04:14 PM | |
1 | 01-30-2015 12:59 PM | |
2 | 10-09-2017 09:41 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|