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
b569628e
Commit
b569628e
authored
2 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
fc869f41
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/util/viirs_l1b_l2.py
+13
-21
13 additions, 21 deletions
modules/util/viirs_l1b_l2.py
with
13 additions
and
21 deletions
modules/util/viirs_l1b_l2.py
+
13
−
21
View file @
b569628e
...
...
@@ -191,7 +191,6 @@ def run(data_h5f, param_s, tiles, tile_width=64, kernel_size=9, day_night='ANY')
solzen
=
get_grid_values
(
data_h5f
,
'
solar_zenith_angle
'
,
0
,
0
,
None
,
num_lines
,
num_pixels
)
grd_s
=
[]
for
param
in
param_s
:
fill_value
,
fill_value_name
=
get_fill_attrs
(
param
)
try
:
...
...
@@ -200,38 +199,31 @@ def run(data_h5f, param_s, tiles, tile_width=64, kernel_size=9, day_night='ANY')
except
Exception
as
e
:
print
(
e
)
return
data
=
np
.
stack
(
grd_s
)
tile_width
+
2
*
border
num_keep_x_tiles
=
4
#num_keep_x_tiles = 1
i_skip
=
num_keep_x_tiles
*
tile_width
j_skip
=
1
*
tile_width
i_skip
=
tile_width
j_skip
=
tile_width
i_start
=
int
(
num_pixels
/
2
)
-
int
((
num_keep_x_tiles
*
tile_width
)
/
2
)
num_keep_y_tiles
=
24
num_keep_y_tiles
=
int
(
num_lines
/
tile_width
)
-
1
for
j
in
range
(
num_keep_y_tiles
):
j_
c
=
j
*
j_skip
j_
m
=
j_
c
+
border
j_
a
=
j
*
j_skip
j_
b
=
j_
a
+
tile_width
for
i
in
range
(
num_keep_x_tiles
):
i_c
=
i
*
i_skip
+
i_start
i_m
=
i_c
+
border
j_stop
=
j_m
+
tile_width
+
border
if
j_stop
>
num_lines
-
1
:
continue
i_stop
=
i_m
+
tile_width
+
border
if
i_stop
>
num_pixels
-
1
:
continue
i_a
=
i_start
+
i
*
i_skip
i_b
=
i_a
+
tile_width
if
day_night
==
'
DAY
'
and
not
is_day
(
solzen
[
j_
m
-
border
:
j_stop
,
i_m
-
border
:
i_stop
]):
if
day_night
==
'
DAY
'
and
not
is_day
(
solzen
[
j_
a
:
j_b
,
i_a
:
i_b
]):
continue
elif
day_night
==
'
NIGHT
'
and
is_day
(
solzen
[
j_
m
-
border
:
j_stop
,
i_m
-
border
:
i_stop
]):
elif
day_night
==
'
NIGHT
'
and
is_day
(
solzen
[
j_
a
:
j_b
,
i_a
:
i_b
]):
continue
nda
=
data
[:,
j_
m
-
border
:
j_stop
,
i_m
-
border
:
i_stop
]
nda
=
data
[:,
j_
a
:
j_b
,
i_a
:
i_b
]
if
not
keep_tile
(
param_s
,
nda
):
continue
tiles
.
append
(
nda
)
...
...
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