Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
InSAR_forest_height
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Narayanarao Bhogapurapu
InSAR_forest_height
Commits
201ba448
Commit
201ba448
authored
8 months ago
by
Narayanarao Bhogapurapu
Browse files
Options
Downloads
Patches
Plain Diff
0.5.1
parent
00f5d49a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
algorithm_config.yaml
+1
-1
1 addition, 1 deletion
algorithm_config.yaml
ich.sh
+2
-0
2 additions, 0 deletions
ich.sh
src/ich/InSAR_canopy_height.py
+2
-3
2 additions, 3 deletions
src/ich/InSAR_canopy_height.py
src/ich/args_in.py
+10
-4
10 additions, 4 deletions
src/ich/args_in.py
with
15 additions
and
8 deletions
algorithm_config.yaml
+
1
−
1
View file @
201ba448
description
:
Estimates canopy height from InSAR coherence and LiDAR data
description
:
Estimates canopy height from InSAR coherence and LiDAR data
algo_name
:
ich
algo_name
:
ich
version
:
0.5
version
:
0.5
.1
environment
:
ubuntu
environment
:
ubuntu
repository_url
:
https://repo.maap-project.org/bnarayanarao/insar_forest_height.git
repository_url
:
https://repo.maap-project.org/bnarayanarao/insar_forest_height.git
docker_url
:
mas.maap-project.org/root/maap-workspaces/base_images/python:v4.1.0
docker_url
:
mas.maap-project.org/root/maap-workspaces/base_images/python:v4.1.0
...
...
This diff is collapsed.
Click to expand it.
ich.sh
+
2
−
0
View file @
201ba448
...
@@ -20,6 +20,8 @@ options=()
...
@@ -20,6 +20,8 @@ options=()
[[
"
${
2
:-}
"
!=
"-"
]]
&&
options+
=(
"--upper_limit"
"
${
2
}
"
)
[[
"
${
2
:-}
"
!=
"-"
]]
&&
options+
=(
"--upper_limit"
"
${
2
}
"
)
[[
"
${
3
:-}
"
!=
"-"
]]
&&
options+
=(
"--window"
"
${
3
}
"
)
[[
"
${
3
:-}
"
!=
"-"
]]
&&
options+
=(
"--window"
"
${
3
}
"
)
[[
"
${
4
:-}
"
!=
"-"
]]
&&
options+
=(
"--validation"
"
${
4
}
"
)
[[
"
${
4
:-}
"
!=
"-"
]]
&&
options+
=(
"--validation"
"
${
4
}
"
)
[[
"
${
5
:-}
"
!=
"-"
]]
&&
options+
=(
"--algorithm"
"
${
5
}
"
)
[[
"
${
6
:-}
"
!=
"-"
]]
&&
options+
=(
"--overlap"
"
${
6
}
"
)
# Run the Python script with the determined options
# Run the Python script with the determined options
${
ich_py
}
--correlationFile
"
${
correlationFile
}
"
--cal_ht
"
${
cal_ht
}
"
"
${
options
[@]
}
"
${
ich_py
}
--correlationFile
"
${
correlationFile
}
"
--cal_ht
"
${
cal_ht
}
"
"
${
options
[@]
}
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/ich/InSAR_canopy_height.py
+
2
−
3
View file @
201ba448
...
@@ -37,14 +37,13 @@ parser = argparse.ArgumentParser()
...
@@ -37,14 +37,13 @@ parser = argparse.ArgumentParser()
parser
.
add_argument
(
"
-c
"
,
"
--correlationFile
"
,
dest
=
"
corFile
"
,
help
=
"
correlation file [0,1]
"
)
parser
.
add_argument
(
"
-c
"
,
"
--correlationFile
"
,
dest
=
"
corFile
"
,
help
=
"
correlation file [0,1]
"
)
parser
.
add_argument
(
"
-l
"
,
"
--cal_ht
"
,
dest
=
"
lidarFile
"
,
help
=
"
Calibration height file e.g. LiDAR heights in (m)
"
)
parser
.
add_argument
(
"
-l
"
,
"
--cal_ht
"
,
dest
=
"
lidarFile
"
,
help
=
"
Calibration height file e.g. LiDAR heights in (m)
"
)
parser
.
add_argument
(
"
-ll
"
,
"
--lower_limit
"
,
dest
=
"
htl
"
,
default
=
0
,
help
=
"
lower limit of canopy height (m)
"
,
type
=
int
)
parser
.
add_argument
(
"
-ll
"
,
"
--lower_limit
"
,
dest
=
"
htl
"
,
default
=
None
,
help
=
"
lower limit of canopy height (m)
"
,
type
=
int
)
parser
.
add_argument
(
"
-ul
"
,
"
--upper_limit
"
,
dest
=
"
htg
"
,
default
=
40
,
help
=
"
upper limit of canopy height (m)
"
,
type
=
int
)
parser
.
add_argument
(
"
-ul
"
,
"
--upper_limit
"
,
dest
=
"
htg
"
,
default
=
None
,
help
=
"
upper limit of canopy height (m)
"
,
type
=
int
)
parser
.
add_argument
(
"
-w
"
,
"
--window
"
,
dest
=
"
window_size
"
,
default
=
10
,
help
=
"
Size
"
,
type
=
int
)
parser
.
add_argument
(
"
-w
"
,
"
--window
"
,
dest
=
"
window_size
"
,
default
=
10
,
help
=
"
Size
"
,
type
=
int
)
parser
.
add_argument
(
"
-val
"
,
"
--validation
"
,
dest
=
"
validation
"
,
default
=
0
,
help
=
"
fraction to split cross validation
"
,
type
=
float
)
parser
.
add_argument
(
"
-val
"
,
"
--validation
"
,
dest
=
"
validation
"
,
default
=
0
,
help
=
"
fraction to split cross validation
"
,
type
=
float
)
parser
.
add_argument
(
"
-al
"
,
"
--algorithm
"
,
dest
=
"
algo
"
,
default
=
1
,
help
=
"
Algorithm Type
"
,
type
=
int
)
parser
.
add_argument
(
"
-al
"
,
"
--algorithm
"
,
dest
=
"
algo
"
,
default
=
1
,
help
=
"
Algorithm Type
"
,
type
=
int
)
parser
.
add_argument
(
"
-ol
"
,
"
--overlap
"
,
dest
=
"
window_overlap
"
,
default
=
0
,
help
=
"
window overlap fraction
"
,
type
=
float
)
parser
.
add_argument
(
"
-ol
"
,
"
--overlap
"
,
dest
=
"
window_overlap
"
,
default
=
0
,
help
=
"
window overlap fraction
"
,
type
=
float
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
...
This diff is collapsed.
Click to expand it.
src/ich/args_in.py
+
10
−
4
View file @
201ba448
...
@@ -75,6 +75,14 @@ def rvog_inverse(args):
...
@@ -75,6 +75,14 @@ def rvog_inverse(args):
lidar_ht
[
lidar_ht
==
0
]
=
np
.
nan
lidar_ht
[
lidar_ht
==
0
]
=
np
.
nan
if
args
.
htl
==
None
and
args
.
htg
==
None
:
"""
Calculating the upper limit of the heights to be estimated from the LiDAR data
Ceiling the upper limit to the closest multiple of 5 for the height at 99.9 percentile
"""
args
.
htl
=
0
pp99
=
np
.
nanpercentile
(
lidar_ht
,
99.9
)
args
.
htg
=
int
(
5
*
np
.
ceil
(
pp99
/
5.
))
lidar_ht
[
lidar_ht
<
args
.
htl
]
=
np
.
nan
lidar_ht
[
lidar_ht
<
args
.
htl
]
=
np
.
nan
lidar_ht
[
lidar_ht
>
args
.
htg
]
=
np
.
nan
lidar_ht
[
lidar_ht
>
args
.
htg
]
=
np
.
nan
cor
[
cor
<
0.1
]
=
np
.
nan
cor
[
cor
<
0.1
]
=
np
.
nan
...
@@ -113,7 +121,8 @@ def rvog_inverse(args):
...
@@ -113,7 +121,8 @@ def rvog_inverse(args):
if
not
os
.
path
.
exists
(
outDir
):
if
not
os
.
path
.
exists
(
outDir
):
os
.
mkdir
(
outDir
)
os
.
mkdir
(
outDir
)
_postfix_str
=
'
_w
'
+
str
(
args
.
window_size
)
+
'
o
'
+
"
%02d
"
%
(
args
.
window_overlap
*
10
)
+
"
_
"
+
str
(
args
.
htl
)
+
str
(
args
.
htg
)
# _postfix_str = '_w'+str(args.window_size)+'o'+"%02d" %(args.window_overlap*10)+"_"+str(args.htl)+str(args.htg)
_postfix_str
=
f
"
_w
{
args
.
window_size
}
_
{
args
.
htl
}
_
{
args
.
htg
}
"
outcFile
=
os
.
path
.
join
(
outDir
,
os
.
path
.
basename
(
corFile
).
split
(
'
.tif
'
)[
0
]
+
_postfix_str
+
'
_c.tif
'
)
outcFile
=
os
.
path
.
join
(
outDir
,
os
.
path
.
basename
(
corFile
).
split
(
'
.tif
'
)[
0
]
+
_postfix_str
+
'
_c.tif
'
)
outsFile
=
os
.
path
.
join
(
outDir
,
os
.
path
.
basename
(
corFile
).
split
(
'
.tif
'
)[
0
]
+
_postfix_str
+
'
_s.tif
'
)
outsFile
=
os
.
path
.
join
(
outDir
,
os
.
path
.
basename
(
corFile
).
split
(
'
.tif
'
)[
0
]
+
_postfix_str
+
'
_s.tif
'
)
...
@@ -410,9 +419,6 @@ def rvog_inverse(args):
...
@@ -410,9 +419,6 @@ def rvog_inverse(args):
s
=
s
*
temp_mask
s
=
s
*
temp_mask
c
=
c
*
temp_mask
c
=
c
*
temp_mask
# c = np.nanmean([sw,c20,c50])
# c = np.nanmean([sw,c20,c50])
else
:
else
:
raise
ValueError
(
'
Invalid algorithm type!
'
)
raise
ValueError
(
'
Invalid algorithm type!
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment