From 947fc1cfccf6f3fd3dcd0f9ed3119783ee5cc996 Mon Sep 17 00:00:00 2001 From: MartinuzziFrancesco Date: Mon, 16 Dec 2024 15:00:16 +0100 Subject: [PATCH 1/3] support for lt --- .github/workflows/CI.yml | 4 ++-- Project.toml | 2 +- README.md | 2 +- src/SpectralIndices.jl | 5 ----- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 469bf66..7c06c60 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,8 +15,8 @@ jobs: fail-fast: false matrix: version: - - '1.9' - - '1' + - '1.10' + - '1.11' os: - ubuntu-latest arch: diff --git a/Project.toml b/Project.toml index e52bf59..5cd14fe 100644 --- a/Project.toml +++ b/Project.toml @@ -24,7 +24,7 @@ DimensionalData = "0.26, 0.27, 0.28" Downloads = "1" JSON = "0.21" YAXArrays = "0.5" -julia = "1.6" +julia = "1.10" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" diff --git a/README.md b/README.md index 5f15d1d..26be48c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [cc-img]: https://codecov.io/gh/awesome-spectral-indices/SpectralIndices.jl/graph/badge.svg?token=0IRRDAZM0U [cc-url]: https://codecov.io/gh/awesome-spectral-indices/SpectralIndices.jl -[julia-img]: https://img.shields.io/badge/julia-v1.9+-blue.svg +[julia-img]: https://img.shields.io/badge/julia-v1.10+-blue.svg [julia-url]: https://julialang.org/ [style-img]: https://img.shields.io/badge/code%20style-blue-4495d1.svg diff --git a/src/SpectralIndices.jl b/src/SpectralIndices.jl index b2c9f24..9df253a 100644 --- a/src/SpectralIndices.jl +++ b/src/SpectralIndices.jl @@ -19,11 +19,6 @@ include("compute_index.jl") include("compute_kernel.jl") include("datasets.jl") -if !isdefined(Base, :get_extension) - include("../ext/SpectralIndicesDataFramesExt.jl") - include("../ext/SpectralIndicesYAXArraysExt.jl") -end - indices = _create_indices() bands = _create_bands() constants = _create_constants() From 5b02810b7ccf7108d62b7e92aeffadb1064f7cc1 Mon Sep 17 00:00:00 2001 From: MartinuzziFrancesco Date: Tue, 17 Dec 2024 09:40:04 +0100 Subject: [PATCH 2/3] up version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 5cd14fe..647bc82 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SpectralIndices" uuid = "df0093a1-273d-40bc-819a-796ec3476907" authors = ["MartinuzziFrancesco "] -version = "0.2.10" +version = "0.2.11" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" From 38c04334052086409e9698d757e1fa2fa543f072 Mon Sep 17 00:00:00 2001 From: MartinuzziFrancesco Date: Tue, 17 Dec 2024 10:51:07 +0100 Subject: [PATCH 3/3] conforming list to asi --- data/spectral-indices-dict.json | 51 ++++++++++++++++++++++++++++----- src/indices_funcs.jl | 24 ++++++++++++---- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/data/spectral-indices-dict.json b/data/spectral-indices-dict.json index 565faa1..eaae653 100644 --- a/data/spectral-indices-dict.json +++ b/data/spectral-indices-dict.json @@ -515,6 +515,43 @@ "reference": "https://doi.org/10.1078/0176-1617-00887", "short_name": "CIRE" }, + "CRI550": { + "application_domain": "vegetation", + "bands": [ + "B", + "G" + ], + "contributor": "https://github.com/eomasters-repos", + "date_of_addition": "2024-08-08", + "formula": "(1.0 / B) - (1.0 / G)", + "long_name": "Carotenoid Reflectance Index using 550 nm", + "platforms": [ + "Sentinel-2", + "Landsat-OLI", + "Landsat-TM", + "Landsat-ETM+", + "MODIS", + "Planet-Fusion" + ], + "reference": "https://doi.org/10.1562/0031-8655(2002)0750272ACCIPL2.0.CO2", + "short_name": "CRI550" + }, + "CRI700": { + "application_domain": "vegetation", + "bands": [ + "B", + "RE1" + ], + "contributor": "https://github.com/eomasters-repos", + "date_of_addition": "2024-08-08", + "formula": "(1.0 / B) - (1.0 / RE1)", + "long_name": "Carotenoid Reflectance Index using 700 nm", + "platforms": [ + "Sentinel-2" + ], + "reference": "https://doi.org/10.1562/0031-8655(2002)0750272ACCIPL2.0.CO2", + "short_name": "CRI700" + }, "CSI": { "application_domain": "burn", "bands": [ @@ -985,7 +1022,7 @@ "MODIS", "Planet-Fusion" ], - "reference": "https://doi.org/10.22541/essoar.171561872.22414664/v1", + "reference": "https://doi.org/10.1029/2024JG008240", "short_name": "EVIv" }, "ExG": { @@ -4662,7 +4699,7 @@ "MODIS", "Planet-Fusion" ], - "reference": "https://doi.org/10.22541/essoar.171561872.22414664/v1", + "reference": "https://doi.org/10.1029/2024JG008240", "short_name": "bNIRv" }, "kEVI": { @@ -4826,7 +4863,7 @@ "Landsat-ETM+", "MODIS" ], - "reference": "https://doi.org/10.22541/essoar.171561872.22414664/v1", + "reference": "https://doi.org/10.1029/2024JG008240", "short_name": "sNIRvLSWI" }, "sNIRvNDPI": { @@ -4848,7 +4885,7 @@ "Landsat-ETM+", "MODIS" ], - "reference": "https://doi.org/10.22541/essoar.171561872.22414664/v1", + "reference": "https://doi.org/10.1029/2024JG008240", "short_name": "sNIRvNDPI" }, "sNIRvNDVILSWIP": { @@ -4869,7 +4906,7 @@ "Landsat-ETM+", "MODIS" ], - "reference": "https://doi.org/10.22541/essoar.171561872.22414664/v1", + "reference": "https://doi.org/10.1029/2024JG008240", "short_name": "sNIRvNDVILSWIP" }, "sNIRvNDVILSWIS": { @@ -4890,7 +4927,7 @@ "Landsat-ETM+", "MODIS" ], - "reference": "https://doi.org/10.22541/essoar.171561872.22414664/v1", + "reference": "https://doi.org/10.1029/2024JG008240", "short_name": "sNIRvNDVILSWIS" }, "sNIRvSWIR": { @@ -4911,7 +4948,7 @@ "Landsat-ETM+", "MODIS" ], - "reference": "https://doi.org/10.22541/essoar.171561872.22414664/v1", + "reference": "https://doi.org/10.1029/2024JG008240", "short_name": "sNIRvSWIR" } } diff --git a/src/indices_funcs.jl b/src/indices_funcs.jl index dc8a5a4..e6ae75c 100644 --- a/src/indices_funcs.jl +++ b/src/indices_funcs.jl @@ -48,6 +48,12 @@ end indices_funcs["MBI"] = MBI_func +function CRI700_func(::Type{TFL}, B, RE1; const1::Number=TFL(1.0), const2::Number=TFL(1.0)) where {TFL <: Number} + return (const1 / B) - (const2 / RE1) +end + +indices_funcs["CRI700"] = CRI700_func + function WRI_func(::Type{TFL}, G, R, N, S1) where {TFL <: Number} return (G + R)/(N + S1) end @@ -264,6 +270,12 @@ end indices_funcs["NDBaI"] = NDBaI_func +function CRI550_func(::Type{TFL}, B, G; const1::Number=TFL(1.0), const2::Number=TFL(1.0)) where {TFL <: Number} + return (const1 / B) - (const2 / G) +end + +indices_funcs["CRI550"] = CRI550_func + function SAVIT_func(::Type{TFL}, L, N, R, T; const1::Number=TFL(1.0), const2::Number=TFL(10000.0), const3::Number=TFL(10000.0)) where {TFL <: Number} return (const1 + L) * (N - (R * T / const2)) / (N + (R * T / const3) + L) end @@ -1272,18 +1284,18 @@ end indices_funcs["NBRT2"] = NBRT2_func -function DVIplus_func(::Type{TFL}, lambdaN, lambdaR, lambdaG, G, N, R; const1::Number=TFL(1.0)) where {TFL <: Number} - return ((lambdaN - lambdaR)/(lambdaN - lambdaG)) * G + (const1 - ((lambdaN - lambdaR)/(lambdaN - lambdaG))) * N - R -end - -indices_funcs["DVIplus"] = DVIplus_func - function CVI_func(::Type{TFL}, N, R, G; const1::Number=TFL(2.0)) where {TFL <: Number} return (N * R) / (G ^ const1) end indices_funcs["CVI"] = CVI_func +function DVIplus_func(::Type{TFL}, lambdaN, lambdaR, lambdaG, G, N, R; const1::Number=TFL(1.0)) where {TFL <: Number} + return ((lambdaN - lambdaR)/(lambdaN - lambdaG)) * G + (const1 - ((lambdaN - lambdaR)/(lambdaN - lambdaG))) * N - R +end + +indices_funcs["DVIplus"] = DVIplus_func + function RI4XS_func(::Type{TFL}, R, G; const1::Number=TFL(2.0), const2::Number=TFL(4.0)) where {TFL <: Number} return (R^const1)/(G^const2) end