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
2b7ea423
Commit
2b7ea423
authored
2 years ago
by
Paolo Veglio
Browse files
Options
Downloads
Patches
Plain Diff
spatial variability restoral test implemented
parent
0b9cb76a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mvcm/restoral.py
+33
-0
33 additions, 0 deletions
mvcm/restoral.py
thresholds/thresholds.mvcm.snpp.v0.0.1.yaml
+10
-10
10 additions, 10 deletions
thresholds/thresholds.mvcm.snpp.v0.0.1.yaml
with
43 additions
and
10 deletions
mvcm/restoral.py
+
33
−
0
View file @
2b7ea423
...
@@ -4,6 +4,7 @@ import xarray as xr
...
@@ -4,6 +4,7 @@ import xarray as xr
from
typing
import
Dict
from
typing
import
Dict
from
attrs
import
define
,
field
,
validators
,
Factory
from
attrs
import
define
,
field
,
validators
,
Factory
from
numpy.lib.stride_tricks
import
sliding_window_view
from
numpy.lib.stride_tricks
import
sliding_window_view
from
copy
import
deepcopy
import
logging
import
logging
...
@@ -77,6 +78,38 @@ class Restoral(object):
...
@@ -77,6 +78,38 @@ class Restoral(object):
"""
"""
data
:
xr
.
Dataset
=
field
(
validator
=
[
validators
.
instance_of
(
xr
.
Dataset
),
])
data
:
xr
.
Dataset
=
field
(
validator
=
[
validators
.
instance_of
(
xr
.
Dataset
),
])
thresholds
:
str
=
field
(
validator
=
[
validators
.
instance_of
(
Dict
),
])
thresholds
:
str
=
field
(
validator
=
[
validators
.
instance_of
(
Dict
),
])
scene_flag
:
Dict
=
field
(
validator
=
[
validators
.
instance_of
(
Dict
),
])
confidence
:
np
.
ndarray
=
field
(
validator
=
[
validators
.
instance_of
(
np
.
ndarray
),
])
# VIIRS does not have water vapor channels (6.7um and 7.2um) for this test
def
night_snow_inversion
(
self
):
pass
def
spatial_variability
(
self
):
threshold
=
self
.
thresholds
[
'
Daytime_Ocean_Spatial_Variability
'
]
bt
=
self
.
data
.
M15
.
values
reflectance
=
self
.
data
.
M07
.
values
confidence
=
deepcopy
(
self
.
confidence
)
var_bt
=
spatial_var
(
bt
,
threshold
[
'
var_11um
'
])
var_reflectance
=
spatial_var
(
reflectance
,
threshold
[
'
var_0_86um
'
])
idx
=
np
.
nonzero
((
self
.
confidence
>
0.95
)
&
(
self
.
scene_flag
[
'
day
'
]
==
1
)
&
(
var_bt
==
1
)
&
(
var_reflectance
==
1
))
confidence
[
idx
]
=
1
idx
=
np
.
nonzero
((
self
.
confidence
>
0.66
)
&
(
((
self
.
scene_flag
[
'
night
'
]
==
1
)
&
(
var_bt
==
1
))
|
((
self
.
scene_flag
[
'
day
'
]
==
1
)
&
(
var_bt
==
1
)
&
(
var_reflectance
==
1
))))
confidence
[
idx
]
=
0.96
idx
=
np
.
nonzero
((
self
.
confidence
<=
0.66
)
&
(
var_bt
==
1
))
confidence
[
idx
]
=
0.67
logger
.
info
(
'
spatial_variability restoral test performed successfully
'
)
return
confidence
def
spatial_var
(
rad
,
threshold
):
def
spatial_var
(
rad
,
threshold
):
...
...
This diff is collapsed.
Click to expand it.
thresholds/thresholds.mvcm.snpp.v0.0.1.yaml
+
10
−
10
View file @
2b7ea423
...
@@ -39,7 +39,7 @@ Land_Night:
...
@@ -39,7 +39,7 @@ Land_Night:
perform
:
True
perform
:
True
7.3-11um_BTD_Mid_Level_Cloud_Test
:
7.3-11um_BTD_Mid_Level_Cloud_Test
:
thr
:
[
-8.0
,
-10.0
,
-11.0
,
1.0
,
1.0
]
# nl7_11s
thr
:
[
-8.0
,
-10.0
,
-11.0
,
1.0
,
1.0
]
# nl7_11s
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Land
:
thr_low
:
[
0.0
,
-0.5
,
-1.0
,
1.0
]
thr_low
:
[
0.0
,
-0.5
,
-1.0
,
1.0
]
thr_mid
:
[
-0.5
,
6.0
,
0.5
,
1.0
]
thr_mid
:
[
-0.5
,
6.0
,
0.5
,
1.0
]
thr_hi
:
[
6.5
,
6.0
,
5.5
,
1.0
]
thr_hi
:
[
6.5
,
6.0
,
5.5
,
1.0
]
...
@@ -234,7 +234,7 @@ Ocean_Night:
...
@@ -234,7 +234,7 @@ Ocean_Night:
thr
:
[
3.0
,
6.0
,
7.0
,
1.0
,
1.0
]
thr
:
[
3.0
,
6.0
,
7.0
,
1.0
,
1.0
]
variability
:
0.40
variability
:
0.40
perform
:
True
perform
:
True
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Ocean
:
coeffs
:
[
-0.7093
,
0.1128
,
-0.1567
]
coeffs
:
[
-0.7093
,
0.1128
,
-0.1567
]
corr
:
0.0
# no_intadj
corr
:
0.0
# no_intadj
locut_coeff
:
[
-4.0
,
4.0
]
# no11_4load
locut_coeff
:
[
-4.0
,
4.0
]
# no11_4load
...
@@ -285,7 +285,7 @@ Polar_Night_Land:
...
@@ -285,7 +285,7 @@ Polar_Night_Land:
# Surface_Temperature_Test_2: 12.0 # | merge these three coefficients
# Surface_Temperature_Test_2: 12.0 # | merge these three coefficients
# Surface_Temperature_Test_pfm: 1.0 # __|
# Surface_Temperature_Test_pfm: 1.0 # __|
# Surface_Temperature_Test: [20.0, 12.0, 1.0] # <- First attempt to merge the three values above
# Surface_Temperature_Test: [20.0, 12.0, 1.0] # <- First attempt to merge the three values above
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Land
:
low
:
[
2.00
,
1.70
,
1.40
,
1.0
]
low
:
[
2.00
,
1.70
,
1.40
,
1.0
]
mid1
:
[
1.70
,
0.70
,
0.3
,
1.0
]
mid1
:
[
1.70
,
0.70
,
0.3
,
1.0
]
mid2
:
[
0.00
,
0.00
,
0.00
,
0.0
]
mid2
:
[
0.00
,
0.00
,
0.00
,
0.0
]
...
@@ -388,7 +388,7 @@ Polar_Day_Snow:
...
@@ -388,7 +388,7 @@ Polar_Day_Snow:
1.38um_High_Cloud_Test
:
1.38um_High_Cloud_Test
:
thr
:
[
0.060
,
0.0525
,
0.045
,
1.0
,
1.0
]
thr
:
[
0.060
,
0.0525
,
0.045
,
1.0
,
1.0
]
perform
:
True
perform
:
True
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Land
:
low
:
[
20.0
,
18.0
,
16.0
,
1.0
]
low
:
[
20.0
,
18.0
,
16.0
,
1.0
]
mid1
:
[
18.0
,
16.0
,
2.0
,
1.0
]
mid1
:
[
18.0
,
16.0
,
2.0
,
1.0
]
mid2
:
[
0.0
,
0.0
,
0.0
,
0.0
]
mid2
:
[
0.0
,
0.0
,
0.0
,
0.0
]
...
@@ -426,7 +426,7 @@ Polar_Night_Snow:
...
@@ -426,7 +426,7 @@ Polar_Night_Snow:
high_ice
:
[
-21.0 -20.0
,
-19.0
,
1.0
]
# pn_7_11hw
high_ice
:
[
-21.0 -20.0
,
-19.0
,
1.0
]
# pn_7_11hw
bt11_bounds
:
[
220.0
,
245.0
,
255.0
,
265.0
]
# bt11_bnds2
bt11_bounds
:
[
220.0
,
245.0
,
255.0
,
265.0
]
# bt11_bnds2
Water_Vapor_High_Clouds_Test
:
[
215.0
,
220.0
,
225.0
,
1.0
,
1.0
]
Water_Vapor_High_Clouds_Test
:
[
215.0
,
220.0
,
225.0
,
1.0
,
1.0
]
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Land
:
top
:
top
:
low
:
[
2.00
,
1.70
,
1.40
,
1.0
]
low
:
[
2.00
,
1.70
,
1.40
,
1.0
]
mid1
:
[
1.70
,
0.30
,
0.300
,
1.0
]
mid1
:
[
1.70
,
0.30
,
0.300
,
1.0
]
...
@@ -520,7 +520,7 @@ Polar_Night_Ocean:
...
@@ -520,7 +520,7 @@ Polar_Night_Ocean:
thr
:
[
3.0
,
6.0
,
7.0
,
1.0
,
1.0
]
thr
:
[
3.0
,
6.0
,
7.0
,
1.0
,
1.0
]
variability
:
040
variability
:
040
perform
:
True
perform
:
True
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Ocean
:
coeffs
:
[
-0.7093
,
0.1128
,
-0.1567
]
coeffs
:
[
-0.7093
,
0.1128
,
-0.1567
]
corr
:
0.0
# pno_intadj
corr
:
0.0
# pno_intadj
locut_coeff
:
[
-4.0
,
4.0
]
# pno11_4load
locut_coeff
:
[
-4.0
,
4.0
]
# pno11_4load
...
@@ -542,7 +542,7 @@ Day_Snow:
...
@@ -542,7 +542,7 @@ Day_Snow:
1.38um_High_Cloud_Test
:
1.38um_High_Cloud_Test
:
thr
:
[
0.060
,
0.0525
,
0.045
,
1.0
,
1.0
]
thr
:
[
0.060
,
0.0525
,
0.045
,
1.0
,
1.0
]
perform
:
True
perform
:
True
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Land
:
low
:
[
20.0
,
18.0
,
16.0
,
1.0
]
low
:
[
20.0
,
18.0
,
16.0
,
1.0
]
mid1
:
[
18.0
,
16.0
,
2.0
,
1.0
]
mid1
:
[
18.0
,
16.0
,
2.0
,
1.0
]
mid2
:
[
0.0
,
0.0
,
0.0
,
0.0
]
mid2
:
[
0.0
,
0.0
,
0.0
,
0.0
]
...
@@ -565,7 +565,7 @@ Night_Snow:
...
@@ -565,7 +565,7 @@ Night_Snow:
4-12um_BTD_Thin_Cirrus_Test
:
4-12um_BTD_Thin_Cirrus_Test
:
thr
:
[
4.50
,
4.00
,
3.50
,
1.0
,
1.0
]
thr
:
[
4.50
,
4.00
,
3.50
,
1.0
,
1.0
]
perform
:
True
perform
:
True
11-4um_BT_Difference_Test
:
11-4um_BT_Difference_Test
_Land
:
thr
:
[
0.70
,
0.60
,
0.50
,
1.0
,
1.0
]
thr
:
[
0.70
,
0.60
,
0.50
,
1.0
,
1.0
]
bottom
:
bottom
:
low
:
[
20.0
,
18.0
,
16.0
,
1.0
]
low
:
[
20.0
,
18.0
,
16.0
,
1.0
]
...
@@ -606,8 +606,8 @@ Antarctic_Day:
...
@@ -606,8 +606,8 @@ Antarctic_Day:
ant4_11_pfm
:
1.0
ant4_11_pfm
:
1.0
Daytime_Ocean_Spatial_Variability
:
Daytime_Ocean_Spatial_Variability
:
do
var11
:
0.40
var
_
11
um
:
0.40
do
var
86
:
0.0020
var
_0_86um
:
0.0020
Sun_Glint
:
Sun_Glint
:
# snglntv : [1.02, 1.17]
# snglntv : [1.02, 1.17]
...
...
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