ive also asked this over at the Spatial Analyst group with no response, so I thought I’d try here.
im looking for a Pythonic way to extract a single band from a multi band ECW image. The ECW part is important, as every time I try to run an ArcToolbox tool on the data, Arcmap immediately crashes. I get the same result using IDLE and arcpy. The only success I’ve had on the Desktop front was by loading the specific band, and then right clicking > Export Data.
the one bit of success I had was creating a faster object using arcpy.sa.Raster and then saving this to a different workspace. However this copied all bands over, not just the band I had selected for the raster object. (path/image.ecw/Red for example).
Why am I doing this? I need to be able to batch generate a heap of NDVI outputs, where I need to extract the red band from the VIS image and the IR band from the IR image.
Any my suggestions will be gratefully appreciated.
what version of ArcMap? or is it ArcGIS Pro you are using. Non-English characters? particular locale?
I ask because
plus a load more in the last year
I’ve had the same issue with 10.3.1 and 10.5.1. Australia, en-au. No non-English characters.
That link above re: 10.6.1 is very interesting, not the least because we are (were?) about to do a system-wide migration to 10.6.1 - that may knock it on the head.
After I posted yesterday evening, I got to thinking about any other libraries that may be able to assist, and had a hunt around. It looks as though GDAL should be able to open the images and extract the bands, which I could then load as arrays in numpy to do the required algebra for the NDVI analysis. I haven’t tried yet but it sounds like a promising avenue to investigate.