Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
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
Tom Rink
python
Commits
dbe1cf8a
Commit
dbe1cf8a
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
dd9ee35b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/icing/pirep_goes.py
+3
-17
3 additions, 17 deletions
modules/icing/pirep_goes.py
with
3 additions
and
17 deletions
modules/icing/pirep_goes.py
+
3
−
17
View file @
dbe1cf8a
...
...
@@ -407,7 +407,7 @@ def process_2(ice_dct, no_ice_dct, neg_ice_dct):
ice_keys
=
np
.
concatenate
([
ice_keys_5_6
,
ice_keys_1
,
ice_keys_2
,
ice_keys_3
,
ice_keys_4
])
uniq_sorted_keys
=
np
.
unique
(
ice_keys
)
print
(
ice_keys
.
shape
,
uniq_sorted_keys
.
shape
)
print
(
'
ice:
'
,
ice_keys
.
shape
,
uniq_sorted_keys
.
shape
)
uniq_sorted_keys
=
uniq_sorted_keys
.
tolist
()
for
key
in
uniq_sorted_keys
:
...
...
@@ -418,7 +418,7 @@ def process_2(ice_dct, no_ice_dct, neg_ice_dct):
np
.
random
.
shuffle
(
no_ice_keys
)
no_ice_keys
=
no_ice_keys
[
0
:
50000
]
uniq_sorted_no_ice
=
np
.
unique
(
no_ice_keys
)
print
(
no_ice_keys
.
shape
,
uniq_sorted_no_ice
.
shape
)
print
(
'
no ice:
'
,
no_ice_keys
.
shape
,
uniq_sorted_no_ice
.
shape
)
uniq_sorted_no_ice
=
uniq_sorted_no_ice
.
tolist
()
for
key
in
uniq_sorted_no_ice
:
...
...
@@ -429,7 +429,7 @@ def process_2(ice_dct, no_ice_dct, neg_ice_dct):
np
.
random
.
shuffle
(
neg_ice_keys
)
neg_ice_keys
=
neg_ice_keys
[
0
:
5000
]
uniq_sorted_neg_ice
=
np
.
unique
(
neg_ice_keys
)
print
(
neg_ice_keys
.
shape
,
uniq_sorted_neg_ice
.
shape
)
print
(
'
neg ice:
'
,
neg_ice_keys
.
shape
,
uniq_sorted_neg_ice
.
shape
)
for
key
in
uniq_sorted_neg_ice
:
new_neg_ice_dct
[
key
]
=
neg_ice_dct
[
key
]
...
...
@@ -460,13 +460,10 @@ def process_1(ice_dct, no_ice_dct, neg_ice_dct):
ice_keys_2
=
[]
print
(
'
num keys ice, no_ice, neg_ice:
'
,
len
(
ice_dct
),
len
(
no_ice_dct
),
len
(
neg_ice_dct
))
nfound
=
0
for
ts
in
list
(
ice_dct
.
keys
()):
try
:
ds
=
get_goes_datasource
(
ts
)
goes_file
,
t_0
,
_
=
ds
.
get_file
(
ts
)
if
goes_file
is
not
None
:
nfound
+=
1
if
goes_file
is
not
None
and
goes_file
!=
last_file
:
rpts
=
ice_dct
[
ts
]
for
tup
in
rpts
:
...
...
@@ -493,19 +490,15 @@ def process_1(ice_dct, no_ice_dct, neg_ice_dct):
last_file
=
goes_file
except
Exception
:
continue
print
(
'
num ice files:
'
,
nfound
)
last_file
=
None
no_ice_files
=
[]
no_ice_times
=
[]
no_ice_keys
=
[]
nfound
=
0
for
ts
in
list
(
no_ice_dct
.
keys
()):
try
:
ds
=
get_goes_datasource
(
ts
)
goes_file
,
t_0
,
_
=
ds
.
get_file
(
ts
)
if
goes_file
is
not
None
:
nfound
+=
1
if
goes_file
is
not
None
and
goes_file
!=
last_file
:
rpts
=
no_ice_dct
[
ts
]
for
tup
in
rpts
:
...
...
@@ -516,19 +509,14 @@ def process_1(ice_dct, no_ice_dct, neg_ice_dct):
except
Exception
:
continue
print
(
'
num no ice files found:
'
,
nfound
)
last_file
=
None
neg_ice_files
=
[]
neg_ice_times
=
[]
neg_ice_keys
=
[]
nfound
=
0
for
ts
in
list
(
neg_ice_dct
.
keys
()):
try
:
ds
=
get_goes_datasource
(
ts
)
goes_file
,
t_0
,
_
=
ds
.
get_file
(
ts
)
if
goes_file
is
not
None
:
nfound
+=
1
if
goes_file
is
not
None
and
goes_file
!=
last_file
:
rpts
=
neg_ice_dct
[
ts
]
for
tup
in
rpts
:
...
...
@@ -539,8 +527,6 @@ def process_1(ice_dct, no_ice_dct, neg_ice_dct):
except
Exception
:
continue
print
(
'
num neg ice files found:
'
,
nfound
)
ice_times_5_6
=
np
.
array
(
ice_times_5_6
)
ice_keys_5_6
=
np
.
array
(
ice_keys_5_6
)
print
(
'
5_6:
'
,
ice_times_5_6
.
shape
)
...
...
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