Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ags_grabber
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bryson Howell
ags_grabber
Commits
7bd7dbc1
Commit
7bd7dbc1
authored
Jul 31, 2024
by
Bryson Howell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small update to recenter on IPP
parent
32abb9df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
lpm_hikersim.py
lpm_hikersim.py
+17
-3
No files found.
lpm_hikersim.py
View file @
7bd7dbc1
...
...
@@ -5,6 +5,7 @@ import os, sys, inspect
from
os
import
path
,
getcwd
import
pandas
as
pd
#Add parent directory to path, where LPM code is
currentdir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
inspect
.
getfile
(
inspect
.
currentframe
())))
parentdir
=
os
.
path
.
dirname
(
currentdir
)
sys
.
path
.
insert
(
0
,
parentdir
)
...
...
@@ -40,7 +41,8 @@ def main(exp_name='test', start_idx=0, n_envs=1, n_iter=10):
#Calculate cells from extent
scale_factor
=
3
/
20
# factor to get 6.66667m mapping from 1m mapping (1/6.6667)
extent
=
np
.
ceil
(
scale_factor
*
download_extent
)
.
astype
(
np
.
int32
)
test_extent
=
np
.
ceil
(
scale_factor
*
test_extent
)
.
astype
(
np
.
int32
)
download_extent
=
np
.
ceil
(
scale_factor
*
download_extent
)
.
astype
(
np
.
int32
)
for
i
in
range
(
start_idx
,
end_idx
):
...
...
@@ -49,7 +51,7 @@ def main(exp_name='test', start_idx=0, n_envs=1, n_iter=10):
i_area
=
np
.
transpose
(
i_area
)[
0
]
#test - print start / end locations on grid
grid
=
np
.
zeros
((
3000
,
3000
),
dtype
=
np
.
int8
())
grid
=
np
.
zeros
((
extent
,
extent
),
dtype
=
np
.
int8
())
for
incident
in
range
(
0
,
len
(
i_area
)):
#Dealing with large areas. Find the IPP point and resize around it
...
...
@@ -64,6 +66,18 @@ def main(exp_name='test', start_idx=0, n_envs=1, n_iter=10):
cur_ipp
=
ipp_latlons
[
i_area
[
incident
+
subzone
]]
ipp_xy
=
lat_lon2meters
(
cur_ipp
[
0
],
cur_ipp
[
1
])
print
(
cur_ipp
)
#Distance calculation
x_dist
=
cur_ipp
[
0
]
-
sub_center
[
0
]
y_dist
=
cur_ipp
[
1
]
-
sub_center
[
1
]
x_index
=
np
.
ceil
(
0.5
*
extent
+
scale_factor
*
x_dist
)
.
astype
(
np
.
int32
)
y_index
=
np
.
ceil
(
0.5
*
extent
+
scale_factor
*
y_dist
)
.
astype
(
np
.
int32
)
if
(
x_index
>=
extent
or
y_index
>=
extent
or
x_index
)
#Grab subset of big grid
sub_grid
=
#Locate find position from IPP
#Convert both to meters
#Use extent / cell count to determine which cell we're in:
...
...
@@ -166,7 +180,7 @@ def main(exp_name='test', start_idx=0, n_envs=1, n_iter=10):
if
__name__
==
"__main__"
:
start
=
0
#Environment to start at (0 is first, 8 is first large map)
start
=
8
#Environment to start at (0 is first, 8 is first large map)
n
=
1
#Number of environments to test
mc
=
10
#Monte Carlo iterations
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment