Landsat数据—6s大气校正
Landsat数据认识—以及6s大气校正处理1. Landsat卫星介绍2. Landsat数据介绍2.1 数据级别介绍2.2 数据名称命名格式3. Landsat数据波段信息介绍3.1 Landsat 4-5 Thematic Mapper ( TM )3.2 Landsat 7 Enhanced Thematic Mapper Plus (ETM)3.3 Landsat 8-9 Operational Land Imager (OLI) and Landsat 8-9 Thermal Infrared Sensor (TIRS)4. Landsat数据预处理4.1 python 代码4.2 代码运行环境4.3 代码运行结果4.4 代码计算结果与ENVI处理结果对比1. Landsat卫星介绍Landsat卫星介绍信息来源于NASA官网。陆地卫星计划由美国国家航空航天局NASA和美国地质调查局USGS共同管理是一系列地球观测卫星任务的集合。自1972年以来陆地卫星持续获取地球陆地表面图像并提供不间断的数据存档帮助土地管理者、规划者和政策制定者更科学地决策自然资源与环境问题。仅在2023年一年陆地卫星提供的免费公开数据就为美国经济贡献了约256亿美元。随着每次新卫星发射陆地卫星长达数十年的数据记录变得愈发珍贵。作为地球上最长时间连续的空间记录陆地卫星为研究长期变化的科学家提供了独特资源。研究人员利用其数据档案研究了自20世纪70年代以来城市扩张、海岸线变迁、作物生长周期变化以及森林演替等现象。这项开创性研究之所以成为可能是因为陆地卫星经过精密校准、具备科学质量的档案已成为卫星数据领域的“黄金标准”。该计划优先采用科学级仪器和数据确保研究人员能够确信后续的Landsat图像中的变化反映了地表的实际变化。所有NASA数据均免费向公众开放这意味着地球上任何地方的任何人都可以使用Landsat数据。2. Landsat数据介绍2.1 数据级别介绍数据名称数据是否可以获得辐射校正大气校正几何校正Landsat Level-1 Data√√×√Landsat Level-2 Data√√√√Landsat Level-3 Data√√√√Landsat Level-1 DataLandsat Level-1 产品包含经过校准的数字化数值这些数值代表了多光谱图像数据。Level-1 数据被划分为不同的等级结构。最高等级的 Level-1 数据经过了辐射校正并且通过地面控制点以及数字高程模型数据进行了几何校正以修正地形变化对数据的影响。所有 Landsat Level-1 数据产品的生成都采用了针对每个场景最优的处理级别。所采用的处理级别取决于地面控制点的存在情况、各种数字高程模型提供的高程数据以及航天器和传感器收集的载荷校正数据。请访问 Landsat 处理级别网页以了解更多关于 Level-1 处理数据质量的信息。Landsat Level-2 DataLandsat Collection 2 Level-2 科学产品是一种时间序列观测数据其数据长度足够长且具有连贯性能够记录土地的变化情况。这些数据被用作 Landsat Level-3 科学产品的输入数据。Landsat Collection 2 Level-1 数据则用于 Level-2 科学产品的处理过程中。制作二级产品的所需时间因卫星类型而异。Landsat Collection 2 产品生成时间轴展示了每种传感器生成二级产品所需的时间。产品数据包含Landsat Surface Reflectance、Landsat Surface Temperature、Landsat Surface Reflectance-Derived Spectral Indices、Provisional Aquatic ReflectanceLandsat Level-3 DataLevel-3 Data包含Level-3 ARD Tile-based Science Products与Level-3 Scene-based Science Products。Level-3 ARD Tile-based Science Products由 Landsat Collection 2 Level-3 生成的科学数据反映了地球表面的生物物理特性。这些数据是基于 Landsat U.S. Analysis Ready DataARD作为输入而生成的。产品数据包含 Dynamic Surface Water Extent、Fractional Snow Covered Area、Burned Area。Level-3 Scene-based Science Products由 Landsat Level-2 基于场景数据生成的 Landsat Collection 2 Level-3 科学产品。 产品数据包含Provisional Actual Evapotranspiration。2.2 数据名称命名格式Landsat数据名称为Ls0q_xxff_ppprrr_yyyymmdd_YYYYMMDD_cc_CC其中各指标为字符含义可用类型类型介绍s传感器类型COLI/TIRSO仅OLI传感器T仅TIRS传感器EETM传感器TMTM传感器q卫星编号4Landsat 45Landsat 57Landsat 78Landsat 89Landsat 9xx数据处理级别L1一级数据L2二级产品数据ff数据校正类型TP精纠正与地形校正GT系统地形校正GS系统校正SP地表反射率SR地表温度ppp轨道号fff行编号yyyy卫星影像实际拍摄年份mm卫星影像实际拍摄月份dd卫星影像实际拍摄天数YYYY处理生产本产品文件的年份MM处理生产本产品文件的月份DD处理生产本产品文件的天数cc数据集版本01Collection 102Collection 2目前主流数据CC数据层级类别RTreal-time 实时/新传回数据尚未完全评估T1Tier 1 第一层辐射和几何质量最佳可用于时间序列分析T2Tire 2 第二层未达到T1精度标准的数据例如Real-Time: LC08_L1TP_013002_20200629_20200629_01_RTLandsat 8 OLI/TIRS level-1级精纠正与地形校正数据013轨道002行列2020年6月29日卫星采集数据2020年6月29日处理产品数据数据集版本Collection 1的实时状态数据Tier 1: LC08_L1TP_013042_20211225_20211230_02_T1Landsat 8 OLI/TIRS level-1级精纠正与地形校正数据013轨道042行列2021年12月25日卫星采集数据2021年12月30日处理产品数据数据集版本Collection 2的第一层数据Tier 2: LT05_L1GS_178058_19950410_20200912_02_T2Landsat 5 TM level-1级系统校正数据178轨道058行列1995年4月10日卫星采集数据2020年9月12日处理产品数据数据集版本Collection 2的第二层数据3. Landsat数据波段信息介绍Landsat数据波段信息介绍来自于NASA官网。3.1 Landsat 4-5 Thematic Mapper ( TM )BandNamewavelength(μm)GSD(m)1Blue0.45-0.52302Green0.52-0.60303Red0.63-0.69304Near Infrared(NIR)0.76-0.90305Shortwave Infrared(SWIR)1.55-1.75306Thermal Infrared(TIR)10.40-12.50120(resampled to 30)7Shortwave Infrared(SWIR) 22.08-2.35303.2 Landsat 7 Enhanced Thematic Mapper Plus (ETM)BandNamewavelength(μm)GSD(m)1Blue0.45-0.52302Green0.52-0.60303Red0.63-0.69304Near Infrared(NIR)0.77-0.90305Shortwave Infrared(SWIR)1.55-1.75306Thermal Infrared(TIR)10.40-12.5060(resampled to 30)7Shortwave Infrared(SWIR) 22.09-2.35308Panchromatic0.52-0.90153.3 Landsat 8-9 Operational Land Imager (OLI) and Landsat 8-9 Thermal Infrared Sensor (TIRS)BandNamewavelength(μm)GSD(m)1Coastal/Aerosol0.45-0.45302Blue0.45-0.51303Green0.53-0.59304Red0.64-0.67305Near Infrared(NIR)0.85-0.88306Shortwave Infrared(SWIR)1.57-1.65307Shortwave Infrared(SWIR) 22.11-2.29308Panchromatic0.50-0.68159Cirrus1.36-1.383010Thermal-infrared (TIR) 110.6-11.19100 (resampled to 30)11Thermal-infrared (TIR) 211.50-12.51100 (resampled to 30)4. Landsat数据预处理作者目前编写完成了Landsat数据通用预处理代码包含辐射校正、数据裁剪、表观反射率计算、6s大气校正。后续会进行几何校正、影像配准、正射校正影像融合、镶嵌拼接代码编写。云检测、云掩膜代码作者已完成针对Sentinel 2 数据处理的代码目前尚未与Landsat数据自动化预处理流水线合并后续时间充足条件下会进行补充。4.1 python 代码importos# 以下为自定义函数fromsrc.Landsat_45789_Getinfoimport*fromsrc.Landsat_45789_radiation_correctionimport*fromsrc.function_clip_imgimport*fromsrc.Landsat_45789_atmospheric_correctionimport*fromsrc.Landsat_45789_top_of_atmosphereimport*fromsrc.Landsat_SP_Atmospheric_correctionimport*if__name____main__:file_pathrD:\X\X12\data\LC08_L1TP_118039_20131203_20170428_01_T1_MTL.txtout_dirrD:\Test_romote_sensing_preprocessing\resultsifnotos.path.exists(out_dir):os.makedirs(out_dir)Landsat_infoLandsat(file_path)landsat_dataLandsat_info.Read_landsat_mtl()sub_all_fileLandsat_info.Landsat_sub_filepath()ifTPinPath(file_path).stem:# 辐射校正RC_out_pathos.path.join(out_dir,os.path.basename(file_path).replace(_MTL.txt,_RC.tiff))radiation_correction_inforadiation_correction(sub_all_file,RC_out_path,Landsat_info)radiation_correction_info.landsat_L1_radiation_correction()# 影像裁剪clip_pathos.path.join(out_dir,os.path.basename(file_path).replace(_MTL.txt,_clip.tiff))shp_filerD:\Test_romote_sensing_preprocessing\data\test2.shpimg_clip_infoimg_clip(RC_out_path,clip_path,shp_file)img_clip_info.clip_img()# 表观反射率计算TOA_out_pathos.path.join(out_dir,os.path.basename(file_path).replace(_MTL.txt,_TOA.tiff))Landsat_top_of_atmosphere_infoLandsat_top_of_atmosphere(clip_path,TOA_out_path)Landsat_top_of_atmosphere_info.landsat_L1_top_of_atmosphere()# 6s大气校正RF_out_pathos.path.join(out_dir,os.path.basename(file_path).replace(_MTL.txt,_reflection.tiff))atmospheric_correction_infoatmospheric_correction(clip_path,RF_out_path)atmospheric_correction_info.run_in_processes()atmospheric_correction_info.landsat_l1_reflection_correction_6s()elifSPinPath(file_path).stem:# SP数据转换为地表反射率RF_out_pathos.path.join(out_dir,os.path.basename(file_path).replace(_MTL.txt,_reflection.tiff))Landsat_SP_Atmospheric_correction_infoLandsat_SP_Atmospheric_correction(sub_all_file,RF_out_path,Landsat_info)Landsat_SP_Atmospheric_correction_info.landsat_l2_reflection_correction()作者在撰写代码过程中同时进行了3项目标任务本任务为其中一条git记录见下图4.2 代码运行环境affine file:///C:/b/abs_a90_dxt1pi/croot/affine_1756122943225/work attrs file:///C:/Users/task_177495968374484/croot/attrs_1774959757320/work branca file:///C:/Users/task_176709362965211/croot/branca_1767093737080/work brotlicffi file:///C:/Users/task_178644395580478/croot/brotlicffi_1786444045806/work certifi file:///C:/Users/task_YAR7wApqSDOhN_0/croot/certifi_1785412605974/work/certifi cffi file:///C:/Users/task_I8-lPzBkTFuTO_0/croot/cffi_1784189022923/work charset-normalizer file:///C:/Users/task_Rv9ykhKISAWPX_0/croot/charset-normalizer_1782917499282/work click file:///C:/Users/task_178117615264254/croot/click_1781176564865/work cligj0.7.2colorama file:///C:/Users/dev-admin/perseverance-python-buildout/croot/colorama_1729036581634/work contourpy file:///C:/miniconda3/conda-bld/contourpy_1763643940481/work cycler file:///C:/Users/task_176606794865467/croot/cycler_1766068048113/work folium file:///C:/miniconda3/conda-bld/folium_1758749964347/work fonttools file:///C:/Users/task_178107563774626/croot/fonttools_1781075751167/work GDAL3.11.4geopandas file:///C:/Users/task_177444535068699/croot/geopandas-split_1774445941958/work Glymur file:///home/conda/feedstock_root/build_artifacts/glymur_1778711655224/work idna file:///C:/Users/task_178056089149060/croot/idna_1780561416383/work imagecodecs file:///C:/Users/task_177384508606717/croot/imagecodecs_1773845651172/work ImageIO file:///C:/Users/task_NzSFP26fSr28P_0/croot/imageio_1785928393132/work Jinja2 file:///C:/b/abs_920kup4e6u/croot/jinja2_1741711580669/work joblib file:///C:/Users/task_176786735513374/croot/joblib_1767868143118/work kiwisolver file:///C:/Users/task_DcepMh_KSaegC_0/croot/kiwisolver_1786023437793/work lxml file:///C:/miniconda3/conda-bld/lxml_1764009763146/work mapclassify file:///C:/Users/task_177082079643251/croot/mapclassify_1770821147183/work MarkupSafe file:///C:/Users/task_178239080967659/croot/markupsafe_1782390885847/work matplotlib3.11.0networkx file:///C:/miniconda3/conda-bld/networkx_1765378660985/work numpy file:///C:/Users/task_bGdgkTxJS1C6Y_0/croot/numpy_and_numpy_base_1783953973124/work/dist/numpy-2.5.1-cp313-cp313-win_amd64.whl#sha2565ca6510ab5a2d06d2c39c14a99956c0d4d418dc17cd19c51010f5cc2e4b93bcapackaging26.2pandas file:///C:/Users/task_Q_9KIMcxSmuvv_0/croot/pandas_1785760249434/work pillow file:///C:/Users/task_177797437579578/croot/pillow_1777974486868/work Py6S file:///home/conda/feedstock_root/build_artifacts/py6s_1656675897516/work pycparser file:///C:/Users/task_177495971170849/croot/pycparser_1774959815978/work pyogrio file:///C:/b/abs_3ccy1t5qd8/croot/pyogrio_1753452344091/work pyparsing file:///C:/miniconda3/conda-bld/pyparsing_1763974011379/work pypinyin file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_pypinyin_1753210868/work pyproj file:///C:/Users/task_176977227278513/croot/pyproj_1769772479311/work PySocks file:///C:/miniconda3/conda-bld/pysocks_1761753030965/work pysolar file:///home/conda/feedstock_root/build_artifacts/pysolar_1690646179287/work python-dateutil file:///C:/Users/dev-admin/perseverance-python-buildout/croot/python-dateutil_1729038406576/work pytz file:///C:/Users/task_178064946644476/croot/pytz_1780649989323/work rasterio1.5.0requests file:///C:/Users/task_178034870374817/croot/requests_1780348781782/work scikit-learn file:///C:/b/abs_45qemhn4lg/croot/scikit-learn_1753427401078/work scipy file:///C:/Users/task_178236955215081/croot/scipy_1782369674143/work/dist/scipy-1.18.0-cp313-cp313-win_amd64.whl#sha256915aaa93924f4f9c23149ee8787e2d3f921dad4bc9d666936653b36a3680261asetuptools83.0.0shapely file:///C:/miniconda3/conda-bld/shapely_1764846914659/work six file:///C:/b/abs_149wuyuo1o/croot/six_1744271521515/work threadpoolctl file:///C:/miniconda3/conda-bld/threadpoolctl_1764361788000/work tzdata file:///home/task_177806041933677/croot/python-tzdata_1778060738968/work urllib3 file:///C:/Users/task_177853590853313/croot/urllib3_1778536214467/work wheel0.47.0win_inet_pton file:///C:/miniconda3/conda-bld/win_inet_pton_1761746278300/work xyzservices file:///C:/Users/task_177678304144328/croot/xyzservices_1776783112314/work4.3 代码运行结果使用LC08_L1TP_118039_20131203_20170428_01_T1数据进行代码调试代码生成数据包含辐射校正数据、影像裁剪数据、表观反射率数据、大气校正数据。LC08_L1TP_118039_20131203_20170428_01_T1数据为Landsat 8 OLI/TIRS level-1级精纠正与地形校正 118轨道039行数据卫星数据采集时间为2013年12月3日产品数据处理时间为2017年4月28日数据集为Collection 1的第一层数据。辐射校正结果影像裁剪结果表观反射率计算结果大气校正结果4.4 代码计算结果与ENVI处理结果对比辐射校正结果对比辐射校正结果对比左—代码计算结果LC08***_RC.tiff右—ENVI计算结果RC.tiff表观反射率结果对比表观反射率计算结果对比左—代码计算结果LC08***_TOA.tiff右—ENVI计算结果 toa.tiff大气校正结果对比大气校正计算结果对比左—代码6s模型大气校正计算结果LC08***_reflection.tiff右—ENVI flaash大气校正计算结果 flaash.tiff右上图为植被像元flaash大气校正后的光谱曲线右下图为植被像元6s大气校正后的光谱曲线大气校正计算结果对比左—代码6s模型大气校正计算结果LC08***_reflection.tiff右—ENVI flaash大气校正计算结果 flaash.tiff右上图为水体像元flaash大气校正后的光谱曲线右下图为水体像元6s大气校正后的光谱曲线大气校正计算结果对比左—代码6s模型大气校正计算结果LC08***_reflection.tiff右—ENVI flaash大气校正计算结果 flaash.tiff右上图为裸地像元flaash大气校正后的光谱曲线右下图为裸地像元6s大气校正后的光谱曲线