Skip to content

Commit c67fbe0

Browse files
committed
updated docs for v2
1 parent 656c8be commit c67fbe0

File tree

142 files changed

+382
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+382
-377
lines changed

docs/.buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: ba48f7f908e83efff31afd02f973229f
3+
config: f17918d39cbb9f9f1aba14e58eff124d
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/_downloads/3628df5e83e1bc708f296aad956cb771/tutorial_2_detect_transients.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
mean=True, std=True, verbose=True)
131131
"""
132132
TUT: Res_noreg Mean Standard Deviation
133-
Total-Displacement_Model_Total -2.193582e-08 2.046182
133+
Total-Displacement_Model_Total -2.193765e-08 2.046182
134134
"""
135135

136136
# plot fit and residual
@@ -172,7 +172,7 @@
172172
mean=True, std=True, verbose=True)
173173
"""
174174
TUT: Res_L2 Mean Standard Deviation
175-
Total-Displacement_Model_Total -5.627219e-09 2.088274
175+
Total-Displacement_Model_Total -5.627180e-09 2.088274
176176
"""
177177

178178
# save transient parameters
@@ -215,7 +215,7 @@
215215
mean=True, std=True, verbose=True)
216216
"""
217217
TUT: Res_L1 Mean Standard Deviation
218-
Total-Displacement_Model_Total -1.123779e-10 2.077788
218+
Total-Displacement_Model_Total 2.171535e-10 2.07782
219219
"""
220220

221221
# save transient parameters
@@ -304,7 +304,7 @@
304304
"""
305305
Number of nonzero spline parameters:
306306
L2: 264
307-
L1: 77
307+
L1: 76
308308
L0: 67
309309
"""
310310

docs/_downloads/9be36589c021d054ce504486aa37fab6/example_1_longvalleycaldera.py

+36-33
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,11 @@
100100

