Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3io.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
common
KM3io.jl
Commits
a8b449e8
Verified
Commit
a8b449e8
authored
1 month ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add LonLatExtended
parent
2dd781a7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/exports.jl
+1
-0
1 addition, 0 deletions
src/exports.jl
src/tools/coords.jl
+12
-3
12 additions, 3 deletions
src/tools/coords.jl
test/tools.jl
+2
-2
2 additions, 2 deletions
test/tools.jl
with
15 additions
and
5 deletions
src/exports.jl
+
1
−
0
View file @
a8b449e8
...
...
@@ -121,6 +121,7 @@ MCEventMatcher,
SummarysliceIntervalIterator
,
getevent
,
LonLat
,
# TODO: move this to types?
LonLatExtended
,
# TODO: move this to types?
lonlat
,
isnorthern
,
...
...
This diff is collapsed.
Click to expand it.
src/tools/coords.jl
+
12
−
3
View file @
a8b449e8
...
...
@@ -4,6 +4,15 @@ A position in longitude and latitude.
struct
LonLat
lon
::
Float64
lat
::
Float64
end
"""
A position in longitude and latitude including the point scale factor and the meridian
convergence angle.
"""
struct
LonLatExtended
lon
::
Float64
lat
::
Float64
point_scale_factor
::
Float64
meridian_convergence
::
Float64
end
...
...
@@ -18,7 +27,7 @@ which were originally derived by Johann Heinrich Louis Krüger in 1912.
millimeter within 3000 km of the central meridian.
"""
function
lonlat
end
function
lonlat
(
utm
::
UTMPosition
)
::
LonLat
function
lonlat
(
utm
::
UTMPosition
)
::
LonLat
Extended
N
=
utm
.
northing
/
1000
E
=
utm
.
easting
/
1000
hemi
=
isnorthern
(
utm
)
?
+
1
:
-
1
...
...
@@ -65,7 +74,7 @@ function lonlat(utm::UTMPosition)::LonLat
k
=
k₀
*
A
/
a
*
√
(
(
1
+
((
1
-
n
)
/
(
1
+
n
))
*
tan
(
ϕ
))
^
2
*
(
cos
(
ξ′
)
^
2
+
sinh
(
η′
)
^
2
)
/
(
σ′
^
2
+
τ′
^
2
)
)
# meridian convergence
γ
=
hemi
*
atan
(
(
τ′
+
σ′
*
tan
(
ξ′
)
*
tanh
(
η′
))
/
(
σ′
+
τ′
*
tan
(
ξ′
)
*
tanh
(
η′
))
)
return
LonLat
(
λ
,
ϕ
,
k
,
γ
)
return
LonLat
Extended
(
λ
,
ϕ
,
k
,
γ
)
end
lonlat
(
d
::
Detector
;
kwargs
...
)
=
lonlat
(
d
.
pos
;
kwargs
...
)
...
...
@@ -114,5 +123,5 @@ function lonlat_aanet(utm::UTMPosition)::LonLat
longitude
=
((
δ
*
(
180.0
/
π
))
+
s
)
+
diflon
latitude
=
((
lat
+
(
1
+
e2cuadrada
*
cos
(
lat
)
^
2
-
(
3.0
/
2.0
)
*
e2cuadrada
*
sin
(
lat
)
*
cos
(
lat
)
*
(
tao
-
lat
))
*
(
tao
-
lat
))
*
(
180.0
/
π
))
+
diflat
return
LonLat
(
longitude
*
π
/
180
,
latitude
*
π
/
180
,
0
,
0
)
return
LonLat
(
longitude
*
π
/
180
,
latitude
*
π
/
180
)
end
This diff is collapsed.
Click to expand it.
test/tools.jl
+
2
−
2
View file @
a8b449e8
...
...
@@ -341,8 +341,8 @@ end
end
@testset
"coords"
begin
@test
LonLat
(
0.2788259891652955
,
0.6334183919376817
,
1.3971407689009945
,
0.010078736515781934
)
==
lonlat
(
Detector
(
datapath
(
"detx"
,
"KM3NeT_00000133_20221025.detx"
)))
@test
LonLat
(
0.2788259891652955
,
0.6334183919376817
,
1.3971407689009945
,
0.010078736515781934
)
==
lonlat
(
Detector
(
datapath
(
"datx"
,
"KM3NeT_00000133_20221025.datx"
)))
@test
LonLat
Extended
(
0.2788259891652955
,
0.6334183919376817
,
1.3971407689009945
,
0.010078736515781934
)
==
lonlat
(
Detector
(
datapath
(
"detx"
,
"KM3NeT_00000133_20221025.detx"
)))
@test
LonLat
Extended
(
0.2788259891652955
,
0.6334183919376817
,
1.3971407689009945
,
0.010078736515781934
)
==
lonlat
(
Detector
(
datapath
(
"datx"
,
"KM3NeT_00000133_20221025.datx"
)))
@test
isnorthern
(
UTMPosition
(
1
,
2
,
3
,
'N'
,
0.0
))
@test
!
isnorthern
(
UTMPosition
(
1
,
2
,
3
,
'D'
,
0.0
))
end
...
...
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