GithubHelp home page GithubHelp logo

atmosphericcorrection's Introduction

基于6s模型的影像大气校正工程

OVERVIEW

调用py6s接口,自动读取影像头文件信息,对遥感影像进行大气校正批处理。

环境 & 依赖

python版本3.6
conda install gdal
conda install -c conda-forge py6s

脚本说明

  • AtmosphericCorrection_Landsat8.py 针对landsat8影像,已经可以工程化使用。
  • AtmosphericCorrection_Sentinel.py 针对Sentinel影像,已经可以工程化使用。
  • AtmosphericCorrection_GF.py 针对GF1、2影像,已经可以工程化使用。
    为了减少校正结果存储空间,程序中将大气校正的结果放大了10000倍。

测试

python .../AtmosphericCorrection/AtmosphericCorrection_Lansat8.py Input_dir=输入路径 Output_dir=输出路径
python .../AtmosphericCorrection/AtmosphericCorrection_Sentinel.py Input_dir=输入路径 Output_dir=输出路径
python .../AtmosphericCorrection/AtmosphericCorrection_GF.py Input_dir=输入路径 Output_dir=输出路径

更新说明:针对标准存储格式的sentinel-2大气校正做了修改
1、文件存储结构图

2、参数使用
输入参数中的输入路径需要到L1C_T51TUE_A004877_20180211T025320这一级(与压缩文件同名),这一级下的IMG_DATA文件夹存储了 各波段影像文件,MTD_TL.xml是影像元文件

注意

直接在pycharm测试可能会有bug,建议windows用户直接在conda自带的Anaconda Prompt工具中测试,mac可直接在终端里测试。

atmosphericcorrection's People

Contributors

zhaoguanhua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atmosphericcorrection's Issues

运行代码会报出这样的错误 咋解决啊

File "F:/数据样例/GF1pms_sample/AtmosphericCorrection-master/test.py", line 78, in Block
AtcCofa, AtcCofb, AtcCofc = AtmosphericCorrection(m, metedata, config, SatelliteID, SensorID)
File "F:/数据样例/GF1pms_sample/AtmosphericCorrection-master/test.py", line 237, in AtmosphericCorrection
s.run()
File "D:\Program Files\anaconda3\envs\AtmosphericCorrection-master\lib\site-packages\Py6S\sixs.py", line 357, in run
self.outputs = Outputs(outputs[0], outputs[1])
File "D:\Program Files\anaconda3\envs\AtmosphericCorrection-master\lib\site-packages\Py6S\outputs.py", line 65, in init
stderr = stderr.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 13: invalid start byte

请问高分天顶角为高度角的文献出处

作者您好,对高分元文件天顶角实为高度角不太理解,是元文件中天顶角的单词拼写错误还是其它?是否同时包括太阳和卫星天顶角两项? 能否提供一下相关文献出处,谢谢!

关于GF-1校正问题

GF-1校正脚本中这句应该不用90去减吧,我直接用脚本运行出来植被的校正结果和FLAASH校正差距较大。
s.geometry.solar_z = 90-float(dom.getElementsByTagName('SolarZenith')[0].firstChild.data)
xml中给出的就是太阳天顶角吧,不是太阳高度角,应该不需要计算,直接拿来用就行,调整后差距明显减小。
还有我没有将卫星方位角和天顶角设为0,而是使用了xml中提供的角度。
我是个学生,有错误还请指正。

计算meanDEM ,计算影像范围区域行列有误

in base.py

# DEM分辨率 pixelWidth = geotransform[1] pixelHight = geotransform[5]
# DEM起始点:左上角,X:经度,Y:纬度    originX = geotransform[0]    originY = geotransform[3]
# 研究区左上角在DEM矩阵中的位置    yoffset1 = int((originY - pointUL['lat']) / pixelWidth)    xoffset1 = int((pointUL['lon'] - originX) / (-pixelHight))
# 研究区右下角在DEM矩阵中的位置    yoffset2 = int((originY - pointDR['lat']) / pixelWidth)    xoffset2 = int((pointDR['lon'] - originX) / (-pixelHight))
# 研究区矩阵行列数    xx = xoffset2 - xoffset1    yy = yoffset2 - yoffset1    # 读取研究区内的数据,并计算高程    DEMRasterData = DEMBand.ReadAsArray(xoffset1, yoffset1, xx, yy)<br class="Apple-interchange-newline"><!--EndFragment-->

