Skip to content
Snippets Groups Projects
Commit 0b9cb76a authored by Paolo Veglio's avatar Paolo Veglio
Browse files

started working on restoral tests

parent 36044921
No related branches found
Tags 0.2.3
No related merge requests found
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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment