Segmentation fault when calling "calcRelDiffNeighStats" function twice

42 views
Skip to first unread message

aitor.ba...@gmail.com

unread,
Sep 25, 2015, 8:27:13 AM9/25/15
to RSGISLib Support
Hi Dan,
I get a "Segmentation fault" that closes the python console when I try to call to the "calcRelDiffNeighStats" function the second time. I'm using KEA format with a clumps file obtained with Orfeo Toolbox (originally in GTiff and converted to KEA Float32 using the gdal_translate command). If I call the function only once (only the First call paragraph), the script finishes the process as expected.
Any ideas how to tackle this?
Linux Mint 17.1 and last version of RSGISLib
Thanks in advance

rastergis.populateStats(image_clumps_file_KEA)
ratutils.populateImageStats(image_BS_dif_KEA, image_clumps_file_KEA,calcMean=True,calcStDev=True)

#First call
rsgislib.rastergis.findNeighbours(image_clumps_file_KEA, 1)
fieldInfo = rsgislib.rastergis.FieldAttStats(field='Band1Avg', meanField='Band1AvgMeanDiff')
rsgislib.rastergis.calcRelDiffNeighStats(image_clumps_file_KEA, fieldInfo,False)

#Second call
rsgislib.rastergis.findNeighbours(image_clumps_file_KEA, 1)
fieldInfo = rsgislib.rastergis.FieldAttStats(field='Band2Avg', meanField='Band2AvgMeanDiff')
rsgislib.rastergis.calcRelDiffNeighStats(image_clumps_file_KEA, fieldInfo,False)

Daniel Clewley

unread,
Sep 28, 2015, 8:38:48 AM9/28/15
to aitor.ba...@gmail.com, RSGISLib Support
Hi Aitor,

I'm not sure what is causing this, I would have to run in debug mode to test (which will be the weekend, at the earliest).

As a work around you could try running each band as a separate script to see if this works.

Thanks,

Dan
--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.
Visit this group at http://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.

aitor.ba...@gmail.com

unread,
Oct 12, 2015, 1:23:08 AM10/12/15
to RSGISLib Support
Hi Dan,
Sorry for the delay. It works fine when I call to "calcRelDiffNeighStats" function once (independently Band 1 or 2, it works fine with both), but still get segmentation fault when calling twice.
It would be great if you could take a look when you can.
Best regards,
Aitor

Pete Bunting [pfb]

unread,
Oct 12, 2015, 4:30:14 AM10/12/15
to aitor.ba...@gmail.com, RSGISLib Support
Hi Aitor, 

Many thanks for your email. I have created an issue on our issue tracker (https://bitbucket.org/petebunting/rsgislib/issues/32/calcreldiffneighstats-seg-fault) so we will look at it in due course. Many thanks, Pete

****************************************************
* Dr Pete Bunting
* Senior Lecturer in Remote Sensing
* Earth Observation and Ecosystem Dynamics Group
* Department of Geography and Earth Sciences
* Aberystwyth University
* Aberystwyth
* Ceredigion
* SY23 3DB
* UK

* Ph: +44 (0) 1970 622615
* Mob: +44 (0) 7917 842743
* Email: p...@aber.ac.uk
* ORCID: http://orcid.org/0000-0002-7435-0148
****************************************************

Reply all
Reply to author
Forward
0 new messages