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
fc08fdd3
Commit
fc08fdd3
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
e6197afa
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
modules/icing/pirep_goes.py
+50
-25
50 additions, 25 deletions
modules/icing/pirep_goes.py
with
50 additions
and
25 deletions
modules/icing/pirep_goes.py
+
50
−
25
View file @
fc08fdd3
...
...
@@ -46,10 +46,8 @@ def setup():
def
get_clavrx_datasource
(
timestamp
):
dt_obj
,
time_tup
=
get_time_tuple_utc
(
timestamp
)
date_dir_str
=
dt_obj
.
strftime
(
dir_fmt
)
print
(
dt_obj
)
ds
=
ds_dct
.
get
(
date_dir_str
)
if
ds
is
None
:
print
(
'
new datasource:
'
,
date_dir_str
)
ds
=
CLAVRx
(
clavrx_dir
+
date_dir_str
+
'
/
'
)
ds_dct
[
date_dir_str
]
=
ds
return
ds
...
...
@@ -188,36 +186,63 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
continue
if
time
>
t_end
:
continue
dt_obj
,
time_tup
=
get_time_tuple_utc
(
time
)
print
(
dt_obj
)
try
:
clvr_ds
=
get_clavrx_datasource
(
time
)
except
Exception
:
continue
reports
=
pirep_dct
[
time
]
for
tup
in
reports
:
lat
,
lon
,
fl
,
I
,
id
,
rpt_str
=
tup
lat_s
[
0
]
=
lat
lon_s
[
0
]
=
lon
clvr_file
=
clvr_ds
.
get_file
(
time
)[
0
]
if
clvr_file
is
None
:
continue
print
(
clvr_file
,
last_clvr_file
)
if
clvr_file
!=
last_clvr_file
:
try
:
clvr_ds
=
get_
cl
a
vr
x_datasource
(
time
)
h5f
=
h5py
.
File
(
clvr
_file
,
'
r
'
)
except
Exception
:
if
h5f
is
not
None
:
h5f
.
close
()
print
(
'
Problem with file:
'
,
clvr_file
)
continue
if
last_h5f
is
not
None
:
last_h5f
.
close
()
last_h5f
=
h5f
last_clvr_file
=
clvr_file
print
(
'
new file
'
)
else
:
h5f
=
last_h5f
clvr_file
=
clvr_ds
.
get_file
(
time
)[
0
]
if
clvr_file
is
None
:
continue
reports
=
pirep_dct
[
time
]
for
tup
in
reports
:
lat
,
lon
,
fl
,
I
,
id
,
rpt_str
=
tup
lat_s
[
0
]
=
lat
lon_s
[
0
]
=
lon
if
clvr_file
!=
last_clvr_file
:
try
:
h5f
=
h5py
.
File
(
clvr_file
,
'
r
'
)
except
Exception
:
if
h5f
is
not
None
:
h5f
.
close
()
print
(
'
Problem with file:
'
,
clvr_file
)
continue
if
last_h5f
is
not
None
:
last_h5f
.
close
()
last_h5f
=
h5f
last_clvr_file
=
clvr_file
else
:
h5f
=
last_h5f
# try:
# clvr_ds = get_clavrx_datasource(time)
# except Exception:
# continue
#
# clvr_file = clvr_ds.get_file(time)[0]
# if clvr_file is None:
# continue
#
# if clvr_file != last_clvr_file:
# try:
# h5f = h5py.File(clvr_file, 'r')
# except Exception:
# if h5f is not None:
# h5f.close()
# print('Problem with file: ', clvr_file)
# continue
# if last_h5f is not None:
# last_h5f.close()
# last_h5f = h5f
# last_clvr_file = clvr_file
# else:
# h5f = last_h5f
cc
,
ll
=
nav
.
earth_to_lc_s
(
lon_s
,
lat_s
)
if
cc
[
0
]
<
0
:
...
...
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