Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MVCM
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
Paolo Veglio
MVCM
Commits
88d5aeca
Commit
88d5aeca
authored
2 years ago
by
Paolo Veglio
Browse files
Options
Downloads
Patches
Plain Diff
function to determine the scene type has been implemented
parent
4d7a3e42
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
scene.py
+128
-4
128 additions, 4 deletions
scene.py
with
128 additions
and
4 deletions
scene.py
+
128
−
4
View file @
88d5aeca
...
...
@@ -6,10 +6,10 @@ from glob import glob
import
read_data
as
rd
# lsf: land sea flag
_scene_list
=
[
'
ocean_day
'
,
'
ocean_night
'
,
'
land_day
'
,
'
land_night
'
,
'
snow_day
'
,
'
coast_day
'
,
'
desert_day
'
,
'
antarctic_day
'
,
'
polar_day_snow
'
,
'
polar_day_desert
'
,
_scene_list
=
[
'
ocean_day
'
,
'
ocean_night
'
,
'
land_day
'
,
'
land_night
'
,
'
snow_day
'
,
'
snow_night
'
,
'
coast_day
'
,
'
desert_day
'
,
'
antarctic_day
'
,
'
polar_day_snow
'
,
'
polar_day_desert
'
,
'
polar_day_ocean
'
,
'
polar_day_desert_coast
'
,
'
polar_day_coast
'
,
'
polar_day_land
'
,
'
polar_night_snow
'
,
'
polar_night_land
'
,
'
polar_
ocean_nigh
t
'
]
'
polar_night_land
'
,
'
polar_
night_ocean
'
,
'
land_day_desert_coas
t
'
]
_flags
=
[
'
day
'
,
'
night
'
,
'
land
'
,
'
coast
'
,
'
sh_lake
'
,
'
sh_ocean
'
,
'
water
'
,
'
polar
'
,
'
sunglint
'
,
'
greenland
'
,
'
high_elevation
'
,
'
antarctica
'
,
'
desert
'
,
'
visusd
'
,
'
vrused
'
,
'
map_snow
'
,
'
map_ice
'
,
'
ndsi_snow
'
,
'
snow
'
,
'
ice
'
,
'
new_zealand
'
]
...
...
@@ -109,7 +109,6 @@ def find_scene(data, sunglint_angle):
# tmp[day == 1] = day
# tmp[day == 0] = night
scene
=
{
scn
:
np
.
zeros
((
dim1
,
dim2
))
for
scn
in
_scene_list
}
scene_flag
=
{
flg
:
np
.
zeros
((
dim1
,
dim2
))
for
flg
in
_flags
}
scene_flag
[
'
day
'
][
sza
<=
85
]
=
1
...
...
@@ -307,4 +306,129 @@ def find_scene(data, sunglint_angle):
return
scene_flag
def
scene_id
(
scene_flag
):
dim1
,
dim2
=
scene_flag
[
'
day
'
].
shape
[
0
],
scene_flag
[
'
day
'
].
shape
[
1
]
scene
=
{
scn
:
np
.
zeros
((
dim1
,
dim2
))
for
scn
in
_scene_list
}
# Ocean Day
idx
=
np
.
nonzero
((
scene_flag
[
'
water
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
)
&
(
scene_flag
[
'
polar
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
coast
'
]
==
0
)
&
(
scene_flag
[
'
desert
'
]
==
0
))
scene
[
'
ocean_day
'
][
idx
]
=
1
# Ocean Night
idx
=
np
.
nonzero
((
scene_flag
[
'
water
'
]
==
1
)
&
(
scene_flag
[
'
night
'
]
==
1
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
)
&
(
scene_flag
[
'
polar
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
coast
'
]
==
0
)
&
(
scene_flag
[
'
desert
'
]
==
0
))
scene
[
'
ocean_night
'
][
idx
]
=
1
# Land Day
idx
=
np
.
nonzero
((
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
)
&
(
scene_flag
[
'
polar
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
coast
'
]
==
0
)
&
(
scene_flag
[
'
desert
'
]
==
0
))
scene
[
'
land_day
'
][
idx
]
=
1
# Land Night
idx
=
np
.
nonzero
((
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
night
'
]
==
1
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
)
&
(
scene_flag
[
'
polar
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
coast
'
]
==
0
))
scene
[
'
land_night
'
][
idx
]
=
1
# Snow Day
idx
=
np
.
nonzero
((
scene_flag
[
'
day
'
]
==
1
)
&
((
scene_flag
[
'
ice
'
]
==
1
)
|
(
scene_flag
[
'
snow
'
]
==
1
))
&
(
scene_flag
[
'
polar
'
])
&
(
scene_flag
[
'
antarctica
'
]))
scene
[
'
snow_day
'
][
idx
]
=
1
# Snow Night
idx
=
np
.
nonzero
((
scene_flag
[
'
night
'
]
==
1
)
&
((
scene_flag
[
'
ice
'
]
==
1
)
|
(
scene_flag
[
'
snow
'
]
==
1
))
&
(
scene_flag
[
'
polar
'
])
&
(
scene_flag
[
'
antarctica
'
]))
scene
[
'
snow_night
'
][
idx
]
=
1
# Land Day Coast
idx
=
np
.
nonzero
((
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
1
)
&
(
scene_flag
[
'
desert
'
]
==
0
)
&
(
scene_flag
[
'
polar
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
))
scene
[
'
land_day_coast
'
][
idx
]
=
1
# Land Day Desert
idx
=
np
.
nonzero
((
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
desert
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
0
)
&
(
scene_flag
[
'
polar
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
))
scene
[
'
desert_day
'
][
idx
]
=
1
# Land Day Desert Coast
idx
=
np
.
nonzero
((
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
desert
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
1
)
&
(
scene_flag
[
'
polar
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
))
scene
[
'
land_day_desert_coast
'
][
idx
]
=
1
# Antarctic Day
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
antarctica
'
]
==
1
)
&
(
scene_flag
[
'
land
'
]
==
1
))
scene
[
'
antarctic_day
'
][
idx
]
=
1
# Polar Day Snow
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
((
scene_flag
[
'
snow
'
]
==
1
)
|
(
scene_flag
[
'
ice
'
]
==
1
))
&
(
scene_flag
[
'
antarctica
'
]
==
0
))
scene
[
'
polar_day_snow
'
][
idx
]
=
1
# Polar Day Desert
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
desert
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
))
scene
[
'
polar_day_desert
'
][
idx
]
=
1
# Polar Day Desert Coast
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
desert
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
1
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
))
scene
[
'
polar_day_desert_coast
'
][
idx
]
=
1
# Polar Day Coast
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
1
)
(
scene_flag
[
'
desert
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
))
scene
[
'
polar_day_coast
'
][
idx
]
=
1
# Polar Day Land
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
land
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
0
)
(
scene_flag
[
'
desert
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
))
scene
[
'
polar_day_land
'
][
idx
]
=
1
# Polar Day Ocean
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
day
'
]
==
1
)
&
(
scene_flag
[
'
water
'
]
==
1
)
&
(
scene_flag
[
'
coast
'
]
==
0
)
(
scene_flag
[
'
desert
'
]
==
0
)
&
(
scene_flag
[
'
antarctica
'
]
==
0
)
&
(
scene_flag
[
'
ice
'
]
==
0
)
&
(
scene_flag
[
'
snow
'
]
==
0
))
scene
[
'
polar_day_land
'
][
idx
]
=
1
# Polar Night Snow
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
night
'
]
==
1
)
&
((
scene_flag
[
'
snow
'
]
==
1
)
|
(
scene_flag
[
'
ice
'
]
==
1
)))
scene
[
'
polar_night_snow
'
][
idx
]
=
1
# Polar Night Land
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
night
'
]
==
1
)
&
(
scene_flag
[
'
land
'
]
==
1
))
scene
[
'
polar_night_land
'
][
idx
]
=
1
# Polar Night Ocean
idx
=
np
.
nonzero
((
scene_flag
[
'
polar
'
]
==
1
)
&
(
scene_flag
[
'
night
'
]
==
1
)
&
(
scene_flag
[
'
water
'
]
==
1
))
scene
[
'
polar_night_ocean
'
][
idx
]
=
1
return
scene
scene
[
'
polar_day_ocean
'
][
idx
]
=
1
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