NumPy is an extension to the Python programming language, 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

2
votes
2answers
51 views

Memory and Processing Efficient Approach to Read a Timeseries in Python

I am trying to store a timeseries of high resolution raster images containing NDVI values into a dictionary for calculations. I am curious as to which approach may the most efficient when loading ...
0
votes
0answers
22 views

how to solve TypeError in python? [closed]

I have two functions as follows: def messageWindow(): # here i will invoke a new window which display all the images in dataset # along with i'm calculating blue, green, red mean, and ...
0
votes
0answers
22 views

No data appears when using gdal_calc.py but source had data values

I'm in the process of calculating topographic exposure using a mix of GDAL, grass, R and python in Windows. I need to process a very large tiff file using the following calculation: ...
-2
votes
1answer
79 views

QGIS converting to ASCII question

I am attempting to do some analysis on a raster file and I need to convert it to ASCII. In QGIS, I used [Raster -> Conversion -> Translate] with the asc file format, and I suspect it is simply ...
1
vote
1answer
141 views

Convert polygons in shape file to a numpy array?

I have a shape file containing a number of polygons and all attributes being text. I'm trying to import the polygons into numpy as an array where each polygon is represented as unique values. I ...
1
vote
3answers
274 views

Is it possible to open rasters as array in NumPy without using another library?

I know that it is possible to open a raster as an array in NumPy using GDAL, but I want to skip GDAL and use NumPy only, as it is cooler handling rasters with NumPy as matrices. There is a similar ...
10
votes
3answers
223 views

How to convert LAS file to numpy array?

I have begun learning how to manipulate LAS data in python and wanted to see how others handle LAS files. I would like to read the points (I am using a numpy array), and filter out classes 1 and 2 ...
4
votes
1answer
106 views

How to publish GP Service with importing of numpy in ArcGIS for Server 10.1?

I use a lot of scripts as GP Service almost all use the arcpy functions but one (and very important) of my scripts needs a gdal/ogr and numpy imports. I can run this script in PyScripter or as a tool ...
2
votes
0answers
165 views

Finding coordinates from a nested grid as a numpy array

So this is a pretty basic question, but I'm trying to figure it out. I've written a script that allows a user to read in a raster and provide a cell resolution, and outputs the amount of cells ...
1
vote
0answers
82 views

Efficient computation of path profile with Numpy and GDAL

I have numpy array with SRTM elevation data and I need calculate path profiles - vectors with elevation data from one point (transmitter) to every points of my map. Here's my current solution: def ...
0
votes
0answers
58 views

changing array values using a 'look-up array'

I am struggling to solve what appears to be a simple numpy array problem. I have the array 'array_tocalib' which I need to correct (it is a RADAR image). To correct it I look up the value in the ...
2
votes
0answers
38 views

Tabulate Area using GDAL and Numpy

How could I perform a Tabulate Area using GDAL and Numpy? I am trying to summarize how many pixels of each class in a Landcover raster are within each polygon of a Census Blocks shapefile. I've ...
2
votes
0answers
119 views

Buffering a Raster with GDAL and Numpy

I am using GDAL to convert a raster dataset into a numpy.array and then using numpy to buffer the data in the raster. For example, I need to know all the regions within 100ft of a school point ...
2
votes
1answer
52 views

arcpy array: trouble with reassigning inf to 0

I've converted rasters to arrays via arcpy.RasterToNumPyArray() then divided them by 1. Some resulting values are zero and I need to reassign them after the division to zero. The array types are ...
0
votes
1answer
113 views

Problem with converting rasters to arrays and adding them to main array, then converting to raster via NumPyArrayToRaster : output is NoData values

I have a process that aims to loop through a list of rasters (testing with only 3) covert each raster to an array, add the array to an existing 'template' array, then save the final array back to a ...
1
vote
0answers
115 views

How to create multi-image single band single file geotiff?

I have a geotiff file that is single band but contains multiple subdatasets. I use gdal with numpy to open a specific subdataset and mask some of its values. Example: $ gdalinfo sample.tif ... ...
0
votes
1answer
523 views

Display a georeferenced DEM surface in 3D matplotlib

I want to use a DEM file to generate a simulated terrain surface using matplotlib. But I do not know how to georeference the raster coordinates to a given CRS. Nor do I know how to express the ...
6
votes
1answer
331 views

ArcGIS Desktop 10.1 SP1: how to install/use additional Python modules?

