_imagecalc.error: std::bad_alloc when using performDOSCalc function

35 views
Skip to first unread message

Gwawr Jones

unread,
Sep 15, 2016, 6:35:02 AM9/15/16
to RSGISLib Support

Hi,

I'm getting this error when running the performDOSCalc function:

        Calculating Percentile 0.01 of band 1Traceback (most recent call last):
  File "DOS.py", line 15, in <module>
    rsgislib.imagecalibration.performDOSCalc(inputFile, outputFile, gdalformat, nonNegative, noDataVal, darkObjReflVal, darkObjPercentile, copyBandNames=True, calcStatsPyd=True)
  File "/home/ubuntu/miniconda3/envs/rsgislib/lib/python3.5/site-packages/rsgislib/imagecalibration/__init__.py", line 42, in performDOSCalc
    percentList = rsgislib.imagecalc.bandPercentile(inputFile, darkObjPercentile, noDataVal)
_imagecalc.error: std::bad_alloc

Weirdly this error only occurs on my linux virtual machine while the script works perfectly on my MacBook. The scripts are identical. I did notice that my conda environment on my linux vm is running version 3.0.1176 of rsgislib while my Mac is running version 3.0.1139. Apart from that there is no difference in the envs.

Any help appreciated.
Thanks,

Gwawr

Pete Bunting [pfb]

unread,
Sep 15, 2016, 7:07:58 AM9/15/16
to Gwawr Jones, RSGISLib Support
Hi Gwawr, 

Not sure why an memory error would occur. We are currently re-doing the conda builds and messing about with things so there could be an issue there. 

I’ve just setup conda environments which can be downloaded, so maybe if you could try installing the anaconda-client package (conda install anaconda-client) and then creating an environment from the online environment I’ve just setup and see if that works. Run the following commands to create the new environment with all the packages I use:

conda env create au-eoed/au-osgeo-lnx
source activate au-osgeo-lnx

On Mac OSX you need to use the following:

conda env create au-eoed/au-osgeo-osx
source activate au-osgeo-osx

Cheers, Pete

****************************************************
* Dr Pete Bunting
* Reader 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
****************************************************
"Please consider the environment before printing this email or any documents attached”

--
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 https://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.



--------------------------------------------------------------------
Un o’r 4 prifysgol uchaf yn y DU a’r gorau yng Nghymru am fodlonrwydd myfyrwyr
(Arolwg Cenedlaethol y Myfyrwyr 2016)
www.aber.ac.uk

Top 4 UK university and best in Wales for student satisfaction
(National Student Survey 2016)
www.aber.ac.uk

Pete Bunting [pfb]

unread,
Sep 15, 2016, 7:35:27 AM9/15/16
to Gwawr Jones, RSGISLib Support
Hi Gwawr, 

Does the same happen with all images? If so, then sounds like a bug I’d need to reproduce here to find the fix, which I don’t have time today. 

Cheers, Pete

****************************************************
* Dr Pete Bunting
* Reader 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
****************************************************
"Please consider the environment before printing this email or any documents attached”

On 15 Sep 2016, at 12:27, Gwawr Jones <gwawrna...@gmail.com> wrote:

Hi Pete,

Thanks for the quick response!

Unfortunately I still get the same error after creating that new environment. It's very weird! I create a new environment each time I update to make sure I still have one that works, there was a week's difference in the time I created them but that should be the only difference!

Happy to keep testing things though.

Cheers,
Gwawr

To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-support+unsubscribe@googlegroups.com.
To post to this group, send email to rsgislib-support@googlegroups.com.


--------------------------------------------------------------------
Un o’r 4 prifysgol uchaf yn y DU a’r gorau yng Nghymru am fodlonrwydd myfyrwyr
(Arolwg Cenedlaethol y Myfyrwyr 2016)
www.aber.ac.uk

Top 4 UK university and best in Wales for student satisfaction
(National Student Survey 2016)
www.aber.ac.uk
Reply all
Reply to author
Forward
0 new messages