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
c540dce3
Commit
c540dce3
authored
9 months ago
by
Narayanarao Bhogapurapu
Browse files
Options
Downloads
Patches
Plain Diff
before profiling
parent
f9c19b34
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ich/__pycache__/algo.cpython-310.pyc
+0
-0
0 additions, 0 deletions
src/ich/__pycache__/algo.cpython-310.pyc
src/ich/algo.py
+10
-3
10 additions, 3 deletions
src/ich/algo.py
with
10 additions
and
3 deletions
src/ich/__pycache__/algo.cpython-310.pyc
+
0
−
0
View file @
c540dce3
No preview for this file type
This diff is collapsed.
Click to expand it.
src/ich/algo.py
+
10
−
3
View file @
c540dce3
...
@@ -219,6 +219,7 @@ def cal_(temp_cor, temp_gedi, htl, htg):
...
@@ -219,6 +219,7 @@ def cal_(temp_cor, temp_gedi, htl, htg):
result
=
np
.
array
(
result
)
result
=
np
.
array
(
result
)
tempdf
=
pd
.
DataFrame
(
data
=
{
'
N
'
:
result
[:,
0
],
'
S
'
:
result
[:,
1
],
'
C
'
:
result
[:,
2
],
tempdf
=
pd
.
DataFrame
(
data
=
{
'
N
'
:
result
[:,
0
],
'
S
'
:
result
[:,
1
],
'
C
'
:
result
[:,
2
],
'
r
'
:
result
[:,
3
],
'
rmse
'
:
result
[:,
4
]})
'
r
'
:
result
[:,
3
],
'
rmse
'
:
result
[:,
4
]})
del
result
tempdf
.
dropna
(
subset
=
[
'
rmse
'
],
inplace
=
True
)
tempdf
.
dropna
(
subset
=
[
'
rmse
'
],
inplace
=
True
)
if
nn
>
6
:
if
nn
>
6
:
tempdf
=
tempdf
[
tempdf
[
'
N
'
]
>
3
].
sort_values
(
by
=
[
'
rmse
'
],
ascending
=
True
)
tempdf
=
tempdf
[
tempdf
[
'
N
'
]
>
3
].
sort_values
(
by
=
[
'
rmse
'
],
ascending
=
True
)
...
@@ -261,6 +262,7 @@ def process_block(i, j, cohArray, lidarArray, initial_ws, htl, htg, parm_):
...
@@ -261,6 +262,7 @@ def process_block(i, j, cohArray, lidarArray, initial_ws, htl, htg, parm_):
if
np
.
all
(
np
.
array
(
parm
)
==
0
):
if
np
.
all
(
np
.
array
(
parm
)
==
0
):
parm
=
parm_
.
copy
()
parm
=
parm_
.
copy
()
del
parm_
if
lidarBlock
.
shape
[
0
]
*
lidarBlock
.
shape
[
1
]
>
initial_ws
*
initial_ws
:
if
lidarBlock
.
shape
[
0
]
*
lidarBlock
.
shape
[
1
]
>
initial_ws
*
initial_ws
:
# mask[np.shape(mask)[0]//2,np.shape(mask)[1]//2]=1
# mask[np.shape(mask)[0]//2,np.shape(mask)[1]//2]=1
np
.
fill_diagonal
(
mask
,
1
)
np
.
fill_diagonal
(
mask
,
1
)
...
@@ -277,6 +279,7 @@ def process_block(i, j, cohArray, lidarArray, initial_ws, htl, htg, parm_):
...
@@ -277,6 +279,7 @@ def process_block(i, j, cohArray, lidarArray, initial_ws, htl, htg, parm_):
# ht = arc_sinc_fast(gama, parm[2]) * mask
# ht = arc_sinc_fast(gama, parm[2]) * mask
# print(lidarBlock.shape)
# print(lidarBlock.shape)
del
lidarBlock
,
cohBlock
del
lidarBlock
,
cohBlock
gc
.
collect
()
return
start_i
,
end_i
,
start_j
,
end_j
,
s_parm
,
c_parm
,
rmse_parm
,
ht
,
count
return
start_i
,
end_i
,
start_j
,
end_j
,
s_parm
,
c_parm
,
rmse_parm
,
ht
,
count
else
:
else
:
S
+=
2
S
+=
2
...
@@ -316,8 +319,10 @@ def dynamicWindow(cohArray, lidarArray, initial_ws, htl, htg, batch_size=10):
...
@@ -316,8 +319,10 @@ def dynamicWindow(cohArray, lidarArray, initial_ws, htl, htg, batch_size=10):
if
block_i
<
rows
and
block_j
<
cols
:
if
block_i
<
rows
and
block_j
<
cols
:
batch_futures
.
append
((
block_i
,
block_j
))
batch_futures
.
append
((
block_i
,
block_j
))
# Submit the batch as a single task
future
=
executor
.
submit
(
process_batch
,
batch_futures
,
cohArray
,
lidarArray
,
initial_ws
,
htl
,
htg
,
parm_
)
futures
.
append
(
executor
.
submit
(
process_batch
,
batch_futures
,
cohArray
,
lidarArray
,
initial_ws
,
htl
,
htg
,
parm_
))
futures
.
append
(
future
)
del
future
,
batch_futures
# Initialize the progress bar with the total number of futures
# Initialize the progress bar with the total number of futures
with
tqdm
(
total
=
len
(
futures
))
as
pbar
:
with
tqdm
(
total
=
len
(
futures
))
as
pbar
:
...
@@ -336,6 +341,8 @@ def dynamicWindow(cohArray, lidarArray, initial_ws, htl, htg, batch_size=10):
...
@@ -336,6 +341,8 @@ def dynamicWindow(cohArray, lidarArray, initial_ws, htl, htg, batch_size=10):
pbar
.
update
(
1
)
pbar
.
update
(
1
)
del
results
,
future
del
results
,
future
gc
.
collect
()
gc
.
collect
()
# Clear the futures list to prevent accumulation
futures
.
clear
()
return
s_parm
,
c_parm
,
rmse_parm
,
ht_
,
count
return
s_parm
,
c_parm
,
rmse_parm
,
ht_
,
count
...
@@ -346,7 +353,7 @@ def process_batch(batch_futures, cohArray, lidarArray, initial_ws, htl, htg, par
...
@@ -346,7 +353,7 @@ def process_batch(batch_futures, cohArray, lidarArray, initial_ws, htl, htg, par
start_i
,
end_i
,
start_j
,
end_j
,
s_p
,
c_p
,
r_p
,
ht
,
cnt
=
process_block
(
block_i
,
block_j
,
cohArray
,
lidarArray
,
initial_ws
,
htl
,
htg
,
parm_
)
start_i
,
end_i
,
start_j
,
end_j
,
s_p
,
c_p
,
r_p
,
ht
,
cnt
=
process_block
(
block_i
,
block_j
,
cohArray
,
lidarArray
,
initial_ws
,
htl
,
htg
,
parm_
)
results
.
append
((
start_i
,
end_i
,
start_j
,
end_j
,
s_p
,
c_p
,
r_p
,
ht
,
cnt
))
results
.
append
((
start_i
,
end_i
,
start_j
,
end_j
,
s_p
,
c_p
,
r_p
,
ht
,
cnt
))
# Invoke garbage collection
# Invoke garbage collection
#
gc.collect()
gc
.
collect
()
return
results
return
results
...
...
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