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
3e8bfbf7
Commit
3e8bfbf7
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
updates for icing intensity
parent
576a1600
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/pireps.py
+5
-9
5 additions, 9 deletions
modules/icing/pireps.py
with
5 additions
and
9 deletions
modules/icing/pireps.py
+
5
−
9
View file @
3e8bfbf7
...
@@ -17,15 +17,13 @@ ATYPE = '/TP'
...
@@ -17,15 +17,13 @@ ATYPE = '/TP'
RMK
=
'
/RM
'
RMK
=
'
/RM
'
# Returns icing/n
on
-icing
# Returns icing/n
eg
-icing
def
pirep_icing
(
filename
,
lon_range
=
[
-
180
,
180
],
lat_range
=
[
-
55
,
55
]):
def
pirep_icing
(
filename
,
lon_range
=
[
-
180
,
180
],
lat_range
=
[
-
55
,
55
]):
no_ice_reports
=
[]
ice_reports
=
[]
# HEADER: VALID,URGENT,AIRCRAFT,REPORT,LAT,LON
# HEADER: VALID,URGENT,AIRCRAFT,REPORT,LAT,LON
ice_dict
=
{}
ice_dict
=
{}
n
o
_ice_dict
=
{}
n
eg
_ice_dict
=
{}
with
open
(
filename
)
as
file
:
with
open
(
filename
)
as
file
:
for
idx
,
line
in
enumerate
(
file
):
for
idx
,
line
in
enumerate
(
file
):
...
@@ -76,17 +74,15 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
...
@@ -76,17 +74,15 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
timestmp
=
dto
.
timestamp
()
timestmp
=
dto
.
timestamp
()
if
len
(
re
.
findall
(
NO_ICE
,
ice_str
))
!=
0
:
if
len
(
re
.
findall
(
NO_ICE
,
ice_str
))
!=
0
:
no_ice_reports
.
append
(
ice_str
)
rpts
=
neg_ice_dict
.
get
(
timestmp
)
rpts
=
no_ice_dict
.
get
(
timestmp
)
tup
=
(
lat
,
lon
,
fl
,
ice_str
)
tup
=
(
lat
,
lon
,
fl
,
ice_str
)
if
rpts
is
None
:
if
rpts
is
None
:
rpts
=
[]
rpts
=
[]
rpts
.
append
(
tup
)
rpts
.
append
(
tup
)
n
o
_ice_dict
[
timestmp
]
=
rpts
n
eg
_ice_dict
[
timestmp
]
=
rpts
else
:
else
:
rpts
.
append
(
tup
)
rpts
.
append
(
tup
)
else
:
else
:
ice_reports
.
append
(
ice_str
)
so
=
re
.
search
(
ICE_LVL
,
ice_str
)
so
=
re
.
search
(
ICE_LVL
,
ice_str
)
if
so
is
not
None
:
if
so
is
not
None
:
lvl_a
,
lvl_b
=
so
.
group
().
split
(
'
-
'
)
lvl_a
,
lvl_b
=
so
.
group
().
split
(
'
-
'
)
...
@@ -137,4 +133,4 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
...
@@ -137,4 +133,4 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
else
:
else
:
rpts
.
append
(
tup
)
rpts
.
append
(
tup
)
return
ice_dict
,
n
o
_ice_dict
return
ice_dict
,
n
eg
_ice_dict
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