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
e41a6d34
Commit
e41a6d34
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
Only use PugL1bTools as it extends PugFile (simplify)
parent
7e570ff6
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/deeplearning/amv_raob.py
+21
-3
21 additions, 3 deletions
modules/deeplearning/amv_raob.py
with
21 additions
and
3 deletions
modules/deeplearning/amv_raob.py
+
21
−
3
View file @
e41a6d34
...
@@ -698,6 +698,24 @@ def get_interpolated_scalar(ds_0, ds_1, time0, time1, fld_name, time, lons, lats
...
@@ -698,6 +698,24 @@ def get_interpolated_scalar(ds_0, ds_1, time0, time1, fld_name, time, lons, lats
return
intrp_vals
return
intrp_vals
path_to_reader_dict
=
{}
def
get_reader
(
path
):
if
len
(
path_to_reader_dict
)
>
50
:
path_to_reader_dict
.
clear
()
rdr
=
path_to_reader_dict
.
get
(
path
)
if
rdr
is
None
:
rdr
=
PugL1bTools
(
path
)
path_to_reader_dict
[
path
]
=
rdr
return
rdr
def
clear_readers
():
path_to_reader_dict
.
clear
()
def
get_images
(
lons
,
lats
,
timestamp
,
channel_list
,
half_width
,
step
,
do_norm
=
False
,
daynight
=
'
ANY
'
):
def
get_images
(
lons
,
lats
,
timestamp
,
channel_list
,
half_width
,
step
,
do_norm
=
False
,
daynight
=
'
ANY
'
):
global
geoloc_2km
,
geoloc_1km
,
geoloc_hkm
global
geoloc_2km
,
geoloc_1km
,
geoloc_hkm
...
@@ -727,7 +745,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -727,7 +745,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
# Navigation, convert to BT/REFL
# Navigation, convert to BT/REFL
try
:
try
:
pug_l1b_c
=
PugL1bTools
(
local_path
)
pug_l1b_c
=
get_reader
(
local_path
)
except
Exception
as
exc
:
except
Exception
as
exc
:
print
(
exc
)
print
(
exc
)
return
None
,
None
,
None
,
None
return
None
,
None
,
None
,
None
...
@@ -747,7 +765,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -747,7 +765,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
# Navigation, convert to BT/REFL
# Navigation, convert to BT/REFL
try
:
try
:
pug_l1b_l
=
PugL1bTools
(
local_path_l
)
pug_l1b_l
=
get_reader
(
local_path_l
)
except
Exception
as
exc
:
except
Exception
as
exc
:
print
(
exc
)
print
(
exc
)
return
None
,
None
,
None
,
None
return
None
,
None
,
None
,
None
...
@@ -765,7 +783,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -765,7 +783,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
# Navigation, convert to BT/REFL
# Navigation, convert to BT/REFL
try
:
try
:
pug_l1b_r
=
PugL1bTools
(
local_path_r
)
pug_l1b_r
=
get_reader
(
local_path_r
)
except
Exception
as
exc
:
except
Exception
as
exc
:
print
(
exc
)
print
(
exc
)
return
None
,
None
,
None
,
None
return
None
,
None
,
None
,
None
...
...
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