Skip to content

Commit

Permalink
Update nbs
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhu2e committed Jan 25, 2024
1 parent a7c52a3 commit 6f01cc7
Show file tree
Hide file tree
Showing 89 changed files with 9,466 additions and 630 deletions.
14 changes: 8 additions & 6 deletions cfr/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,14 @@ def plot(self, **kwargs):

kwargs['title'] = f'{self.da.name}, {date_str}'

if len(set(np.diff(self.da.lon))) > 1:
# the case when longitudes cross 0 degree
fd_plot = self.wrap_lon(mode='180')
kwargs['central_longitude'] = 0
else:
fd_plot = self
# if len(set(np.diff(self.da.lon))) > 1:
# # the case when longitudes cross 0 degree
# fd_plot = self.wrap_lon(mode='180')
# kwargs['central_longitude'] = 0
# else:
# fd_plot = self

fd_plot = self

_kwargs.update(kwargs)

Expand Down
7 changes: 4 additions & 3 deletions cfr/reconjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ def run_graphem(self, save_recon=True, save_dirpath=None, save_filename=None,
fit_kws (dict): the arguments for :py:meth: `GraphEM.solver.GraphEM.fit`
The most important one is "graph_method"; available options include "neighborhood", "glasso", and "hybrid", where
"hybrid" means run "neighborhood" first with default `cutoff_radius=1500` to infill the data matrix and then
ran "glasso" with default `sp_FF=3, sp_FP=3` to improve the result further.
ran "glasso" with default `sp_FF=3, sp_FP=3, sp_PP=3` to improve the result further.
See also:
cfr.graphem.solver.GraphEM.fit : fitting the GraphEM method
Expand Down Expand Up @@ -1074,6 +1074,7 @@ def run_graphem(self, save_recon=True, save_dirpath=None, save_filename=None,
'cutoff_radius': 1500,
'sp_FF': 3,
'sp_FP': 3,
'sp_PP': 3,
}
fit_kwargs.update(fit_kws)
if fit_kwargs['graph_method'] in ['neighborhood', 'glasso']:
Expand All @@ -1098,7 +1099,7 @@ def run_graphem(self, save_recon=True, save_dirpath=None, save_filename=None,
field = self.graphem_solver.field_r[inst],
proxy = self.graphem_solver.proxy_r[inst,:])

G_L.glasso_adj(target_FF=fit_kwargs['sp_FF'], target_FP=fit_kwargs['sp_FP'])
G_L.glasso_adj(target_FF=fit_kwargs['sp_FF'], target_FP=fit_kwargs['sp_FP'], target_PP=fit_kwargs['sp_PP'])
fit_kwargs.update({'estimate_graph': False, 'graph': G_L.adj})
self.graphem_solver.fit(
self.graphem_params['field'],
Expand Down Expand Up @@ -1235,6 +1236,6 @@ def run_graphem_cfg(self, cfg_path, verbose=False):
graph_method=self.configs['graph_method'],
cutoff_radius=self.configs['cutoff_radius'],
output_indices=self.configs['output_indices'],
sp_FF=self.configs['sp_FF'], sp_FP=self.configs['sp_FP'],
sp_FF=self.configs['sp_FF'], sp_FP=self.configs['sp_FP'], sp_PP=self.configs['sp_PP'],
verbose=verbose,
)
6 changes: 5 additions & 1 deletion cfr/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,11 @@ def plot_field_map(field_var, lat, lon, levels=50, add_cyclic_point=True,
if add_cyclic_point:
if mode == 'latlon':
field_var_c, lon_c = cutil.add_cyclic_point(field_var, lon)
# field_var_c, lon_c = acp(field_var, lon)

if signif_values is not None:
signif_values_c, lon_c = cutil.add_cyclic_point(signif_values, lon)

lat_c = lat
elif mode == 'mesh':
if len(np.shape(lat)) == 1:
Expand Down Expand Up @@ -409,7 +412,8 @@ def plot_field_map(field_var, lat, lon, levels=50, add_cyclic_point=True,
if add_gridlines:
ax.gridlines(edgecolor='gray', linestyle=':', crs=transform)

cmap = plt.get_cmap(cmap)
if cmap is not None:
cmap = plt.get_cmap(cmap)
if cmap_under is not None:
cmap.set_under(cmap_under)
if cmap_over is not None:
Expand Down
Binary file added docs/_images/notebooks_graphem-primer_15_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_16_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_28_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_30_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_32_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_33_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_47_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_50_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_52_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_57_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_59_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_5_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_72_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_75_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_77_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/notebooks_graphem-primer_78_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_14_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_32_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_36_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_3_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_42_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_42_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_42_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_43_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_43_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/notebooks_graphem-real-pages2k_43_2.png
Binary file modified docs/_images/notebooks_lmr-real-pages2k_19_0.png
Binary file modified docs/_images/notebooks_lmr-real-pages2k_28_0.png
Binary file modified docs/_images/notebooks_lmr-real-pages2k_29_0.png
Binary file modified docs/_images/notebooks_lmr-real-pages2k_32_0.png
Binary file modified docs/_images/notebooks_lmr-real-pages2k_5_0.png
File renamed without changes.
55 changes: 27 additions & 28 deletions docs/_sources/notebooks/graphem-real-pages2k.ipynb

Large diffs are not rendered by default.

228 changes: 105 additions & 123 deletions docs/_sources/notebooks/lmr-real-pages2k.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/_sources/ug-graphem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ GraphEM
.. toctree::
:maxdepth: 1

notebooks/graphem-primer
notebooks/graphem-real-pages2k
notebooks/graphem-cli
1 change: 1 addition & 0 deletions docs/cg-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="ug-graphem.html">GraphEM</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-cli.html">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions docs/cg-updating-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="ug-graphem.html">GraphEM</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-cli.html">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions docs/cg-working-with-codebase.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="ug-graphem.html">GraphEM</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-cli.html">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down
3 changes: 3 additions & 0 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="ug-graphem.html">GraphEM</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-cli.html">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down Expand Up @@ -667,6 +668,8 @@ <h2 id="P">P</h2>
<li><a href="ug-api.html#cfr.proxy.ProxyRecord.plotly">(cfr.proxy.ProxyRecord method)</a>
</li>
</ul></li>
<li><a href="ug-api.html#cfr.proxy.ProxyDatabase.plotly_concise">plotly_concise() (cfr.proxy.ProxyDatabase method)</a>
</li>
<li><a href="ug-api.html#cfr.proxy.ProxyDatabase.plotly_count">plotly_count() (cfr.proxy.ProxyDatabase method)</a>
</li>
<li><a href="ug-api.html#cfr.climate.ClimateField.plotly_grid">plotly_grid() (cfr.climate.ClimateField method)</a>
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="ug-graphem.html">GraphEM</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="notebooks/graphem-cli.html">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions docs/notebooks/climate-io.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../ug-graphem.html">GraphEM</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="graphem-cli.html">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions docs/notebooks/climate-ops.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../ug-graphem.html">GraphEM</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="graphem-cli.html">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down
1 change: 1 addition & 0 deletions docs/notebooks/graphem-cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
</ul>
</li>
<li class="toctree-l1 current active has-children"><a class="reference internal" href="../ug-graphem.html">GraphEM</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-6"><i class="fa-solid fa-chevron-down"></i></label><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="graphem-primer.html">A primer on GraphEM</a></li>
<li class="toctree-l2"><a class="reference internal" href="graphem-real-pages2k.html">Reconstructing the tropical Pacific SST with PAGES2k and GraphEM</a></li>
<li class="toctree-l2 current active"><a class="current reference internal" href="#">Running GraphEM with the Command Line Interface (CLI)</a></li>
</ul>
Expand Down
Loading

0 comments on commit 6f01cc7

Please sign in to comment.