SalishSeaCast / tools

Collection of tools for working with the SalishSeaCast MEOPAR NEMO model, its results, and associated data.
https://salishsea-meopar-tools.readthedocs.io/en/latest/index.html
Apache License 2.0
2 stars 4 forks source link

Create nowcast.figures.research.tracer_thalweg_and_surface module #36

Closed douglatornell closed 5 months ago

douglatornell commented 8 years ago

Original report by Doug Latornell (Bitbucket: douglatornell, GitHub: douglatornell).


Produce a figure that shows a thalweg profile and surface map of the values of a tracer; similar to the figures in http://nbviewer.ipython.org/urls/bitbucket.org/salishsea/analysis/raw/tip/Muriel/ExploringNowcast_GreenOutputs-SWC.ipynb

douglatornell commented 8 years ago

Original comment by Doug Latornell (Bitbucket: douglatornell, GitHub: douglatornell).


Differences between the figure produced by tracer_thalweg_and_surface and the figures in the notebook:

There are some work-in-progress docs about creating nowcast.figures modules at http://salishsea-meopar-tools.readthedocs.io/en/latest/SalishSeaNowcast/figures.html. There are also a couple of example modules:

Create a notebook to test the new module: nowcast/notebooks/figures/research/TestTracerThalwegAndSurfaceModule.ipynb

Minimizing the rendered figure size is important for performance of the web site pages.

#!python

fig.savefig('test.svg', facecolor=fig.get_facecolor(), bbox_inches='tight')

where fig is the object returned by tracer_thalweg_and_surface(), should produce a file that is hundreds of kb, not several Mb. That's why salishsea_tools.visualisations.contour_thalweg() uses contourf() instead of pcolormesh(), and nowcast.figures.shared.plot_map() produces a PNG rendering of a collection of polygon patches instead of the polygons themselves.

Minimizing the time that it takes to generate the figure object is also a good thing. That's why we slice datasets before plotting them instead of using matplotlib axes methods to crop large objects.

Other size or figure generation time optimization ideas are welcome!

We don't yet have recommended colour maps and contour levels lists for tracers other than salinity and temperature (see contour_thalweg() for the ones for those). Exploring the results datasets in /results/SalishSea/nowcast-green/ and coming up with notes on colour maps and contour levels lists for the various tracers would be a good thing to do. However finalization of those requires discussion with Elise, Susan and others who have domain knowledge about what is important to see for each of the tracers.

douglatornell commented 5 months ago

This was implemented after SalishSeaNowcast was moved to a separate repo.