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
0b9cb76a
Commit
0b9cb76a
authored
2 years ago
by
Paolo Veglio
Browse files
Options
Downloads
Patches
Plain Diff
started working on restoral tests
parent
36044921
No related branches found
Branches containing commit
Tags
0.2.3
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mvcm/restoral.py
+74
-0
74 additions, 0 deletions
mvcm/restoral.py
with
74 additions
and
0 deletions
mvcm/restoral.py
+
74
−
0
View file @
0b9cb76a
import
numpy
as
np
import
numpy
as
np
import
xarray
as
xr
from
typing
import
Dict
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
import
logging
# import importlib
_bad_data
=
-
999.0
_bad_data
=
-
999.0
logger
=
logging
.
getLogger
(
'
__name__
'
)
# tracking down the list of restoral tests that need to be implemented
# and the function that gets called in the C code
# Also list the set of conditions to run the restoral test
#
# Night, snow/ice temperature inversion tests
# - NightSnow_Inv_check()
# - pxin.night
# - pxin.snow || pxin.ice
#
# Water
# - chk_spatial_var()
# - pxin.water
# - pxin.uniform
# - !pxin.ice
# - pxout.intermediate_conf <= 0.99
# - pxout.intermediate_conf >= 0.05
#
# Water Day
# - chck_sunglint()
# - pxin.day
# - pxin.water
# - pxin.uniform
# - pxin.sunglint
# - pxout.intermediate_conf <= 0.95
#
# Daytime water NDVI test and turbid water test for shallow water
# - chk_shallow_water()
# - pxin.day
# - pxin.water
# - !pxin.ice
#
# Daytime land
# - chk_land()
# - pxin.day
# - pxin.land
# - !pxin.snow
# - !pxin.ice
# - pxout.intermediate_conf <= 0.95
#
# Daytime coast(land)
# - chk_land()
# - pxin.day
# - pxin.land
# - !pxin.snow
# - !pxin.ice
# - pxin.coast
#
# Nighttime land test
# - chck_land_night()
# - pxin.night
# - pxin.land
# - !pxin.snow
# - !pxin.ice
# - pxout.intermediate_conf <= 0.95
#
@define
(
kw_only
=
True
,
slots
=
True
)
class
Restoral
(
object
):
"""
"""
data
:
xr
.
Dataset
=
field
(
validator
=
[
validators
.
instance_of
(
xr
.
Dataset
),
])
thresholds
:
str
=
field
(
validator
=
[
validators
.
instance_of
(
Dict
),
])
def
spatial_var
(
rad
,
threshold
):
def
spatial_var
(
rad
,
threshold
):
...
...
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