101101
# estimate the common mode, either with a visualization of the result or not
102102
# (same underlying function)
103-
# net.graphical_cme(ts_in="raw_filt_res", ts_out="common", method="ica")
103+
# net.graphical_cme(ts_in="raw_filt_res", ts_out="common",
104+
# method="ica", rng=np.random.default_rng(0))
104105
# calculate common mode
105-
net.call_netwide_func("decompose", ts_in="raw_filt_res", ts_out="common", method="ica")
106+
net.call_netwide_func("decompose", ts_in="raw_filt_res", ts_out="common",
107+
method="ica", rng=np.random.default_rng(0))
106108
# now remove the common mode, call it the "intermed" timeseries,
107109
for station in net:
108110
station.add_timeseries("intermed", station["raw_clean"] - station["common"],
@@ -552,8 +554,21 @@ def R(angle):
552554
lvc_data_transient_main = {name: (lvc_data_transient[name][:, :2] @ R(rots[name]))[:, 0]
553555
for name in lvc_names}
554556

557+
# calculate optimal offsets between lines
558+
uniq_t = np.unique([i for name in rots_sort_dist.keys() for i in lvc_data[name].index]
559+
).astype(np.datetime64)
560+
full_by_dist = np.full((len(rots_sort_dist), uniq_t.size), np.NaN)
561+
for i, name in enumerate(rots_sort_dist.keys()):
562+
full_by_dist[i, np.isin(uniq_t, lvc_data[name].index.values)] = \
563+
lvc_data_transient_main[name] - lvc_data_transient_main[name][0]
564+
temp = full_by_dist[0, :].copy()
565+
offsets = [0]
566+
for i in range(1, len(rots_sort_dist)):
567+
o = -np.nanmin(full_by_dist[i, :] - temp) + 20
568+
offsets.append(o)
569+
temp = np.fmax(full_by_dist[i - 1, :], full_by_dist[i, :] + o)
570+
555571
# start transient plot by distance
556-
offsets = [0, 30, 80, 125, 155, 205, 245, 285, 345, 330, 430, 465, 500, 540]
557572
fig, ax = plt.subplots(figsize=(5, 8))
558573
for i, name in enumerate(rots_sort_dist.keys()):
559574
ax.plot(lvc_data[name].index,
@@ -562,27 +577,11 @@ def R(angle):
562577
ax.plot(lvc_data[name].index,
563578
lvc_transient_main[name] - lvc_data_transient_main[name][0] + offsets[i])
564579
if name == "CASA":
565-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"),
566-
offsets[i] + 30), ha="left", va="bottom")
567-
elif name == "CA99":
568-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(50, "D"),
569-
offsets[i] - 30), ha="center", va="bottom")
570-
elif name == "KRAC":
571-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"),
572-
offsets[i] + 10), ha="right", va="center")
573-
elif name == "DDMN":
574-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"),
575-
offsets[i] - 10), ha="right", va="center")
576-
elif name == "BALD":
577-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"),
578-
offsets[i] - 10), ha="right", va="center")
579-
elif name == "WATC":
580-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"),
581-
offsets[i] + 10), ha="right", va="center")
580+
ax.annotate(name, (lvc_data[name].index[0],
581+
offsets[i] + 20), ha="left", va="bottom")
582582
else:
583583
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"),
584584
offsets[i]), ha="right", va="center")
585-
if name != "CASA":
586585
ax.annotate(f"{rots[name]:.0f}°",
587586
(lvc_data[name].index[-1] + pd.Timedelta(100, "D"),
588587
lvc_transient_main[name][-1] - lvc_data_transient_main[name][0]
@@ -598,8 +597,19 @@ def R(angle):
598597
fig.savefig(plot_dir / f"example_1g_expansion_dist.{fmt}", dpi=300)
599598
plt.close(fig)
600599

600+
# calculate optimal indices by azimuth
601+
full_by_azim = np.full((len(rots_sort_azim), uniq_t.size), np.NaN)
602+
for i, name in enumerate(rots_sort_azim.keys()):
603+
full_by_azim[i, np.isin(uniq_t, lvc_data[name].index.values)] = \
604+
lvc_data_transient_main[name] - lvc_data_transient_main[name][0]
605+
temp = full_by_azim[0, :].copy()
606+
offsets = [0]
607+
for i in range(1, len(rots_sort_azim)):
608+
o = -np.nanmin(full_by_azim[i, :] - temp) + 20
609+
offsets.append(o)
610+
temp = np.fmax(full_by_azim[i - 1, :], full_by_azim[i, :] + o)
611+
601612
# start transient plot by azimuth
602-
offsets = [0, 50, 70, 90, 145, 165, 210, 250, 280, 310, 360, 405, 445, 485]
603613
fig, ax = plt.subplots(figsize=(5, 8))
604614
for i, name in enumerate(rots_sort_azim.keys()):
605615
ax.plot(lvc_data[name].index,
@@ -608,18 +618,11 @@ def R(angle):
608618
ax.plot(lvc_data[name].index,
609619
lvc_transient_main[name] - lvc_data_transient_main[name][0] + offsets[i])
610620
if name == "CASA":
611-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(50, "D"), offsets[i] + 30),
612-
ha="left", va="bottom")
613-
elif name == "CA99":
614-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(50, "D"), offsets[i] + 10),
615-
ha="center", va="bottom")
616-
elif name == "TILC":
617-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"), offsets[i] + 10),
618-
ha="right", va="center")
621+
ax.annotate(name, (lvc_data[name].index[0],
622+
offsets[i] + 30), ha="left", va="bottom")
619623
else:
620-
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"), offsets[i]),
621-
ha="right", va="center")
622-
if name != "CASA":
624+
ax.annotate(name, (lvc_data[name].index[0] - pd.Timedelta(100, "D"),
625+
offsets[i]), ha="right", va="center")
623626
ax.annotate(f"{rots[name]:.0f}°",
624627
(lvc_data[name].index[-1] + pd.Timedelta(100, "D"),
625628
lvc_transient_main[name][-1] - lvc_data_transient_main[name][0]

docs/_images/example_1b_DOND.png

452 Bytes

docs/_images/example_1b_LINC.png

-20 Bytes

docs/_images/example_1b_P628.png

-225 Bytes

docs/_images/example_1b_P636.png

-258 Bytes

docs/_images/example_1b_TILC.png

-29 Bytes

docs/_images/example_1b_WATC.png

131 Bytes

docs/_images/example_1c_CASA.png

89 Bytes

docs/_images/example_1c_JNPR.png

-1.25 KB

docs/_images/example_1c_KNOL.png

-46 Bytes

docs/_images/example_1c_MUSB.png

672 Bytes

docs/_images/example_1c_P723.png

88 Bytes

docs/_images/example_1d.png

442 Bytes

docs/_images/example_1e_corr.png

-539 Bytes

docs/_images/example_1e_scalo.png

1.38 KB

docs/_images/example_1e_seasonal.png

-215 Bytes

docs/_images/example_1e_transient.png

-366 Bytes

docs/_images/example_1e_ts.png

-155 Bytes

docs/_images/example_1f.png

1.22 KB
-11.9 KB
2.69 KB
-1.02 KB
-556 Bytes

docs/_images/example_2_modeled_na.png

1.83 KB

docs/_images/example_2_predicted.png

677 Bytes

docs/_images/example_2_residuals.png

3.58 KB

docs/_images/example_2_single.png

-73.7 KB

docs/_images/tutorial_1a.png

0 Bytes

docs/_images/tutorial_1b.png

0 Bytes

docs/_images/tutorial_1c.png

0 Bytes

docs/_images/tutorial_2a.png

0 Bytes

docs/_images/tutorial_2b.png

0 Bytes

docs/_images/tutorial_2c.png

0 Bytes

docs/_images/tutorial_2d.png

0 Bytes

docs/_images/tutorial_2e.png

0 Bytes

docs/_images/tutorial_2f.png

0 Bytes

docs/_images/tutorial_2g.png

0 Bytes

docs/_images/tutorial_2h.png

0 Bytes

docs/_images/tutorial_2i.png

0 Bytes

docs/_images/tutorial_2j.png

0 Bytes
-3.54 KB
-363 Bytes
1.81 KB

docs/_images/tutorial_4a_map.png

0 Bytes

docs/_images/tutorial_4b_ts_S1.png

0 Bytes

docs/_images/tutorial_4c_scalo_S2.png

0 Bytes

docs/_images/tutorial_4c_ts_S2.png

0 Bytes

docs/_images/tutorial_4d_corr_S2.png

0 Bytes

docs/_images/tutorial_4e_corr_S2.png

0 Bytes

docs/_images/tutorial_4f_corr_S2.png

0 Bytes

docs/_images/tutorial_4g_corr_S2.png

0 Bytes

docs/_images/tutorial_5_S20N50_10.png

-221 KB

0 commit comments

Comments
 (0)