Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standard deviation stretch crash #3

Open
magdaw opened this issue Apr 3, 2014 · 0 comments
Open

standard deviation stretch crash #3

magdaw opened this issue Apr 3, 2014 · 0 comments

Comments

@magdaw
Copy link

magdaw commented Apr 3, 2014

Hello jlaura,

I have been "partially" succesful with running a standard deviation stretch on my 8bit 1 band tif imagery. But pystretch crashes on some of them with the following (memory issue) message:
I use 32 bit version of Python, GDAL, numpy, scipy and pystretch.

"Processing on 8 cores.
Read band 1 of 1
Image segmented. Processing segment 1 of 1
Traceback (most recent call last):
File "c:\Python266\Scripts\pystretcher.py", line 185, in
main(options, args)
File "c:\Python266\Scripts\pystretcher.py", line 97, in main
array = numpy.ma.masked_values(array, options['ndv'], copy=False)
File "C:\Python266\lib\site-packages\numpy\ma\core.py", line 2206, in masked_values
condition = umath.less_equal(mabs(xnew - value), atol + rtol * mabs(value))
MemoryError"

All the input 8bit 1 band TIFs have been created in the same software.
However the one that fails, due to memory issue, is a larger matrix (6687,8190) comparing to one that completes OK (3230,8978), although the physical file size is actually smaller (~1.5MB) from the one that completes OK (~3MB).

Do I need to explicitly add the segmenting of an image to the following command?:

c:Python266\python c:\Python266\Scripts\pystretcher.py --std --standarddeviations 2.5 input_image.tif --output output_image.tif.

I tried adding --horizontal and --verical to the above command for splitting the memory (?):

c:Python266\python c:\Python266\Scripts\pystretcher.py --std --standarddeviations 2.5 --horizontal 4 --vertical 4 input_image.tif --output output_image.tif.

but the process fails with an error message:

Traceback (most recent call last):
File "c:\Python266\Scripts\pystretcher.py", line 185, in
main(options, args)
File "c:\Python266\Scripts\pystretcher.py", line 157, in main
del stats,array, jobs, shared_arr.data, p
UnboundLocalError: local variable 'p' referenced before assignment

I would like to avoid having to physically split the raster into smaller rasters if possible.

Your help much appreciated!
Many thanks
Magda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant