Giter Site home page Giter Site logo

pytvdi's Introduction

pyTVDI

Synopsis

This project contains Python code for computing the Temperature-Vegetation Dryness Index for assessing soil moisture and evaporative fraction with remote sensing data combining a vegetation index and radiometric surface temperature.

The project consists of:

  1. lower-level modules with the basic functions needed in TVDI calculation.

  2. higher-level scripts for easily running pyTVDI from imagery.

Installation

Download the project to your local system, enter the download directory and then type

python setup.py install.

if you want to install pyTVDI and its low-level modules in your Python distribution.

The following Python libraries will be required for running pyTVDI:

  • Numpy
  • GDAL

Code Example

High-level example

The easiest way to get a feeling of pyTVDI and its configuration is through the provided ipython/jupyter notebooks. In a terminal shell, navigate to your working folder and type

  • jupyter notebook TVDIgui.ipynb.

In addition, you can also run TVDI with the scripts MAIN_TVDI.py, which will read an input configuration file (defaults are Config_TVDI.txt). You can edit these configuration files or make a copy to fit your data and site characteristics and either run any of these two scripts in a Python GUI or in a terminal shell:

  • python MAIN_TVDI.py <configuration file>..

where <configuration file> points to a customized configuration file... leave it blank if you want to use the default file Config_TVDI.txt.

Low-level example

You can obtain TVDI/EF images by importing the module tvdi, which contains all the methods for estimating the dry and wet edges and computing TVDI or Evaporative Fraction.

import pyTVDI 
output=pyTVDI.tvdi(io_inf, roi_inf, alg_inf)

You can type help(pyTVDI.tvdi) to understand better the inputs needed and the outputs returned

Basic Contents

High-level modules

  • .src/pyTVDI.py, class object for TSEB scripting.
  • TVDI_GUI.ipynb notebook for using pyTVDI and configuring TSEB through a Graphical User Interface, GUI.
  • MAIN_TVDI.py, high level scripts for running TVDI through a configuration file (Config_TVDI.txt).

Low-level module

The low-level module in this project is aimed at providing customisation and more flexibility in running the Ts-VI triangle method. The following modules are included

  • .src/pyTVDI.py.

core functions for running TVDI.

API Reference

http://pytvdi.readthedocs.org/en/latest/index.html

Main Scientific References

  • Sandholt, I.; Rasmussen, K. & Andersen, J. A simple interpretation of the surface temperature/vegetation index space for assessment of surface moisture status. Remote Sensing of Environment , 2002, 79, 213 - 224.

  • Stisen S.; Sandholt I.; Nørgaard A.; Fensholt R. & Jensen, K. Combining the triangle method with thermal inertia to estimate regional evapotranspiration - Applied to MSG-SEVIRI data in the Senegal River basin. Remote Sensing of Environment, 2008, 112, 1242-1255.

  • de Tomás, A.; Nieto, H.; Guzinski, R.; Salas, J.; Sandholt, I. & Berliner, P. Validation and scale dependencies of the triangle method for the evaporative fraction estimation over heterogeneous areas. Remote Sensing of Environment , 2014, 152, 493 - 511.

Tests

The folder ./Input contains examples for running pyTVDI. Just run the high-level scripts with the configuration files provided by default and compare the resulting outputs with the files stored in ./Output/

Contributors

License

pyTVDI: a Python Temperature-Vegetation Dryness Index

Copyright 2016 Hector Nieto and contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

pytvdi's People

Contributors

hectornieto avatar

Stargazers

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

Watchers

 avatar  avatar

pytvdi's Issues

failed to validate LinearAxis gdal error

1.First gdal import need to replace

import gdal

from osgeo import gdal

2.Validate LineAxis

I want to run example but it's give me the error below


ValueError Traceback (most recent call last)
in
35 ramp = figure(tools="", y_range = [0, 1], x_range = [low_flux,high_flux], plot_width = 650, plot_height=100)
36 ramp.toolbar_location=None
---> 37 ramp.yaxis.visible = None
38 ramp.rect(x=y, y=0.5, color=colortable, width=dy, height = 1)
39

c:\python39\lib\site-packages\bokeh-2.3.1-py3.9.egg\bokeh\models\plots.py in setattr(self, attr, value)
736 def setattr(self, attr, value):
737 for x in self:
--> 738 setattr(x, attr, value)
739 def getattribute(self, attr):
740 if attr in dir(list):

c:\python39\lib\site-packages\bokeh-2.3.1-py3.9.egg\bokeh\core\has_props.py in setattr(self, name, value)
296
297 if name in props or (descriptor is not None and descriptor.fset is not None):
--> 298 super().setattr(name, value)
299 else:
300 matches, text = difflib.get_close_matches(name.lower(), props), "similar"

c:\python39\lib\site-packages\bokeh-2.3.1-py3.9.egg\bokeh\core\property\descriptors.py in set(self, obj, value, setter)
550 raise RuntimeError(f"{class_name}.{self.name} is a readonly property")
551
--> 552 self._internal_set(obj, value, setter=setter)
553
554 def delete(self, obj):

c:\python39\lib\site-packages\bokeh-2.3.1-py3.9.egg\bokeh\core\property\descriptors.py in _internal_set(self, obj, value, hint, setter)
782
783 """
--> 784 value = self.property.prepare_value(obj, self.name, value)
785 old = self._get(obj)
786 self._real_set(obj, old, value, hint=hint, setter=setter)

c:\python39\lib\site-packages\bokeh-2.3.1-py3.9.egg\bokeh\core\property\bases.py in prepare_value(self, owner, name, value)
348 else:
349 obj_repr = owner if isinstance(owner, HasProps) else owner.name
--> 350 raise ValueError(f"failed to validate {obj_repr}.{name}: {error}")
351
352 if isinstance(owner, HasProps):

ValueError: failed to validate LinearAxis(id='1118', ...).visible: expected a value of type bool or bool_, got None of type NoneType

I don't know what happen?

The step to use the function

Hi, thank you for your code.
I am sorry I used the TVDIgui to run the calculation, the problem was I got negative result. I mean, because the range of TVDI is 0 to 1 but I calculated most of the pixels to be negative value... Do you have any idea about that? Thx

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.