Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Satellite TLE Utilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
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
Max Drexler
Satellite TLE Utilities
Commits
28458fff
Commit
28458fff
authored
2 years ago
by
Max Drexler
Browse files
Options
Downloads
Patches
Plain Diff
reworked visualizer script:
parent
9ca7a813
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/dailyPositionVisualizer.py
+29
-17
29 additions, 17 deletions
bin/dailyPositionVisualizer.py
with
29 additions
and
17 deletions
bin/dailyPositionVisualizer.py
+
29
−
17
View file @
28458fff
...
@@ -13,23 +13,19 @@ except ImportError as e:
...
@@ -13,23 +13,19 @@ except ImportError as e:
print
(
"
Numpy is needed to generate graphs
"
)
print
(
"
Numpy is needed to generate graphs
"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
SAT_ROW
=
0
def
init_plot
():
YEAR_ROW
=
1
plt
.
ylabel
(
'
Year
'
)
DAY_ROW
=
2
plt
.
xlabel
(
'
Longitude
'
)
SUBPOINT_LON_ROW
=
3
plt
.
title
(
'
Geostationary Equator Coverage
'
)
SUBPOINT_LAT_ROW
=
4
plt
.
figure
().
set_figheight
(
15
)
def
genData
(
data
):
plt
.
xlim
(
-
180
,
180
)
x_vals
=
np
.
char
.
partition
(
data
[:,
SUBPOINT_LAT_ROW
],
'
:
'
)[:,
0
].
astype
(
'
float
'
)
def
addPlot
(
subptPath
):
data
=
np
.
loadtxt
(
subptPath
,
dtype
=
'
str
'
)
x_vals
=
np
.
char
.
partition
(
data
[:,
2
],
'
:
'
)[:,
0
].
astype
(
'
float
'
)
heights
=
np
.
full_like
(
data
[:,
0
],
1
/
365
,
dtype
=
'
float
'
)
heights
=
np
.
full_like
(
data
[:,
0
],
1
/
365
,
dtype
=
'
float
'
)
widths
=
np
.
full_like
(
data
[:,
0
],
60
,
dtype
=
'
float
'
)
widths
=
np
.
full_like
(
data
[:,
0
],
60
,
dtype
=
'
float
'
)
bottoms
=
np
.
add
([
int
(
x
[:
4
])
for
x
in
data
[:,
0
]],[
int
(
x
[
4
:])
/
365
for
x
in
data
[:,
0
]])
bottoms
=
np
.
add
([
int
(
x
)
for
x
in
data
[:,
YEAR_ROW
]],[
int
(
x
)
/
365
for
x
in
data
[:,
DAY_ROW
]])
plt
.
bar
(
x_vals
,
heights
,
width
=
widths
,
bottom
=
bottoms
)
return
(
x_vals
,
heights
,
widths
,
bottoms
)
def
main
(
argv
):
def
main
(
argv
):
parser
=
argparse
.
ArgumentParser
(
description
=
'
A utility that visualizes daily positions of satellites
'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'
A utility that visualizes daily positions of satellites
'
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
'
store_true
'
,
help
=
'
programs verbocity
'
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
'
store_true
'
,
help
=
'
programs verbocity
'
)
...
@@ -38,9 +34,25 @@ def main(argv):
...
@@ -38,9 +34,25 @@ def main(argv):
args
=
parser
.
parse_args
(
argv
)
args
=
parser
.
parse_args
(
argv
)
init_plot
()
plt
.
ylabel
(
'
Year
'
)
plt
.
xlabel
(
'
Longitude
'
)
plt
.
title
(
'
Geostationary Equator Coverage
'
)
plt
.
figure
().
set_figheight
(
15
)
plt
.
xlim
(
-
180
,
180
)
min_date
=
9999999
max_date
=
-
9999999
plot_list
=
[]
for
subpt
in
args
.
list
:
for
subpt
in
args
.
list
:
addPlot
(
subpt
)
data
=
np
.
loadtxt
(
subpt
,
dtype
=
'
str
'
)
min_date
=
min
(
min_date
,
int
(
data
[
0
][
1
]))
max_date
=
max
(
max_date
,
int
(
data
[
-
1
][
1
]))
plot_list
.
append
(
genData
(
data
))
plt
.
ylim
(
min_date
,
max_date
)
for
dat
in
plot_list
:
plt
.
bar
(
dat
[
0
],
dat
[
1
],
width
=
dat
[
2
],
bottom
=
dat
[
3
])
plt
.
savefig
(
os
.
path
.
join
(
args
.
outdir
,
args
.
list
[
0
]
+
'
.png
'
))
plt
.
savefig
(
os
.
path
.
join
(
args
.
outdir
,
args
.
list
[
0
]
+
'
.png
'
))
...
...
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