|
|
@ -328,9 +328,9 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# 读取 大气参数文件(input_toa.txt),获取公共的参数:aodmodel、atmodel
|
|
|
|
# 读取 大气参数文件(input_toa.txt),获取公共的参数:aodmodel、atmodel
|
|
|
|
toaAodmodel, toaAtmmodel = utils.readInputTOA(toaInputFilePath)
|
|
|
|
toaAodmodel, toaAtmmodel = utils.readInputTOA(toaInputFilePath)
|
|
|
|
print(toaAodmodel, toaAtmmodel)
|
|
|
|
globalUtils.printWithFlush(toaAodmodel, toaAtmmodel)
|
|
|
|
if None in [surMonth, surWavestart, surWaveend, toaAodmodel, toaAtmmodel]:
|
|
|
|
if None in [surMonth, surWavestart, surWaveend, toaAodmodel, toaAtmmodel]:
|
|
|
|
print("surface: month wavestart waveend and toa: aodmodel atmodel has None!")
|
|
|
|
globalUtils.printWithFlush("surface: month wavestart waveend and toa: aodmodel atmodel has None!")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
# 读取地表文件的经纬度
|
|
|
|
# 读取地表文件的经纬度
|
|
|
@ -365,8 +365,8 @@ def main():
|
|
|
|
ncPointSelectedList, surPointSelectedList = surToNC(
|
|
|
|
ncPointSelectedList, surPointSelectedList = surToNC(
|
|
|
|
ncLatList, ncLonList, surLatList, surLonList, distanceProximityDistance
|
|
|
|
ncLatList, ncLonList, surLatList, surLonList, distanceProximityDistance
|
|
|
|
)
|
|
|
|
)
|
|
|
|
# print('nc points: ', len(ncPointSelectedList))
|
|
|
|
# globalUtils.printWithFlush('nc points: ', len(ncPointSelectedList))
|
|
|
|
# print('sur points: ', len(surPointSelectedList))
|
|
|
|
# globalUtils.printWithFlush('sur points: ', len(surPointSelectedList))
|
|
|
|
# globalUtils.saveDataToJSON([(float(x[0]), float(x[1])) for x in ncPointSelectedList],'json-nc-point.json')
|
|
|
|
# globalUtils.saveDataToJSON([(float(x[0]), float(x[1])) for x in ncPointSelectedList],'json-nc-point.json')
|
|
|
|
# globalUtils.saveDataToJSON([(float(x[0]), float(x[1])) for x in surPointSelectedList], 'json-sur-point.json')
|
|
|
|
# globalUtils.saveDataToJSON([(float(x[0]), float(x[1])) for x in surPointSelectedList], 'json-sur-point.json')
|
|
|
|
|
|
|
|
|
|
|
@ -391,9 +391,9 @@ def main():
|
|
|
|
distanceProximityDistance,
|
|
|
|
distanceProximityDistance,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
# print('nc final points: ', len(ncPointFinalSelectedList))
|
|
|
|
# globalUtils.printWithFlush('nc final points: ', len(ncPointFinalSelectedList))
|
|
|
|
# print('sur final points: ', len(surPointFinalSelectedList))
|
|
|
|
# globalUtils.printWithFlush('sur final points: ', len(surPointFinalSelectedList))
|
|
|
|
# print('tif final points: ', len(tifPointFinalSelectedList))
|
|
|
|
# globalUtils.printWithFlush('tif final points: ', len(tifPointFinalSelectedList))
|
|
|
|
# globalUtils.saveDataToJSON(surPointFinalSelectedList,'json-point-sur.json')
|
|
|
|
# globalUtils.saveDataToJSON(surPointFinalSelectedList,'json-point-sur.json')
|
|
|
|
# globalUtils.saveDataToJSON(ncPointFinalSelectedList, 'json-point-nc.json')
|
|
|
|
# globalUtils.saveDataToJSON(ncPointFinalSelectedList, 'json-point-nc.json')
|
|
|
|
# globalUtils.saveDataToJSON(tifPointFinalSelectedList, 'json-point-tif.json')
|
|
|
|
# globalUtils.saveDataToJSON(tifPointFinalSelectedList, 'json-point-tif.json')
|
|
|
@ -428,11 +428,11 @@ def main():
|
|
|
|
latIndex = tifLatList.index(lat)
|
|
|
|
latIndex = tifLatList.index(lat)
|
|
|
|
tifParamValueList.append(aodMatrix[latIndex][lonIndex])
|
|
|
|
tifParamValueList.append(aodMatrix[latIndex][lonIndex])
|
|
|
|
|
|
|
|
|
|
|
|
print(f"surParamValueList: {len(surParamValueList)}")
|
|
|
|
globalUtils.printWithFlush(f"surParamValueList: {len(surParamValueList)}")
|
|
|
|
print(f"ncParamValueList: {len(ncParamValueList)}")
|
|
|
|
globalUtils.printWithFlush(f"ncParamValueList: {len(ncParamValueList)}")
|
|
|
|
print(f"tifParamValueList: {len(tifParamValueList)}")
|
|
|
|
globalUtils.printWithFlush(f"tifParamValueList: {len(tifParamValueList)}")
|
|
|
|
|
|
|
|
|
|
|
|
print("pre process over!")
|
|
|
|
globalUtils.printWithFlush("pre process over!")
|
|
|
|
|
|
|
|
|
|
|
|
# 第一步,组成大气辐射需要的参数:
|
|
|
|
# 第一步,组成大气辐射需要的参数:
|
|
|
|
# sz vz sa va 来自 surParamValueList
|
|
|
|
# sz vz sa va 来自 surParamValueList
|
|
|
@ -469,13 +469,13 @@ def main():
|
|
|
|
surWavestart,
|
|
|
|
surWavestart,
|
|
|
|
surWaveend,
|
|
|
|
surWaveend,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
print("+++++++++++++++gen sur input.txt")
|
|
|
|
globalUtils.printWithFlush("+++++++++++++++gen sur input.txt")
|
|
|
|
# 第一步,先执行地表,得到结果文件
|
|
|
|
# 第一步,先执行地表,得到结果文件
|
|
|
|
surMain.test(surfaceModuleDir)
|
|
|
|
surMain.test(surfaceModuleDir)
|
|
|
|
print("+++++++++++++++surface run over")
|
|
|
|
globalUtils.printWithFlush("+++++++++++++++surface run over")
|
|
|
|
# 第二步,拷贝地表的结果文件到input下
|
|
|
|
# 第二步,拷贝地表的结果文件到input下
|
|
|
|
surOutputFile = os.path.join(surfaceModuleDir, "output.txt")
|
|
|
|
surOutputFile = os.path.join(surfaceModuleDir, "output.txt")
|
|
|
|
print(surOutputFile)
|
|
|
|
globalUtils.printWithFlush(surOutputFile)
|
|
|
|
if not os.path.isfile(surOutputFile):
|
|
|
|
if not os.path.isfile(surOutputFile):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
# 第三步,构造大气辐射传输参数文件
|
|
|
|
# 第三步,构造大气辐射传输参数文件
|
|
|
@ -494,9 +494,9 @@ def main():
|
|
|
|
ozone,
|
|
|
|
ozone,
|
|
|
|
surOutputFile,
|
|
|
|
surOutputFile,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
print("+++++++++++++++gen toa input.txt")
|
|
|
|
globalUtils.printWithFlush("+++++++++++++++gen toa input.txt")
|
|
|
|
utils.executeCompute()
|
|
|
|
utils.executeCompute()
|
|
|
|
print("+++++++++++++++toa run over")
|
|
|
|
globalUtils.printWithFlush("+++++++++++++++toa run over")
|
|
|
|
# 处理结果文件,将input_para.txt和TOASimu.txt进行编号命名后拷贝到output中
|
|
|
|
# 处理结果文件,将input_para.txt和TOASimu.txt进行编号命名后拷贝到output中
|
|
|
|
rgb445, rgb565, rgb670 = handleOutput(lon, lat, index)
|
|
|
|
rgb445, rgb565, rgb670 = handleOutput(lon, lat, index)
|
|
|
|
heatMapValueList.append((lon, lat, rgb445, rgb565, rgb670))
|
|
|
|
heatMapValueList.append((lon, lat, rgb445, rgb565, rgb670))
|
|
|
@ -522,7 +522,7 @@ if __name__ == "__main__":
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
# 捕获除了ZeroDivisionError外的所有异常
|
|
|
|
# 捕获除了ZeroDivisionError外的所有异常
|
|
|
|
print("发生异常:", str(e))
|
|
|
|
globalUtils.printWithFlush("发生异常:", str(e))
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
# 无论是否发生异常,最终都会执行该代码块
|
|
|
|
# 无论是否发生异常,最终都会执行该代码块
|
|
|
|
print("求解执行完毕!")
|
|
|
|
globalUtils.printWithFlush("求解执行完毕!")
|
|
|
|