Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
oeigner
LINK - Forschungsprojekt Repo
Commits
0e592828
Commit
0e592828
authored
Jun 22, 2021
by
ds191008
Browse files
[i] 1/tan faster than cos/sin
parent
91636621
Changes
1
Hide whitespace changes
Inline
Side-by-side
FHSTP/prep.py
View file @
0e592828
...
...
@@ -189,10 +189,10 @@ def utm_to_lambert(lon: np.array, lat: np.array) -> tuple:
# lambert conformal conic projection:
# --> see https://mathworld.wolfram.com/LambertConformalConicProjection.html
n
=
np
.
log
(
np
.
cos
(
lat1
)
*
(
1
/
np
.
cos
(
lat2
)))
/
np
.
log
(
np
.
tan
(
np
.
pi
/
4
+
lat2
/
2
)
*
(
np
.
cos
(
np
.
pi
/
4
+
lat1
/
2
)
/
np
.
si
n
(
np
.
pi
/
4
+
lat1
/
2
)))
n
=
np
.
log
(
np
.
cos
(
lat1
)
*
(
1
/
np
.
cos
(
lat2
)))
/
np
.
log
(
np
.
tan
(
np
.
pi
/
4
+
lat2
/
2
)
*
(
1
/
np
.
ta
n
(
np
.
pi
/
4
+
lat1
/
2
)))
F
=
(
np
.
cos
(
lat1
)
*
np
.
tan
(
np
.
pi
/
4
+
lat1
/
2
)
**
n
)
/
n
p
=
R
*
F
*
(
np
.
cos
(
np
.
pi
/
4
+
lat
/
2
)
/
np
.
si
n
(
np
.
pi
/
4
+
lat
/
2
))
**
n
p0
=
R
*
F
*
(
np
.
cos
(
np
.
pi
/
4
+
lat0
/
2
)
/
np
.
si
n
(
np
.
pi
/
4
+
lat0
/
2
))
**
n
p
=
R
*
F
*
(
1
/
np
.
ta
n
(
np
.
pi
/
4
+
lat
/
2
))
**
n
p0
=
R
*
F
*
(
1
/
np
.
ta
n
(
np
.
pi
/
4
+
lat0
/
2
))
**
n
# calculate lambert conic conformal x and y
x
=
p
*
np
.
sin
(
n
*
(
lon
-
lon0
))
+
x0
...
...
@@ -386,6 +386,11 @@ def prep() -> None:
_log
(
'Converted BEGINTIME to UTC'
)
# only use transmissions with begintime matching INCA date
date_inca
=
np
.
datetime64
(
f
'
{
str
(
dir_inca
.
stem
)[
0
:
4
]
}
-
{
str
(
dir_inca
.
stem
)[
-
4
:
-
2
]
}
-
{
str
(
dir_inca
.
stem
)[
-
2
:
]
}
'
)
df_link
=
df_link
[
df_link
[
'BEGINTIME'
].
dt
.
date
==
date_inca
]
_log
(
'Filtered transmissions to match BEGINTIME with INCA date'
)
# copy REMOTERXLEVEL to PMIN and PMAX (for aggregation in 15min window conversion)
df_link
[
'PMIN'
]
=
df_link
[
'REMOTERXLEVEL'
]
df_link
[
'PMAX'
]
=
df_link
[
'REMOTERXLEVEL'
]
...
...
@@ -457,7 +462,7 @@ def prep() -> None:
# load inca data
inca_data
=
load_inca_data
(
dir_inca
)
_log
(
f
'Loaded INCA data from
{
str
(
dir_inca
).
split
(
"/"
)[
-
1
]
}
'
)
_log
(
f
'Loaded INCA data from
{
str
(
dir_inca
).
split
(
"/"
)[
-
1
]
}
with shape
{
inca_data
.
shape
}
'
)
# set INCA RR data based on datetime and coordinates
df_link
[
'RRStart'
]
=
get_inca_data
(
inca_data
,
df_link
[
'DateTime'
],
df_link
[
'XStart'
],
df_link
[
'YStart'
])
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment