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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Rink
python
Commits
fc08fdd3
Commit
fc08fdd3
authored
Mar 25, 2021
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
e6197afa
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show 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():
...
@@ -46,10 +46,8 @@ def setup():
def
get_clavrx_datasource
(
timestamp
):
def
get_clavrx_datasource
(
timestamp
):
dt_obj
,
time_tup
=
get_time_tuple_utc
(
timestamp
)
dt_obj
,
time_tup
=
get_time_tuple_utc
(
timestamp
)
date_dir_str
=
dt_obj
.
strftime
(
dir_fmt
)
date_dir_str
=
dt_obj
.
strftime
(
dir_fmt
)
print
(
dt_obj
)
ds
=
ds_dct
.
get
(
date_dir_str
)
ds
=
ds_dct
.
get
(
date_dir_str
)
if
ds
is
None
:
if
ds
is
None
:
print
(
'
new datasource:
'
,
date_dir_str
)
ds
=
CLAVRx
(
clavrx_dir
+
date_dir_str
+
'
/
'
)
ds
=
CLAVRx
(
clavrx_dir
+
date_dir_str
+
'
/
'
)
ds_dct
[
date_dir_str
]
=
ds
ds_dct
[
date_dir_str
]
=
ds
return
ds
return
ds
...
@@ -188,13 +186,8 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
...
@@ -188,13 +186,8 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
continue
continue
if
time
>
t_end
:
if
time
>
t_end
:
continue
continue
dt_obj
,
time_tup
=
get_time_tuple_utc
(
time
)
reports
=
pirep_dct
[
time
]
print
(
dt_obj
)
for
tup
in
reports
:
lat
,
lon
,
fl
,
I
,
id
,
rpt_str
=
tup
lat_s
[
0
]
=
lat
lon_s
[
0
]
=
lon
try
:
try
:
clvr_ds
=
get_clavrx_datasource
(
time
)
clvr_ds
=
get_clavrx_datasource
(
time
)
except
Exception
:
except
Exception
:
...
@@ -204,6 +197,7 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
...
@@ -204,6 +197,7 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
if
clvr_file
is
None
:
if
clvr_file
is
None
:
continue
continue
print
(
clvr_file
,
last_clvr_file
)
if
clvr_file
!=
last_clvr_file
:
if
clvr_file
!=
last_clvr_file
:
try
:
try
:
h5f
=
h5py
.
File
(
clvr_file
,
'
r
'
)
h5f
=
h5py
.
File
(
clvr_file
,
'
r
'
)
...
@@ -216,9 +210,40 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
...
@@ -216,9 +210,40 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
last_h5f
.
close
()
last_h5f
.
close
()
last_h5f
=
h5f
last_h5f
=
h5f
last_clvr_file
=
clvr_file
last_clvr_file
=
clvr_file
print
(
'
new file
'
)
else
:
else
:
h5f
=
last_h5f
h5f
=
last_h5f
reports
=
pirep_dct
[
time
]
for
tup
in
reports
:
lat
,
lon
,
fl
,
I
,
id
,
rpt_str
=
tup
lat_s
[
0
]
=
lat
lon_s
[
0
]
=
lon
# 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
)
cc
,
ll
=
nav
.
earth_to_lc_s
(
lon_s
,
lat_s
)
if
cc
[
0
]
<
0
:
if
cc
[
0
]
<
0
:
continue
continue
...
...
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
sign in
to comment