IndexError: index 1 is out of bounds for axis 0 with size 1

Issue #17 new
Anonymous created an issue

I encountered IndexError when I compute cloud mask with my Landsat 8 scene LC08_L1TP_150033_20150413_20170410_01_T1 downloaded from USGS Collection L1T products.

its all okey in -separate -of HFA -co COMPRESSED=YES -o ref.img LC8*_B[1-7,9].TIF -separate -of HFA -co COMPRESSED=YES -o thermal.img LC8*_B1[0,1].TIF -m *_MTL.txt -t ref.img -o angles.img -i ref.img -m *_MTL.txt -o saturationmask.img -i ref.img -m *_MTL.txt -z angles.img -o toa.img

but it given me IndexError in : -t thermal.img -a toa.img -m *_MTL.txt -z angles.img -s saturationmask.img -o cloud.img

below are the detailed error information

Traceback (most recent call last):
  File "/home/deyu1/anaconda2/envs/fmaskenv/bin/", line 146, in <module>
  File "/home/deyu1/anaconda2/envs/fmaskenv/bin/", line 143, in mainRoutine
    fmask.doFmask(fmaskFilenames, fmaskConfig)
  File "/home/deyu1/anaconda2/envs/fmaskenv/lib/python2.7/site-packages/fmask/", line 143, in doFmask
    fmaskFilenames, fmaskConfig, missingThermal)
  File "/home/deyu1/anaconda2/envs/fmaskenv/lib/python2.7/site-packages/fmask/", line 269, in doPotentialCloudFirstPass
    applier.apply(potentialCloudFirstPass, infiles, outfiles, otherargs, controls=controls)
  File "/home/deyu1/anaconda2/envs/fmaskenv/lib/python2.7/site-packages/rios/", line 667, in apply
  File "/home/deyu1/anaconda2/envs/fmaskenv/lib/python2.7/site-packages/fmask/", line 308, in potentialCloudFirstPass
    refNullmask = (inputs.toaref[otherargs.bandsForRefNull] == otherargs.refNull).any(axis=0)
IndexError: index 1 is out of bounds for axis 0 with size 1

its be appreciate anyone who give me why. thank u...

Comments (2)

  1. Neil Flood

    I downloaded the same image file you mention, and ran it on the latest version of the code (and an older version, just in case), and I could not find any problem, it seems to work fine.

    So, I suspect that there is some problem with how you have installed pythonfmask. Could you perhaps provide details of exactly how it was installed? I believe that if you use the conda binary distribution, there can be problems with incompatible binaries, depending on how it is done.


  2. Log in to comment