NumPy is a Python module, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays.

learn more… | top users | synonyms

3
votes
0answers
64 views

Select shape file by their coordinates behavior [closed]

I want to filter shapefiles by their latitude behaviour: If the latitudes of edges A and B are constantly decreasing or increasing then this class marked as correct, otherwise are incorrect. For ...
1
vote
0answers
38 views

Write stacks of GeoTIFF image to NetCDF by chunk size

I converted GeoTIFF image stacks to NetCDF file with writing data by Index order (layer by layer) (this was a main solution). The problem is, it writes slowly (for 25 images - 1Gb takes 90 seconds). ...
0
votes
0answers
19 views

Using numpy.dstack() for merging two 3D arrays but losing spatial reference.

The code is as following: >>> temp = numpy.dstack((spi_negative,spi_positive)) >>> >>> temp.shape (16, 126, 294) >>> out_ras = ...
1
vote
1answer
37 views

Anaconda and ArcGIS 10.1

I am having problems installing Anaconda with ArcGIS 10.1. My problem is specifically with pandas. ArcGIS python is my default python version. I installed python 0.16.2 in this version, which ...
-1
votes
2answers
30 views

applying equation on numpy array [closed]

I have a 3d array: >>> print arr_u_num [[[ nan -3.90149352 -1.21931281 -1.08366785] [ nan -2.07270503 -1.27621887 -0.89320389] [ nan -2.69618795 -1.98927089 ...
1
vote
1answer
54 views

how to save a raster after converted from numpy array?

I'm trying to save a raster after calculation in numpy array. Here is what I wrote: rasterSM = arcpy.NumPyArrayToRaster(SM, lowerLeft, cellSize, value_to_nodata=nodata) rasterSM2 = ...
1
vote
2answers
32 views

Trying to maintain spatial reference on newly created numpy array

I am trying to copy the values from raster into newly created array and then trying to save the array with same spatial reference as raster file inRas = arcpy.GetParameterAsText(0) double_layer = ...
0
votes
0answers
26 views

return _NumPyArrayToRaster(*args, **kwargs) ValueError

I am trying to make an array to raster from the defined array below. However, I keep getting this error: return _NumPyArrayToRaster(*args, **kwargs)ValueError: Argument in_array: A two or three ...
1
vote
0answers
42 views

TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.ndarray'

I am trying to insert a value for different group of percentile eg (0- 10 percentitle) value = 1. I saw an example over here and went to try it out How do I Calculate Grouped Percentiles or Batch ...
4
votes
2answers
120 views

Reconstructing MODIS time-series applying Savitzky-Golay Filter with Python/Numpy

I want to apply the 'Savitzky-Golay' (savgol) filter to my time series, MODIS dataset, to remove noise (i.e., cloud pixels, etc.) in my data. MODIS have quality flags that indicates the reliability of ...
3
votes
1answer
74 views

Optimizing Python GDAL ReadAsArray

I am using the GDAL ReadAsArray method to work with raster data using numpy (specifically reclassification). As my rasters are large, I process the arrays in blocks, iterating though each block and ...
1
vote
0answers
19 views

Read latitude/longitude to create new point grid at higher resolution

New to SE, needed to reformat my other question. Basically I'm looking at reading a CSV with longitude and latitude points (in this case housing exposure, simplified below): HUC4,Longitude,Latitude ...
0
votes
0answers
22 views

More pythonic approach to resolution increase of point locations

Excuse my first question being slightly more Numpy and less actual GIS, but it relates to latitude / longitude so I thought I'd give it a shot. Problem: I have a flat file with latitude and ...
2
votes
2answers
71 views

Numpy error when computing scores based on percentiles

I want to calculate scores in one field based on the percentile (in steps of 10) the row falls into in another field. I found a solution here (Calculating Percentiles in ArcMap?) that I tried out, ...
2
votes
1answer
54 views

Determining proportion of raster cells containing each value from list for many rasters in raster stack?

I wrote a function to determine the proportion of raster pixels that contain each of a list of values that I would be interested in. I then wrote a function to apply the previous function to a 3d ...
0
votes
0answers
205 views

Convert Raster to Numpy Array with only Arcpy and Numpy

All the articles I'm finding including GDAL or PIL(?) which I cannot use. So I am trying to convert a raster I have to a Numpy Array with Arcpy and Numpy and then calculate some statistics on it but ...
3
votes
2answers
118 views

Total count of values at each pixel in a raster stack/ 3d array

If you have an array with x, y and z dimensions, how can I create an array of x, y dimensions that holds a count of how many z values at each location (x,y) are noData? I would prefer to use numpy ...
1
vote
0answers
205 views

Reading, modifying and writing a geotiff with GDAL in python

I'm trying the learn the ropes of Remote Sensing image processing using Python GDAL bindings and numpy. As a first attempt, I'm reading a Landsat8 geotiff file, do a simple manipulation and write the ...
2
votes
1answer
135 views

Reclassify a raster value to -9999 and set it to the nodata value using python and or gdal

I modified a script which reclassifies a raster. It is based on the script by Roger in his blog (the second script) and it works pretty well.The problem I am facing is as follows: I would like to ...
0
votes
0answers
98 views

stack raster using GDAL and numpy dstack

I am testing Savitzky-Golay filter with my MODIS dataset. Currently I am testing for 10 rasters (but later on will use my whole dataset) only just to test how should I create my script. So my initial ...
2
votes
2answers
200 views

Raster reclassify using python, gdal and numpy

I would like to reclassify a raster file from a raster with 10 classes to a raster with 8 classes using pyhton, gdal and/or numpy. The classes are represented as integers. I have tried following the ...
0
votes
1answer
95 views

NumPy is missing, but fixing the environment variable removed my printer settings?

I recently installed regular Python on my workstation in addition to ArcGIS 10.2. Based on various things I found online, it seemed like the consensus was to install the full Python, because there are ...
1
vote
1answer
79 views

How to calculate the raster statistics with polygon layer using numpy and scipy in python?

I have used zonal statistics from processing to calculate the raster statastics with polygon layer. processing.runalg('qgis:zonalstatistics', rlayersource, 1, vlayer, None, True, Path) But this is ...
3
votes
1answer
174 views

Converting large rasters to NumPy

I have a geodatabase that contains a large number of raster datasets - there are two rasters for each country in the world, and they are very large, in some cases up to 3GB per raster dataset. I ...
2
votes
2answers
99 views

Finding the pixel coordinates using GDAL/numpy

Is there a way to get the XY cordinates of a pixel based on the array index using numpy/gdal? I have a new set of extents for a raster and, based on these newer extents, want to determine the ...
0
votes
1answer
37 views

Identify polygons greater than n-th percentile and perform further analyses using arcpy

My goal is to identify tracts that are above the 99 percentile of a variable (xvar), to dissolve contiguous tracts by summing a variable (yvar), and to get the coordinates of the centroids ...
1
vote
1answer
86 views

Segmentation fault while writing an output raster by blocks with rasterio

With the answer on my previous question, I was able to set up reading a raster by blocks. I did some computation and now I try to write the result into another raster. However, the program fails with ...
2
votes
1answer
117 views

QGIS Contour Plugin Says No Shapely; can import shapely in QGIS console

I'm keen to create some contours (isochrones for a pedestrian 'ped-shed' catchment) from a point dataset in QGIS, using the contour plugin from the Plugins repository. I installed the plugin, but ...
2
votes
0answers
63 views

arcpy RasterToNumPyArray causes shift in location of values

I am converting a couple rasters to arrays, then performing calculations on them. First step- polygon to raster. This creates a 1/0 mask that I can multiply the larger raster by. After noticing my ...
1
vote
0answers
65 views

How to accelerate my python looping process for A-star path finding on DEM surface?

I try to make an A-star Path Finding program base on tile-graph (image raster data as graph) where each pixel values represent as cost and elevation.. In my case, DEM raster data was called by using ...
1
vote
1answer
1k views

AttributeError: 'module' object has no attribute 'TabletoNumPyArray'

I am trying to create a Python array using data from an ArcGIS attribute table. Here's the code I've written so far: import arcpy import numpy input = "c:/data/from/arcgis" arr = ...
2
votes
1answer
186 views

Plotting “large” image with points with matplotlib - MemoryError

I want to plot an image of 3193 x 3293 pixels with 1502 points. When running in a smaller image and less points (934,722 pixels and 60 points), everything runs perfectly. I wrote like this: # I am ...
2
votes
1answer
94 views

Downsampling Geotiff using summation - Gdal/Numpy

I am trying to downsample a 1 square km raster dataset to a much larger (.5 degree x .66 degree) dataset by summing all of the pixel values within this large grid cell. gdal_warp does not contain a ...
1
vote
0answers
74 views

ArcPy reading a raster in a moving window?

I typically read large raster data using gdal and setting up a moving window of 256*256 pixels (for example). I recently had to do some processing using arcpy, so I did the same thing, using ...
1
vote
1answer
71 views

Compute annual mean of overlapping cells using daily rasters

I am stuck at somewhat simple looking calculation. I have daily temperature rasters from 2001 to 2014 with following name format: `2001001` `2001002` | | `2014365` I want to compute annual mean ...
0
votes
1answer
522 views

How to place an numpy array into GeoTIFF image using python-gdal

I am attempting to export data of varying scales into GeoTIFF images...a new method for me. The problem I'm running into is when using the GDT_Byte pixel type, data values < 0 and > 256 are not ...
-2
votes
1answer
88 views

NumPy Array to Feature Writes only first array object to feature class [closed]

I am consuming a json web-service with NumPy Array to Feature, I have many nested try/except blocks to consume the data/find errors/etc. The script is functional, however I am having trouble seeing ...
1
vote
1answer
245 views

QGIS / Python: Fill new field with values based on other fields and lookup table

I am trying to use Python for QGIS to add values to new fields in an attribute table based on existing fields and values in a lookup table. Attribute table I wish to modify (with example rows): farm ...
2
votes
0answers
85 views

Converting points using FeatureClassToNumPyArray to interpolate cross-section with scipy “interpolate” [closed]

I'm trying to plot elevation cross section and extract elevations along a cross section using scipy's "interpolate" function. I'm converting a point feature class of profile elevation points to 2 ...
1
vote
1answer
165 views

gdal_array.SaveArray() leaves dataset open in Python

When I use gdal_array.SaveArray() to create a raster, the newly created dataset appears to stay open in Python, preventing other processes from working with it. For instance, consider the following ...
3
votes
2answers
261 views

Efficient ways to read table data from a large feature layer?

I have a feature layer that contains about 460,000 records and it currently takes about 20 minutes to read that table using the arcpy.da.TableToNumPyArray() tool. Is there a more efficient way to read ...
1
vote
1answer
72 views

NumPy Array to Feature Class: NameError from Inner Loop Variables

I have a NumPy Array to FC script that parses a JSON web-service. The outer loop writes to my FC correctly, however my inner loop variables come back as not defined when appending the items. The ...
3
votes
0answers
358 views

How does gdal_calc numpy operators work?

Gdal_calc manual Gdal_calc is introduced as : gdal_calc.py - Command line raster calculator with numpy syntax gdal_calc.py [-A <filename>] [--A_band] [-B...-Z filename] [other_options] ...
0
votes
0answers
96 views

Python error in array declaration

I am getting a error as follows File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy__init__.py", line 2292, in NumPyArrayToRaster return _NumPyArrayToRaster(*args, **kwargs) ValueError: ...
0
votes
1answer
377 views

Fixing Raster Calculator Error 000539 ImportError: No module named numpy? [duplicate]

I've created 4 hillshades for a particular area to represent the 4 seasons in a year. The equation I now need to use to determine solar insulation is 1000*hillshade/255 in raster calculator. However, ...
0
votes
1answer
335 views

ArcGIS Raster Calculator error 000539 ImportError: No module named numpy?

I am running ArcGIS 10.2.1 on Win7 64bit. I have finished doing an NDVI, and after defining a vegetation presence threshold at 0.05, opened the Raster Calculator (via Map Algebra in the Arc Toolbox) ...
4
votes
1answer
478 views

Replicating result of gdalwarp using gdal Python bindings

I am trying to re-project/resample with the GDAL python bindings, but am getting slightly different results compared to those from the command line utility gdalwarp. See update below for shorter ...
0
votes
1answer
144 views

Is it possible from the list or np.array, updating the table using arcpy.da.UpdateCursor?

I have created array. Is it possible to update an existing table if the number and order of columns and rows identical? In the array do not have a column headers. for example: array = ...
1
vote
2answers
244 views

Trouble importing NumPy in GRASS. Architecture

I can't get GRASS to work on my system, and after doing some digging I think it is related to me using 64-bit python. I'm not really sure. I get this message... This module requires the ...
1
vote
0answers
26 views

Raster Vector stack

I want clipped image of NDVI for a particular area. I did raster calculation for getting the image with NDVI values. After that I tried extraction function clipper. In this function we have to use two ...