Skip to content

Commit

Permalink
dvv plot revamp (temp)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLecocq committed May 25, 2023
1 parent 5ffd050 commit f17f461
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions msnoise/plots/dvv.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,24 @@ def main(mov_stack=None, dttname="M", components='ZZ', filterid=1,
break

fig, axes = plt.subplots(len(mov_stacks), 1, sharex=True, figsize=(12, 9))

plt.subplots_adjust(bottom=0.06, hspace=0.3)
for i, mov_stack in enumerate(mov_stacks):
current = start
plt.sca(axes[i])
try:
plt.sca(axes[i])
except:
plt.sca(axes)
plt.title('%i Days Moving Window' % mov_stack)
for comps in components:
try:
dvv = xr_get_dvv(comps, filterid, mov_stack)
except:
continue
plt.plot(dvv.index, dvv.loc[:,("m", "weighted_mean")] * -100, label=comps)
# plt.plot(dvv.index, dvv.loc[:, ("m", "50%")] * -100, label=comps)
for _ in ["mean", "50%", "trimmed_mean", "weighted_mean"]:
plt.plot(dvv.index, dvv.loc[:, ("m", _)] * -100, label="%s: %s" % (comps,_ ))
for _ in ["5%","95%"]:
plt.plot(dvv.index, dvv.loc[:, ("m", _)] * -100, label="%s: %s" % (comps,_ ))

plt.ylabel('dv/v (%)')
if i == 0:
Expand Down
2 changes: 2 additions & 0 deletions msnoise/scripts/msnoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,8 @@ def dvv_plot_dvv(ctx, mov_stack, comp, dttname, filterid, pair, all, show, outfi
Remember to order stations alphabetically !
"""
if ctx.obj['MSNOISE_custom']:
import sys, os
sys.path.append(os.getcwd())
from dvv import main
else:
from ..plots.dvv import main
Expand Down

0 comments on commit f17f461

Please sign in to comment.