计算出的影像区域行列起始号与行列数存在问题,建议如下写法:

geo = ds.GetGeoTransform()
inv_geo = gdal.InvGeoTransform(geo)
pointUL = dict()
pointDR = dict()
pointUL["lat"] = float(''.join(re.findall('CORNER_UL_LAT_PRODUCT.+',data2)).split("=")[1])
pointUL["lon"] = float(''.join(re.findall('CORNER_LL_LON_PRODUCT.+',data2)).split("=")[1])
pointDR["lat"] = float(''.join(re.findall('CORNER_LR_LAT_PRODUCT.+',data2)).split("=")[1])
pointDR["lon"] = float(''.join(re.findall('CORNER_UR_LON_PRODUCT.+',data2)).split("=")[1])
extent = [pointUL["lon"], pointUL["lat"], pointDR["lon"], pointDR["lat"]]

off_ulx, off_uly = map(int, gdal.ApplyGeoTransform(inv_geo, extent[0], extent[1]))
off_drx, off_dry = map(math.ceil, gdal.ApplyGeoTransform(inv_geo, extent[2], extent[3]))
columns = off_drx - off_ulx
rows = off_dry - off_uly

data = ds.GetRasterBand(1).ReadAsArray(off_ulx, off_uly, columns, rows)

更新json文件

我需要做20、21年的大气校正,大佬怎么更新那个json文件呀

对GF-1和GF-2的大气校正反射率偏高

我用作者的代码跑高分影响大气校正的时候,水的反射率随着辐射定标的系数变高也随之变高,结果反射率数值都很高请问是为什么

处理时间太长,可否引入多线程

一景GF-6 WFV影像的八个波段运行6s大气校正所需的时间大概是3小时,更改nBlockSize = 1024为nBlockSize = 8192可以将时间减少一半,但还是太久。
能否在引入多线程增大CPU利用率呢?它似乎只用到了Xeon CPU 40核中的两核。如果不能,还有其它方法增大处理速度吗?

哨兵2-A数据出现的问题

ERROR 4: F:\huangyandao\s2\S2A_MSIL1C_20160511T024332_N0202_R046_T50PNB_20160511T024328.SAFE\GRANULE\L1C_T50PNB_A004619_20160511T024328\IMG_DATA\T50PNB_20160511T024332_B05.jp2' not recognized as a supported file format. ERROR 4: F:\huangyandao\s2\S2A_MSIL1C_20160511T024332_N0202_R046_T50PNB_20160511T024328.SAFE\GRANULE\L1C_T50PNB_A004619_20160511T024328\IMG_DATA\T50PNB_20160511T024332_B06.jp2' not recognized as a supported file format.
ERROR 4: `F:\huangyandao\s2\S2A_MSIL1C_20160511T024332_N0202_R046_T50PNB_20160511T024328.SAFE\GRANULE\L1C_T50PNB_A004619_20160511T024328\IMG_DATA\T50PNB_20160511T024332_B07.jp2' not recognized as a supported file format.
F:\huangyandao\s2\S2A_MSIL1C_20160511T024332_N0202_R046_T50PNB_20160511T024328.SAFE\GRANULE\L1C_T50PNB_A004619_20160511T024328\IMG_DATA\T50PNB_20160511T024332_B07.jp2数据集读取为空
F:\huangyandao\s2\S2A_MSIL1C_20160511T024332_N0202_R046_T50PNB_20160511T024328.SAFE\GRANULE\L1C_T50PNB_A004619_20160511T024328\IMG_DATA\T50PNB_20160511T024332_B08.jp2数据集读取为空

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.