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
7e570ff6
Commit
7e570ff6
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
Only use PugL1bTools as it extends PugFile (simplify)
parent
a869885b
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/deeplearning/amv_raob.py
+12
-15
12 additions, 15 deletions
modules/deeplearning/amv_raob.py
with
12 additions
and
15 deletions
modules/deeplearning/amv_raob.py
+
12
−
15
View file @
7e570ff6
...
@@ -727,16 +727,15 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -727,16 +727,15 @@ 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_c
=
PugFile
(
local_path
,
'
Rad
'
)
pug_l1b_c
=
PugL1bTools
(
local_path
)
pug_l1b_c
=
PugL1bTools
(
local_path
)
except
Exception
as
exc
:
except
Exception
as
exc
:
print
(
exc
)
print
(
exc
)
return
None
,
None
,
None
,
None
return
None
,
None
,
None
,
None
bt_or_refl
=
None
bt_or_refl
=
None
if
pug_c
.
bt_or_refl
==
'
bt
'
:
if
pug_
l1b_
c
.
bt_or_refl
==
'
bt
'
:
bt_or_refl
=
pug_l1b_c
.
bt
bt_or_refl
=
pug_l1b_c
.
bt
elif
pug_c
.
bt_or_refl
==
'
refl
'
:
elif
pug_
l1b_
c
.
bt_or_refl
==
'
refl
'
:
bt_or_refl
=
pug_l1b_c
.
refl
bt_or_refl
=
pug_l1b_c
.
refl
if
TRIPLET
or
CONV3D
:
if
TRIPLET
or
CONV3D
:
...
@@ -748,15 +747,14 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -748,15 +747,14 @@ 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_l
=
PugFile
(
local_path_l
,
'
Rad
'
)
pug_l1b_l
=
PugL1bTools
(
local_path_l
)
pug_l1b_l
=
PugL1bTools
(
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
if
pug_l
.
bt_or_refl
==
'
bt
'
:
if
pug_
l1b_
l
.
bt_or_refl
==
'
bt
'
:
bt_or_refl_l
=
pug_l1b_l
.
bt
bt_or_refl_l
=
pug_l1b_l
.
bt
elif
pug_l
.
bt_or_refl
==
'
refl
'
:
elif
pug_
l1b_
l
.
bt_or_refl
==
'
refl
'
:
bt_or_refl_l
=
pug_l1b_l
.
refl
bt_or_refl_l
=
pug_l1b_l
.
refl
# copy from archive to local drive
# copy from archive to local drive
...
@@ -767,35 +765,34 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -767,35 +765,34 @@ 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_r
=
PugFile
(
local_path_r
,
'
Rad
'
)
pug_l1b_r
=
PugL1bTools
(
local_path_r
)
pug_l1b_r
=
PugL1bTools
(
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
if
pug_r
.
bt_or_refl
==
'
bt
'
:
if
pug_
l1b_
r
.
bt_or_refl
==
'
bt
'
:
bt_or_refl_r
=
pug_l1b_r
.
bt
bt_or_refl_r
=
pug_l1b_r
.
bt
elif
pug_r
.
bt_or_refl
==
'
refl
'
:
elif
pug_
l1b_
r
.
bt_or_refl
==
'
refl
'
:
bt_or_refl_r
=
pug_l1b_r
.
refl
bt_or_refl_r
=
pug_l1b_r
.
refl
if
daynight
!=
'
ANY
'
:
if
daynight
!=
'
ANY
'
:
if
step
[
ch_idx
]
==
1
:
if
step
[
ch_idx
]
==
1
:
if
geoloc_2km
is
None
:
if
geoloc_2km
is
None
:
geoloc_2km
=
pug_c
.
geo
geoloc_2km
=
pug_
l1b_
c
.
geo
glons
=
geoloc_2km
.
lon
glons
=
geoloc_2km
.
lon
glats
=
geoloc_2km
.
lat
glats
=
geoloc_2km
.
lat
elif
step
[
ch_idx
]
==
4
:
elif
step
[
ch_idx
]
==
4
:
if
geoloc_hkm
is
None
:
if
geoloc_hkm
is
None
:
geoloc_hkm
=
pug_c
.
geo
geoloc_hkm
=
pug_
l1b_
c
.
geo
glons
=
geoloc_hkm
.
lon
glons
=
geoloc_hkm
.
lon
glats
=
geoloc_hkm
.
lat
glats
=
geoloc_hkm
.
lat
elif
step
[
ch_idx
]
==
2
:
elif
step
[
ch_idx
]
==
2
:
if
geoloc_1km
is
None
:
if
geoloc_1km
is
None
:
geoloc_1km
=
pug_c
.
geo
geoloc_1km
=
pug_
l1b_
c
.
geo
glons
=
geoloc_1km
.
lon
glons
=
geoloc_1km
.
lon
glats
=
geoloc_1km
.
lat
glats
=
geoloc_1km
.
lat
alt_fnc
=
get_solar_alt_func
(
pug_c
,
glons
,
glats
,
dt_obj
)
alt_fnc
=
get_solar_alt_func
(
pug_
l1b_
c
,
glons
,
glats
,
dt_obj
)
images
=
[]
images
=
[]
images_l
=
[]
images_l
=
[]
...
@@ -803,7 +800,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -803,7 +800,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
for
idx
,
lon
in
enumerate
(
lons
):
for
idx
,
lon
in
enumerate
(
lons
):
lat
=
lats
[
idx
]
lat
=
lats
[
idx
]
if
ch_idx
==
0
:
if
ch_idx
==
0
:
l
,
c
=
pug_c
.
lat_lon_to_l_c
(
lat
,
lon
)
l
,
c
=
pug_
l1b_
c
.
lat_lon_to_l_c
(
lat
,
lon
)
l_s
.
append
(
l
)
l_s
.
append
(
l
)
c_s
.
append
(
c
)
c_s
.
append
(
c
)
else
:
else
:
...
@@ -824,7 +821,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
...
@@ -824,7 +821,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
l_b
=
l
+
half_width
[
ch_idx
]
l_b
=
l
+
half_width
[
ch_idx
]
c_a
=
c
-
half_width
[
ch_idx
]
c_a
=
c
-
half_width
[
ch_idx
]
c_b
=
c
+
half_width
[
ch_idx
]
c_b
=
c
+
half_width
[
ch_idx
]
if
(
l_a
>=
0
and
l_b
<
pug_c
.
shape
[
0
])
and
(
c_a
>=
0
and
c_b
<
pug_c
.
shape
[
1
]):
if
(
l_a
>=
0
and
l_b
<
pug_
l1b_
c
.
shape
[
0
])
and
(
c_a
>=
0
and
c_b
<
pug_
l1b_
c
.
shape
[
1
]):
img
=
bt_or_refl
[
l_a
:
l_b
:
step
[
ch_idx
],
c_a
:
c_b
:
step
[
ch_idx
]]
img
=
bt_or_refl
[
l_a
:
l_b
:
step
[
ch_idx
],
c_a
:
c_b
:
step
[
ch_idx
]]
if
do_norm
:
if
do_norm
:
img
=
prepare_image
(
img
,
ch
)
img
=
prepare_image
(
img
,
ch
)
...
...
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