Commit 0596f010 authored by Antoine Berchet's avatar Antoine Berchet
Browse files

t push origin deveMerge branch 'devel' of gitlab.in2p3.fr:satinv/cif into devel

parents 2325a02c d4c25a8f
......@@ -89,8 +89,6 @@ datavect:
dir_obs: /tmp/PYCIF_DATA_TEST//FLEXPART/CH4/TEST_INPUT/OBS/GHG/*.cn.*2012*
dump: true
filter_time_of_day:
- 0
- 15
- 21
format: std
measerr: 5.0
......
......@@ -86,8 +86,6 @@ datavect:
dir_obs: /tmp/PYCIF_DATA_TEST//FLEXPART/CH4/TEST_INPUT/OBS/GHG/*.cn.*2012*
dump: true
filter_time_of_day:
- 0
- 15
- 21
format: std
measerr: 5.0
......
......@@ -248,7 +248,7 @@ def adjoint(
coords1, dims)
dpavgs = xr.DataArray(np.diff(-pavgs, axis=0), coords1, dims)
qa0 = sat_aks["qa0"][:, ::-1].T
drycols = qa0 * 0.0
# Applying aks
nbformula = transf.formula
chosenlevel = getattr(transf, "chosenlev", 0)
......@@ -268,7 +268,7 @@ def adjoint(
obs_incr = apply_ak_ad(
sim_ak, dpavgs.values, aks.values,
nbformula, qa0.values, chosenlevel, obs_incr.values
nbformula, qa0.values, chosenlevel, obs_incr.values, drycols.values
)
obs_incr[np.isnan(obs_incr)] = 0.
......
......@@ -36,14 +36,14 @@ def apply_ak(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel, drycols):
def apply_ak_tl(
sim_ak_tl, dpavgs, aks, nbformula, qa0, chosenlevel, sim_ak
sim_ak_tl, dpavgs, aks, nbformula, qa0, chosenlevel, sim_ak, drycols
):
if nbformula == 1 or nbformula == 2 or nbformula == 4:
y0 = apply_ak(sim_ak_tl, dpavgs, aks, nbformula, qa0, chosenlevel)
y0 = apply_ak(sim_ak_tl, dpavgs, aks, nbformula, qa0, chosenlevel,drycols)
elif nbformula == 3:
tmp = sim_ak_tl / (sim_ak * np.log(10))
y0 = apply_ak(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel)
y0 = apply_ak(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel, drycols)
y0 = y0 * np.log(10) * np.nansum(aks * tmp, axis=0)
else:
......@@ -52,7 +52,7 @@ def apply_ak_tl(
return y0
def apply_ak_ad(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel, obs_incr):
def apply_ak_ad(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel, obs_incr, drycols):
if nbformula == 1:
obs_incr = (
dpavgs
......@@ -65,7 +65,7 @@ def apply_ak_ad(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel, obs_incr):
obs_incr = aks * obs_incr
elif nbformula == 3:
y0 = apply_ak(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel)
y0 = apply_ak(sim_ak, dpavgs, aks, nbformula, qa0, chosenlevel, drycols)
y0 *= np.log(10) * obs_incr
y0 = aks * y0
prof = sim_ak * np.log(10)
......
......@@ -341,6 +341,7 @@ def forward(
qa0.values,
chosenlevel,
sim_ak.values,
drycols.values
)
# Saves sim_ak for later use by adjoint
......
Supports Markdown
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