GithubHelp home page GithubHelp logo

nmileva / starfm4py Goto Github PK

View Code? Open in Web Editor NEW
119.0 2.0 35.0 94 KB

The STARFM fusion model for Python

License: GNU General Public License v3.0

Python 97.31% TeX 2.69%
image-fusion remote-sensing earth-observation sentinel-2 sentinel-3

starfm4py's Introduction

STARFM for Python (starfm4py)

Remote sensing image fusion allows the spectral, spatial and temporal enhancement of images. New techniques for image fusion are constantly emerging shifting the focus from pan-sharpening to spatiotemporal fusion of data originating from different sensors and platforms. However, the application of image fusion in the field of Earth observation still remains limited. The number and complexity of the different techniques available today can be overwhelming thus preventing users from fully exploiting the potential of fusion products.

The aim of this study is to make fusion products more accessible to users by providing them with a simple tool for spatiotemporal fusion. This tool will contribute to the better exploitation of data from available sensors making possible to bring the images to the spectral, spatial and temporal resolution required by the user. The fusion algorithm implemented in the tool is based on the spatial and temporal adaptive reflectance fusion model (STARFM) – a well established fusion technique in the field of remote sensing often used as benchmark by other algorithms.

How to cite?

If you use this code for published work, please cite it using the reference below or the BibTex file:

Mileva, N., Mecklenburg, S. & Gascon, F. (2018). New tool for spatiotemporal image fusion in remote sensing - a case study approach using Sentinel-2 and Sentinel-3 data. In Bruzzone, L. & Bovolo, F. (Eds.), SPIE Proceedings Vol. 10789: Image and Signal Processing for Remote Sensing XXIV. Berlin, Germany: International Society for Optics and Photonics. doi: 10.1117/12.2327091; https://doi.org/10.1117/12.2327091

A copy of the paper can be downloaded here: https://opus.bibliothek.uni-augsburg.de/opus4/frontdoor/index/index/docId/78805

Installation

It is recommended to use the Anaconda distribution for Python 3. Run the below code from the Anaconda prompt by replacing myenv with a name of your choice. For the full list of requirements, check the requirements file.

conda create -n myenv dask rasterio zarr matplotlib

Usage

STARFM was initially developed to blend Landsat and MODIS images. The current implementation is not sensor specific and can be used for other sensor pairs such as Sentinel-2 and Sentinel-3 (OLCI). However, certain degree of similarity between the images is needed before they can be blended. The most common harmonization steps are:

  • atmospheric correction - in case a surface reflectance product is not already available, the atmospheric correction will be the first step to be performed; the algorithm to be used depends on the satellite sensor; popular atmospheric correction models for Sentinel-2 and Sentinel-3 (OLCI) are iCor, Sen2Cor, SMAC, etc.
  • cloud masking - cloud pixels should be excluded;
  • re-projection - all images should be in the same cartographic coordinate system (e.g. WGS84 UTM 35N);
  • resampling to same pixel size, that is usually the pixel size of the fine resolution image;
  • co-registration of the images - the images should not only have the exact same extent but they should also match on (sub-)pixel level; useful tools for co-registration are AROSICS, GeFolki, eo-learn, pyelastix, etc.
  • bandpass adjustment (not mandatory);
  • BRDF normalization (not mandatory);

For an example of usage check test.py. To apply the algorithm on other images, make sure to adjust the variables in parameters.py.

starfm4py's People

Contributors

nmileva 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

starfm4py's Issues

Some questions to ask. Please help me.

When I run the code, a error like that occurs:cannot import name 'sizeSlices' from 'parameters' (D:\Anaconda3\envs\myenv\lib\site-packages\parameters_init_.py) what should I do next? Thanks a lot.

Applying code to multiple bands

Thanks for your valuable work. There was an issue I could not understand while applying the test.py code. How can I apply the code to multi-band images? As I understand it, in order to apply the algorithm to an image containing 6 bands, it is necessary to change the rasterio.open(....read(1)) section in the test.py and repeat this process 6 times (for earch band). Is this approach correct?

Predicted image getting shifted and stretched

Hi,
Very helpful. I have tried the code to predict Landsat resolution image from Modis data. I am basically trying to reproduce LST at Landsat resolution from Modis data.
However I am facing some issues with the predicted image. Although the LST (surface temperature) range in the predicted image is very close to the actual Landsat data; however the predicted image appears shifted from the input image. All the images had been co-registered, resampled, cloud masked before feeding in the model. Have you come across this issue and suggest a resolution if I have missed any critical step?

Some questions I want to ask

Firstly, thank you for your contribution, your code is of great help to me. If it won't bother you too much, I have some little problem to ask you for.
1' How do you evaluate the method. I calculated the PSNR between the result and the GT(groundtruth ), but it's only -44.17. In what way should I do it correctly.
2' The demo 'test' seems to only deal with images with only one spectral band. If I want to use it on hyperspectral images, what should I do? Should I just do it band by band through a 'for' iteration?

I would be very grateful if you could save some time to answer my question

The requirements for windowsize

Hi, Nmileva. When I am running code, some windowsize values can yield results, but many other values will report errors after running, indicating that the array shape is different. What should I do?

Daisy

Need array(s) to concatenate - dask value error

Hello, hope you're doing fine.
I cloned the code to test the data you've provided, and installed all the dependencies ( Used Pipenv instead of conda and installed zarr, dask, rasterio and matplotlib successfully).
So just ran the code with default parameters and settings and it seems the code passed the partitioning. but in the da_stack() function encountered error as

ValueError: Need array(s) to concatenate

which came from python3.8/site-packages/dask/array/core.py.
I would appreciate any help.
Thanks by the way.

I have some little problem to ask

When I run the code, a error like that occurs:cannot import name 'sizeSlices' from 'parameters' (D:\Anaconda3\envs\myenv\lib\site-packages\parameters_init_.py) what should I do next?

I would be very grateful if you could save some time to answer my question.Thanks a lot.

ESTARM - help

Hi Mileva,

Thanks the code was very useful and helpful in understanding the implementation of STARFM. I am working on fusing the Thermal bands of Modis and Landsat data to produce daily Land Surface Temperature (LST) at Landsat Resolution .
While STARFM is useful to start off, I would like to understand if you have also implemented ESTARFM in python and could guide is on that.

Thanks ,
Gunjan

ValueError: Chunks and shape must be of the same length/dimension.

Hello,
I have fused Landsat and MODIS with this code. Actually it works, thank you very much for your share.
But the problem I faced is the predicted landsat-like image is a single-band image.
So I tried to change the code in test.py and starfm4py.py.
For example I changed the read(1) to read(), and change ‘’the profile.update(dtype='float64', count=1) to ‘’the profile.update(dtype='float64', count=2) ‘’. However, the ValueError ‘’Chunks and shape must be of the same length/dimension‘’ is generated.
So what I want to know is how to modify the code in a right way.
Best regards,
Xin

Parameters setting for Landsat and MODIS LST

Hi, thank you so much for your great work! I'm trying to use your script to fuse Landsat and MODIS land surface temperature. Have you done any experiment on that? Do you have any suggestions on the parameter settings for this task? Thanks!

run

Hi,

This code can be used for two pairs of MODIS and Landsat images?

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.