Skip to content

Commit

Permalink
conforming list to asi
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinuzziFrancesco committed Dec 17, 2024
1 parent 5b02810 commit 38c0433
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 13 deletions.
51 changes: 44 additions & 7 deletions data/spectral-indices-dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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"
}
}
Expand Down
24 changes: 18 additions & 6 deletions src/indices_funcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 38c0433

Please sign in to comment.