Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7582401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:25:36+00:00 2026-05-30T18:25:36+00:00

I am using ArcGIS focal statistics tool to add spatial autocorrelation to a random

  • 0

I am using ArcGIS focal statistics tool to add spatial autocorrelation to a random raster to model error in DEMs. The input DEM has a 1.5m pixel size and the semivariogram exhibits a sill around 2000m. I want to make sure to model the extent of the autocorrelation in the input in my model.

Unfortunately, ArcGIS requires that the input kernel be in ASCII format, where the first line defines the size and the subsequent lines define the weights.

Example:

5 5
1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1

I need to generate a 1333×1333 kernel with an inverse distance weighting and immediately went to python to get this done. Is it possible to generate a matrix in numpy and assign values by ring? Does a better programmatic tool within numpy exist to generate a plain text matrix.

This is similar to this question, but I need to have a fixed central value and descending rings, as per the example above.

Note: I am a student, but this not a homework assignment…those ended years ago. This is a part of a larger research project that I am working on and any help (even just a nudge in the right direction) would be appreciated. The focus of this work is not programming kernels, but exploring errors in DEMs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:25:37+00:00Added an answer on May 30, 2026 at 6:25 pm

    I’m not sure if there is a built-in way, but it should not be hard to roll your own:

    >>> def kernel_thing(N):
    ...   import numpy as np
    ...   n = N // 2 + 1
    ...   a = np.zeros((N, N), dtype=int)
    ...   for i in xrange(n):
    ...     a[i:N-i, i:N-i] += 1
    ...   return a
    ... 
    >>> def kernel_to_string(a):
    ...   return '{} {}\n'.format(a.shape[0], a.shape[1]) + '\n'.join(' '.join(str(element) for element in row) for row in a)
    ... 
    >>> print kernel_to_string(kernel_thing(5))
    5 5
    1 1 1 1 1
    1 2 2 2 1
    1 2 3 2 1
    1 2 2 2 1
    1 1 1 1 1
    >>> print kernel_to_string(kernel_thing(6))
    6 6
    1 1 1 1 1 1
    1 2 2 2 2 1
    1 2 3 3 2 1
    1 2 3 3 2 1
    1 2 2 2 2 1
    1 1 1 1 1 1
    >>> print kernel_to_string(kernel_thing(17))
    17 17
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
    1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1
    1 2 3 4 4 4 4 4 4 4 4 4 4 4 3 2 1
    1 2 3 4 5 5 5 5 5 5 5 5 5 4 3 2 1
    1 2 3 4 5 6 6 6 6 6 6 6 5 4 3 2 1
    1 2 3 4 5 6 7 7 7 7 7 6 5 4 3 2 1
    1 2 3 4 5 6 7 8 8 8 7 6 5 4 3 2 1
    1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1
    1 2 3 4 5 6 7 8 8 8 7 6 5 4 3 2 1
    1 2 3 4 5 6 7 7 7 7 7 6 5 4 3 2 1
    1 2 3 4 5 6 6 6 6 6 6 6 5 4 3 2 1
    1 2 3 4 5 5 5 5 5 5 5 5 5 4 3 2 1
    1 2 3 4 4 4 4 4 4 4 4 4 4 4 3 2 1
    1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1
    1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the localStorage in this demo here, http://help.arcgis.com/en/webapi/javascript/arcgis/demos/exp/exp_webstorage.html Basically it is a
Using MVC2 I have an AJAX form which is posting to a bound model.
using a binary search tree I need to add to a vector all int
Using the ArcGIS Server Flex API, is there a way to convert mouse coordinates
We are currently designing a GIS intranet application using GWT and ESRI ArcGIS. We
I would like to add an ILayer created from an ArcGIS Server Map service
I am trying to automate various tasks in ArcGIS Desktop (using ArcMap generally) with
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using ASP.NET MVC there are situations (such as form submission) that may require a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.