栏目分类:
子分类:
返回
终身学习网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
终身学习网 > IT > 软件开发 > 后端开发 > Python

【SEBAL模型代码搬运】

Python 更新时间:发布时间: 百科书网 趣学号

最近要开始学习SEBAL模型了,记录一下学习历程。今天在github上看到了,分享如下,感谢作者Rafael Tieppo:

参考文献与代码下载:

《SEBAL model by means GRASS and PYTHON》

SEBAL model by means GRASS and PYTHON

Motivation

Now days it is noticed several occurrences about water shortage in agriculture, decreasing yield crops and profits. The irrigation system is a resource to aid the farmers to manage the system production to achieve a reasonable yield. Among several variables for a irrigation management, there are two of them with a major importance, the crop coefficient (kc) and Reference crop evapotranspiration (ETo) (Gondim et al., 2005).

In the last decades the remote sensing techniques has been used to identify landscapes, soil classes, and water energy balance as well, providing conditions to analyze data in a regional scale. By means orbital sensors and algorithms to convert digital numbers to reflectance and radiation flux, remotesensing methods to predict the evapotranspiration is a important tool to handle the hydrological cycle (Bernardo et al., 2006).

The SEBAL (Surface Energy Balance Algorithm for Land) uses the surface energy balance to predict some hydrological features (evapotranspiration, water deficit, etc) and Its main creator is Professor Wim G. M. Bastiaanssen (Bastiaanssen et al., 1998). That method has been validated under several conditions for different locations ((Bastiaanssen, 2000),(Bastiaanssen et al., 2002), (Santos et al., 2010)).

There are several available algorithms to evapotranspiration prediction ((Wolff, 2016), (Cavalcante et al., 2016), (Hessels et al., 2017)). However is missing a specific code to run on python 3 and GRASS 74. Thus we aimed to implement SEBAL model for Landsat 8 iamges using the language Python version 3 (Rossum, 1995) and GRASS version 7.4 (Neteler et al., 2012).

Requirements
  • GRASS GIS version 7.4
    • GRASS GUI
    • GRASS DEV
  • Python 3.x, sugestion: CONDA

Make sure your system has Python Libraries:

  • math
  • numpy
  • os
  • grass_session
  • grass.script
  • osgeo

NOTE: About packages instalation

  • The packs math and os are standard in Python3
  • To install numpy, you may use:
    pip3 install numpy
  • To install grass_session and grass.script, you may use:
    pip3 install grass-session
  • osgeo is from gdal. Thus you may install gdal:
    • if you don't have gdal 1.11 already installed:
      sudo apt-get install gdal-bin python-gdal python3-gdal
    • if you want only gdal for python3:
      sudo apt-get install python3-gdal

How to use
  1. Download at Landsat 8 images (LS8 - OLI/TIRS)
  2. Reproject all the images (LS8 images) for the interested coordinate reference system (e.g. EPSG:32721)
  3. For all images remove null values
  4. Get Digital Elevation Model (DEM) from ASTER
  5. You must reproject the DEM file for the same coordinate reference system of interest, rename it as MDT_Sebal.TIF
  6. Create a GRASS Session with GRASS-GIS software. You need to assign GRASS location and GRASS Mapset. Note that all maps must have the same coordinate reference system (projection). For further information about GRASS you can check GRASS-GIS.
  7. Make sure that all files are in the same folder, SEBAL_v10.py inclusive.
  8. Launch a text editor file and open SEBAL_v10.py. Find the lines 67, 68, 69, you will find:
PERMANENT.open(gisdb='/home/rafatieppo/Documents/QGIS_SEBAL/20170904/',
               location='sirgas2000utm21s',
               create_opts='EPSG:31981')

Replace the text between quotes, e.g.:

PERMANENT.open(gisdb='path for YOUR files',
               location='YOUR folder location',
               create_opts='YOUR reference coordinate system')

after that, save and close it.

  1. If use Linux launch the Terminal, or if are Windows user launch DOS Prompt. Once you are in correct folder (that one with all your files) just run python SEBAL_v10.py, and insert the required values.

Notes
  • Tested on Ubuntu 16.04 LTS
  • Tested on Ubuntu 18.04 LTS

References

Bastiaanssen, W.G.M., 2000. SEBAL-based sensible and latent heat fluxes in the irrigated Gediz Basin, Turkey. Journal of Hydrology 229, 87–100. https://doi.org/https://doi.org/10.1016/S0022-1694(99)00202-4

Bastiaanssen, W.G.M., Ahmad, M.-u.-D., Chemin, Y., 2002. Satellite surveillance of evaporative depletion across the Indus Basin. Water Resources Research 38, 9–1–9–9. https://doi.org/10.1029/2001WR000386

Bastiaanssen, W.G.M., Menenti, M., Feddes, R.A., Holtslag, A.A.M., 1998. A remote sensing surface energy balance algorithm for land (SEBAL). 1. Formulation. Journal of Hydrology 212-213, 198–212. https://doi.org/https://doi.org/10.1016/S0022-1694(98)00253-4

Bernardo, S., Soares, A.A., Mantovani, E.C., 2006. Manual de irrigação, 8th ed. UFV, Viçosa.

Cavalcante, L.B., Inácio, A. da S., Barros, H.G., Jiménez, Nicácio, R.M., Coelho, S.M.S. da C., 2016. Cálculo do saldo de radiação pelo algoritmo sebal na porção do baixo-médio São Francisco, Brasil, utilizando um software de código livre. Revista Brasileira de Cartografia 1515–1529.

Gondim, R., Teixeira, A.d.S., Barbosa, F., 2005. Novo paradigma para a água e coeficientes de cultivos aplicados à gestão de recursos hídricos em nível de bacia hidrográfica. Revista Item Irrigação e Tecnologia 14–18.

Hessels, T., Opstal, J. van, Trambauer, P., Bastiaanssen, W., Smiej, M.F., Mohamed, Y., Er-Raji, A., 2017. pySEBAL_3.3.8.

Neteler, M., Bowman, M.H., Landa, M., Metz, M., 2012. GRASS GIS: a multi-purpose Open Source GIS. Environmental Modelling & Software 31, 124–130. https://doi.org/10.1016/j.envsoft.2011.11.014

Rossum, G. van, 1995. Python tutorial (No. CS-R9526). Centrum voor Wiskunde en Informatica (CWI), Amsterdam.

Santos, T.V. dos, Fontana, D.C., Alves, R.C.M., 2010. Avaliação de fluxos de calor e evapotranspiração pelo modelo SEBAL com uso de dados do sensor ASTER. Pesquisa Agropecuária Brasileira 45, 488–496. https://doi.org/10.1590/S0100-204X2010000500008

Wolff, W., 2016. wwolff7/SEBAL_GRASS. https://doi.org/10.5281/zenodo.167350

转载请注明:文章转载自 www.051e.com
本文地址:http://www.051e.com/it/1043179.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 ©2023-2025 051e.com

ICP备案号:京ICP备12030808号