在模拟四组分时报错,提示无法写入文件头

我检查了生成的npy文件,程序应该时正常运行了,但是最后没有读到ENVi格式的图像中
INFO: Writing file to “spectral_VZ=0_VA=180_4Components”.
INFO: Time: 0.0460s
INFO: Writing file to “spectral_VZ=0_VA=180”.
ERROR 1: Invalid band count : 0
ERROR 1: The file appears to have an associated ENVI header, but one or more of the samples, lines and bands keywords appears to be missing or invalid.
Traceback (most recent call last):
File “D:\LESS\app\bin\scripts\Lesspy\less.py”, line 48, in
Simulation.do_simulation_multi_spectral(args.cores, distFile)
File “D:\LESS\app\bin\scripts\Lesspy\Simulation.py”, line 139, in do_simulation_multi_spectral
RasterHelper.saveToHdr_no_transform(data, out_file_no_extension, bandlist, output_format, cfg[“sensor”][“NoDataValue”], hasFluor)
File “D:\LESS\app\bin\scripts\Lesspy\RasterHelper.py”, line 115, in saveToHdr_no_transform
dst_ds.GetRasterBand(i).WriteArray(npArray[:, :, i - 1])
AttributeError: ‘NoneType’ object has no attribute ‘GetRasterBand’

模拟前要确保结果文件没有被其他程序占用。