I'm currently working on a project where I have to identify geomorphological features in a digital elevation model. Since the aim is to have a single ArcGIS Toolbox integrating all processing steps in ...
4
votes
1answer
317 views

Subsetting GeoTIFF with Python

I'm sub-setting a GeoTIFF with the GDAL Python binding and numpy. Essentially, I am providing a central location (coordinates of a flux tower) from which I produce a subsetted image. I then want to ...
3
votes
1answer
568 views

Iterating through an numpy array and index to a value in another numpy array

I am struggling to get this code to work I want to iterate through an numpy array and based on the result, index to a value in another numpy array and then save that in a new position based on that ...
5
votes
1answer
387 views

Does anyone use both ArcGIS and Python(x,y)?

I'm trying to get ArcGIS 10.1 and Python(x,y) to peacefully co-exist with a unified installation of Python. Surely someone else is using both these tools... right? Pointers would be much appreciated. ...
1
vote
1answer
105 views

Problem with calculating the total cell values

aa= arcpy.RasterToNumPyArray("water_depth") sum = numpy.sum(aa) print sum -2933737 Why I am getting negative values ? In my raster there is no any negative ...
1
vote
0answers
120 views

Averaging satellite data with missing values (using Python)

I am using sea surface temperature, chlorophyll, and other data parameters as covariants in a model, and I would like to average them over a particular time period. I am currently doing this using a ...
13
votes
1answer
608 views

How can I utilize NumPy arrays to optimize big data geoprocessing?

I'm interested in learning how to utilize NumPy arrays to optimize geoprocessing. Much of my work involves "big data", where geoprocessing often takes days to accomplish certain tasks. Needless to ...
10
votes
2answers
976 views

Gdal Dataset.ReadAsArray() crashes Python

I am using Python 2.6.5 (32bit) with Numpy 1.3 and Gdal 1.9.1 installed on Windows 7 64bit. I am trying to read an 800 MB Imagine (.img) raster dataset into a Numpy array to do some raster algebra, ...
1
vote
1answer
94 views

keeping the coordinate system of raster files in the resulting raster file after operation with numpy

I'm trying to read as array two raster files using ReadAsArray in GDAL/python, perform some map algebra operation on it using numpy and then write the resulting raster file in GTiff format using ...
5
votes
1answer
631 views

How to keep spatial reference using arcpy.RasterToNumPyArray?

I am using ArcGIS 10.1, and want to create a new raster based on two preexisting rasters. The RasterToNumPyArray has a good example which I want to adapt. import arcpy import numpy myArray = ...
11
votes
3answers
2k views

Writing numpy array to raster file

I'm new to GIS, and I'm lost with something I feel ought to be relatively simple. I have some code that converts infrared images of Mars into thermal inertia maps, which are then stored as 2D numpy ...
2
votes
0answers
203 views

How do I use scipy.ndimage.gaussian_filter1d on an arbitrary axis?

I have a GDAL raster that looks like this: And I would really like to blur this raster along an arbitrary transect. I see that scipy.ndimage has a gaussian filter that allows me to blur the raster ...
6
votes
2answers
2k views

How to fully load a raster into a numpy array?

I have been trying to check my filters on DEM raster for pattern recognition and it is always resulting in missing last rows and columns(like..20). I have tried with PIL library, image load. Then with ...
4
votes
1answer
361 views

raster algebra in python with rasters of different extents

I am trying to find out how to use GDAL & numpy modules to average a set of rasters....which are Sigma0 values from satellite passes at different times within a year. Each raster has been ...
5
votes
2answers
317 views

Adding noise to a raster

I want to add some fine-grained noise to a raster in an automated python process (i.e. I do not want to use Photoshop or GIMP). I looked at PIL, but unless I'm mistaken, it doesn't seem to have any ...
1
vote
0answers
274 views

ValueError when reading a raster band as a numpy array

Here's the problem shown in Python shell: In [32]: from osgeo import gdal In [33]: geotiff = '/Users/calvin/work/luc/proj_public/media/GLO ...
2
votes
1answer
389 views

Calculating beta-diversity w raster data [renamed]

Using ArcGIS 10, it is not possible to generate a raster attribute table for 32-bit float values. Instead, I have tried the RasterToNumPyArray method, which crashes since the file input raster is so ...
3
votes
2answers
467 views

PostGIS + pgRouting: Adding dummy links to a road network and performing routing analysis

I'm a beginner when it comes to postgis and pgrouting development. For a project I'm working on and a bit of the algorithm: I have a polygon layer that represents zones I have a line layer that ...