Git Product home page Git Product logo

sofanitaraya / cropphenology Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 5.0 237.63 MB

This repository holds the code for an R package called CropPhenology. The package extracts phenological information of crops from multi temporal remote sensing vegetation index images

Home Page: http://cropphenology.wixsite.com/package

R 100.00%
cropphenology crops growth-curve vegetation-dynamics vegetation-index remote-sensing devtools raster phenological-metrics

cropphenology's Introduction

CropPhenology package extracts phenological metrics from time series of seasonal vegetation index data. It has two functions: PhenoMetrics and MultiPointsPLots. PhenoMetrics create a raster stack or a table of phenological metrics for polygon or point area of interstes, respectively.

Prerequesites - packages 'raster', 'rgdal', 'maptools', 'shapefiles' and 'xlsx' are required.

Installation - The CropPhenology package can be installed from GitHub repository using 'Devtools' package. Hence, Devtools should be installed and loaded prior to the CropPhenology installation. The following code lines provide the installation steps:

install.packages ("devtools");library(devtools);install_github("SofanitAraya/CropPhenology")

Running the tests - Two test data are availabel with the installation. It can be run from the R program.

Built history - This package is built using R software, as part of the PhD resaerch of the first Author, at Spatial Information Group (SIG) of The University of Adelaide. This project is supported by funding from The University of Adelaide.

Authors - Sofanit Araya, Bertram Ostendorf, Megan Lewis and Greg Lyle

Please check - https://github.com/SofanitAraya/CropPhenology/wiki/CropPhenology-Package

cropphenology's People

Contributors

sofanitaraya 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

Watchers

 avatar  avatar  avatar  avatar

cropphenology's Issues

dimnames(x) <- list(n) : 'dimnames' applied to non-array

Hello! I saw a similar issue in this github but I still could not solve it.
I'm working with ~30 Sentinel-2 NDVI images.

class : RasterStack dimensions : 905, 1383, 1251615, 30 (nrow, ncol, ncell, nlayers) resolution : 10, 10 (x, y) extent : 264740, 278570, 7479240, 7488290 (xmin, xmax, ymin, ymax) crs : +proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs names : S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, S2A2A_202//2r_NDVI_10, ... min values : -1.0000, -0.6645, -0.6622, -0.7279, -0.9792, -0.6608, -0.3325, -0.5878, -0.7370, -0.6062, -0.7589, -0.9960, -0.7532, -0.5296, -1.0000, ... max values : 0.9995, 0.9994, 1.0000, 1.0000, 0.9417, 0.9562, 0.8645, 0.8877, 0.9993, 1.0000, 0.9994, 1.0000, 0.9912, 0.9246, 0.9546, ...

When I run the code, this is what it gives.
x = PhenoMetrics(NDVI) [1] "Shapefiles is loaded correctly" [1] "sp is loaded correctly" [1] "sf is loaded correctly" [1] "maptools is loaded correctly" [1] "rgdal is loaded correctly" [1] "xlsx is loaded correctly" [1] "rgeos is loaded correctly" [1] "raster is loaded correctly" [1] "The default value, 20%, will be applied" [1] "Unsmoothed curve will be used" Error in dimnames(x) <- list(n) : 'dimnames' applied to non-array

Can you give me some advice to solve it? Are Sentinel-2 images not suitable?
Thank you

The order of the parameters is swapped

Dear Sofanit,

I had an issue with the order of the parameters when using R CropPhenology and I realized I copied the order of the metrics from line 866 of the code.

The line 866 of the R/CropPhenology.R code shows that "The phenologic metrics in the sequence of: OnsetV, OnsetT, OffsetV, OffsetT, MAxV, MaxT, TINDVI, TINDVIBeforeMax, TINDVIAfeterMax, Assymetry, GreenUpSlope, BrownDownSlope, LengthGS, BeforeMaxT, AfterMaxT", but this information not match with the Table 1 from package wiki (https://github.com/SofanitAraya/CropPhenology/wiki/CropPhenology-Package).

The correct order is: OnsetV, OnsetT, MAxV, MaxT, OffsetV, OffsetT, LengthGS, BeforeMaxT, AfterMaxT, GreenUpSlope, BrownDownSlope, TINDVI, TINDVIBeforeMax, TINDVIAfeterMax, Assymetry.

Thanks for the attention!

Asking for help regarding the error produced at the code CropPhenology

Dear Sofanit,
Thanks for developing such a code in R for handling the time series MODIS data. I am working on the crop phenology of lower Gangetic basin. I have tried with a raster time series stack. It looks like following.

> ndvimap
class       : RasterBrick 
dimensions  : 29, 24, 696, 360  (nrow, ncol, ncell, nlayers)
resolution  : 0.08331404, 0.08329475  (x, y)
extent      : -152.9646, -150.965, 66.30262, 68.71817  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
data source : in memory
names       : X1982.01.01, X1982.02.01, X1982.03.01, X1982.04.01, X1982.05.01, X1982.06.01, X1982.07.01, X1982.08.01, X1982.09.01, X1982.10.01, X1982.11.01, X1982.12.01, X1983.01.01, X1983.02.01, X1983.03.01, ... 
min values  :       0.000,       0.000,       0.000,       0.000,       0.130,       0.350,       0.557,       0.537,       0.419,       0.074,       0.000,       0.000,       0.000,       0.000,       0.000, ... 
max values  :       0.266,       0.262,       0.293,       0.834,       0.666,       0.900,       0.998,       0.971,       0.832,       0.953,       0.704,       0.345,       0.262,       0.262,       0.306, ... 
Date        : 1982-01-16, 2011-12-16 (min, max)

However, the PhenoPlot command yield the following error

> pheno <- PhenoPlot(ndvimap)
Error in .local(x, ...) : invalid layer names

And the PhenoMetrics command yields the following error

> pheno <- PhenoMetrics(ndvimap)
[1] "Shapefiles is loaded correctly"
[1] "sp is loaded correctly"
[1] "sf is loaded correctly"
[1] "maptools is loaded correctly"
[1] "rgdal is loaded correctly"
[1] "xlsx is loaded correctly"
[1] "rgeos is loaded correctly"
[1] "raster is loaded correctly"
[1] "The default value, 20%, will be applied"
[1] "Unsmoothed curve will be used"
Error in dimnames(x) <- list(n) : 'dimnames' applied to non-array

Can you please help me to fix the error.

Regards,

Prasenjit Acharya
Department of Geography and Environment Management
Vidyasagar University
Midnapore - 721102, IND

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.