为什么在辐射校正后,我的5、6、7波段出现负值?

2024-10-03 09:07:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试用Python手动对Landsat 8图像进行辐射校正;我正在使用Rasterio和numpy阵列,使用LVL 1 collection 1数据中提供的MTL文件中的频带乘法和加法值修改每个频带的数字编号,但我的NIR SWIR1和SWIR2值为负值

 for x in B_list: 
    with rasterio.open(x,"r") as b:
        band=b.read(1)
        band_masked = numpy.ma.masked_array(band, mask=(band == 0))
        TOA_x=(.00002000*band_masked)+(-.100000)
        TOA=TOA_x/math.sin(sun_elevation)
        scaled=TOA*10000 # scale the numbers by 10000
        rad_cor_bands.append(scaled) # append the new rasters to a list

以下是与ENVI FLAASH结果相比的结果:

(我的结果)

{“最小值”:870.353812730424,“最大值”:9149.756477515453,“平均值”:1282.322945234995,“标准值”:320.7381911648936}

{'min':622.4013889713156,'max':10142.046235327802,'mean':1079.4094047219655,'std':350.35757713331907}

{'min':343.96497894172603,'max':11529.667689104577,'mean':896.144857921475,'std':378.5729920045608}

{“最小值”:134.17754586770752,“最大值”:11543.109446830142,“平均值”:742.6455972788715,“标准值”:453.64227248089}

{'min':-110.65446984796611,“max”:10970.634586553786,“mean”:1557.865121879584,“std”:1162.4318852778347}

{'min':-82.33076606909405,“max”:14530.300069949319,“mean”:1092.5736223521078,“std”:926.4220337052117}

{'min':-41.045367340568724,“max”:14530.300069949319,“mean”:667.2732393332138,“std”:626.3179561231228}

(环境署的结果)

波段1 859.540771 9036.083008 1266.391450 316.757106

波段2 614.668823 10016.045898 1065.998458 346.008481

波段339.691589 11386.427734 885.012531 373.876933

波段4 132.510468 11399.702148 733.421884 448.012152

波段5 0.711042 10834.339844 1538.519843 1147.988763

波段6 0.236943 14349.781250 1078.952402 914.906030

波段7 1.896288 14349.781250 658.963308 618.535988

ENVI quickstats的结果以与我为numpy数组制作的字典中相同的顺序显示。有人知道为什么NIR SWIR1和SWIR2的值为负值吗?所有其他值与ENVI Quick stats非常相似


Tags: numpyband波段minmeanmaxstdenvi