Code Monkey home page Code Monkey logo

pylandtemp / pylandtemp Goto Github PK

View Code? Open in Web Editor NEW
150.0 150.0 22.0 6.45 MB

Algorithms for computing global land surface temperature and emissivity from NASA's Landsat satellite images with Python.

License: Apache License 2.0

Python 100.00%
climate earth-observation earth-science geodata geospatial image-processing landsat landsat-8 landsat-data nasa-api nasa-data python raster remote-sensing satellite-data satellite-imagery-analysis satellite-images

pylandtemp's Introduction

pylandtemp

GitHub license GitHub stars GitHub forks GitHub issues

Description

pylandtemp is a Python library that provides a simple API for computing global land surface temperature and emissivity from NASA's Landsat Level 1 satellite images (starting from Landsat 5 to Landsat 8). It contains some implementations of Single-Channel and split window techniques. More methodologies under these groups will be added in the future.

Additionally, it also provides multiple methods for computing land surface emissivity. It is targeted towards supporting research and science workflows in many fields including climate science, earth sciences, remote sensing, space tech, geospatial data science, environmental studies, among others.

Installation

The pylandtemp Python package is available through PyPI:

pip install pylandtemp

Documentation

The pylandtemp Python library is divided into multiple methods which provide access to set of algorithms for different computations.

  • Land surface temperature

    • Single-Channel: through the single_window() method
    • Split window: through the split_window() method
  • Land surface emissivity

    • Through the emmissivity() method.
  • Brightness temperature

    • Through the brightness_temperature() method.
  • Normalized Difference Vegetation Index (NDVI)

    • Through the ndvi() method.

Example

To compute land surface temperature using Jiminez-Munoz et al. (2014) split window technique and Ugur Avdan et al. (2014) emissivity computation method, a simple implementation is shown below:

import numpy as np
from pylandtemp import split_window

# lst_method and emissivity_method should point to keys of chosen -
# algorithms for temeprature and emmisivity, respectively

# Keys for available algorithms are presented in the next section

# tempImage10 is a numpy array of band 10 brightness temperature 
# tempImage11 is a numpy array of band 10 brightness temperature 
# redImage is a numpy array of the red band
# nirImage is a numpy array of the near infra-red (NIR) band

lst_image_split_window = split_window(
    tempImage10, 
    tempImage11, 
    redImage, 
    nirImage, 
    lst_method='jiminez-munoz', 
    emissivity_method='avdan',
    unit='celcius'
)

# The function returns a numpy array which is the land surface temperature image.

Supported algorithms and their reference keys

Land surface temperature --- Split window

Algorithm key
Jiminez-Munoz et al. (2014) 'jiminez-munoz'
Sobrino et al. (1993) 'sobrino-1993'
Kerr et al. (1992) 'kerr'
McMillin et al. (1975) 'mc-millin'
Price (1984) 'price'

Land surface temperature --- Single-Channel

Algorithm key
Ugur Avdan et al. (2014) 'mono-window'

Land surface emissivity

Algorithm key
Gopinadh Rongali et al. (2018) 'gopinadh'
Ugur Avdan et al. (2014) 'avdan'
Xiaolei Yu et al. (2014) 'xiaolei'

Tutorials

The notebooks here are tutorials on how to use pylandtemp package.

Contributing

Open source thrives on collaborations and contributions. Let us work on this package in the same spirit.

If you catch any bug, find any typo or have any suggestions that will make this package better,

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

Fork the Project Create your Feature Branch (git checkout -b feature/AmazingFeature) Commit your Changes (git commit -m 'Add some AmazingFeature') Push to the Branch (git push origin feature/AmazingFeature) Open a Pull Request

What's new

  • September 2022: Started to work on intergrating with with google Earth Engine to pull data directly and automate the workflow.
  • July 2022: Poster presentation of this project at Scipy 2022. Link here
  • December 2021: version 0.0.1-alpha.1 pre-release version is out on PyPI. Find it here
  • December 2021: Implemented tutorial notebooks based on the different methods. Find them here
  • November 2021: Implemented a runner for dynamic dispatch.

Code license

The code of this library is available under the Apache 2.0 license.

Sponsor

How to cite

Mudele, O., (2021). pylandtemp: A Python package for computing land surface 
temperature from Landsat satellite imagery. GitHub: https://github.com/pylandtemp/pylandtemp.

If preferred, here is the BibTex:

@Misc{pylandtemp,
author = {Oladimeji Mudele},
title =        {pylandtemp: A Python package for computing land surface temperature from Landsat satellite imagery},
howpublished = {GitHub},
year =         {2021},
url =          {https://github.com/pylandtemp/pylandtemp}
}

pylandtemp's People

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  avatar

pylandtemp's Issues

Fractional Vegetation Cover Formula

Hi @dimejimudele ,I must commend the great effort and man-hour you have put into this script. It's such an awesome one and it's really helpful.

However, while going through the script, I got confused at the function for calculating the LSE from FVC, there, I found out that the formula you used for the FVC==> (NDVI-NDVImin)/(NDVImax-NDVImin)**2 looks different from the formula I have seen in various researches==> (NDVI-NDVIs)/(NDVIs-NDVIv) where NDVIs is the NDVI of bare soil and NDVI v is the NDVI of vegetation. I went ahead to look up the research paper you attached in the function docstrings too, but I did not find the formula you used there.
I'm not saying the formula is wrong, maybe it's in another research paper you got the formula from which you probably forgot to add in the function docstrings.

All I need is just to ascertain the formula, so I can go ahead to use it for my FVC estimation as well and also cite the paper too.

I look forward to your response, thanks!

Negative Temperature

Getting negative temperature for Landsat 8 data, which is unrealistic for that region.

Output raster data

Thank you so much for your package in the calculations of LST and NDVI! These really help me a lot in my coursework.

However, as a student and newbie in Python and handling raster data, do you have any recommendations on how to output the raster data of LST and NDVI? I have searched it online, and there is no effective method I can apply in my research. Do you have any recommended codes or solutions that can be connected to this package? Thank you so much!

One of those solutions in the output raster data is like this one:
ndviImage = rasterio.open('ndviImage.tiff','w',driver='Gtiff',
width = redband.width,
height = redband.height,
count=1, crs=redband.crs,
transform=redband.transform,
dtype='float64')

ndviImage.write(ndvi,1)
ndviImage.close()

However, it doesn't work and reports errors in VS Code.

For Landsat 8 Collection 2 level 2 products

I notice that the data you are dealing with is for Collection 1. Do rescaling factors also apply to collection 2? When I tried to modify these factors, it went horribly wrong.

Possible minor bug

Thank you for this repo! It looks really good.

I was able to replicated:
https://github.com/pylandtemp/pylandtemp/blob/master/tutorials/Tutorial_1-%20load_landsat8_image_from_amazon_and_google_cloud.ipynb

In code block 6
# Creating and applying the mask to the images. mask = tempImage10 == 0 tempImage10[mask] = np.nan tempImage11[mask] = np.nan

Should the mask be set twice?
# Creating and applying the mask to the images. mask = tempImage10 == 0 tempImage10[mask] = np.nan mask = tempImage11 == 0 tempImage11[mask] = np.nan

NDVI computation with Landsat 8 and other landsat dataset

The package currently doesn't address the issue of maximum DN values specified in the data documentation by NASA for Landsat. E.g For Landsat 8, the maximum DN value is 65535 and the minimum value is 0. This leads to bad computation of NDVI, as a result, emissivity.

There is the need to incorporate these details into the package workflow.

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.