Commit 8f2d6ac7 authored by Clément Haëck's avatar Clément Haëck
Browse files

Smooth SN_separation threshold

parent 4d3269bc
......@@ -31,7 +31,8 @@ def main():
ds = lib.data.hi.get_data(args)
sst = lib.data.ostia.get_data(args)
thr = lib.data.SN_separation.get_data(args)['threshold']
thr = lib.data.SN_separation.get_data(args)
thr = lib.data.SN_separation.smooth(thr, time_step=8)
hi = lib.data.hi.apply_coef(ds, lib.data.hi.get_coef(args))
hi = hi.where(sst.analysed_sst < thr)
......
......@@ -13,9 +13,7 @@ import xarray as xr
import lib
import lib.data.ostia
import lib.data.globcolour
import lib.data.SN_separation
import Plots.util as plot_util
from Plots.Images.examples import examples
from Compute.gs_zones_gauss import _get_separation
plot_util.set_style()
......@@ -35,12 +33,10 @@ fixes = dict(
st = lib.data.ostia.get_data(args, fixes=fixes)
gc = lib.data.globcolour.get_data(args, fixes=fixes)
thr = lib.data.SN_separation.get_data(args, fixes=fixes)
sst = st.analysed_sst.isel(time=0)
chl = gc.CHL.isel(time=0)
thr = lib.fix_time_daily(thr)
values = sst.sel(lat=slice(32, None))
separation = _get_separation(values.to_masked_array().compressed(), '')
threshold = separation['threshold']
......
......@@ -35,6 +35,7 @@ gc = gc.sel(lat=slice(None, lat_min))
hi = hi.sel(lat=slice(None, lat_min))
th = lib.data.SN_separation.get_data(fixes=fixes)
th['threshold'] = lib.data.SN_separation.smooth(th, time_step=8)
th = lib.fix_time_daily(th)
th = th.sel(time=datetime(fixes['Y'], fixes['m'], fixes['d']))
st['mask'] = st.analysed_sst > th.threshold.values
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment