Commit 7d3c62a3 authored by Florian Ziemen's avatar Florian Ziemen
Browse files

paraview ocean and atm 2d examples

parent 866b41a0
Pipeline #4585 passed with stages
in 14 seconds
.. _set-background:
Set the background (color/gradient)
==================================================
.. _set-current-background:
Set the background of the curret plot
--------------------------------------------------
To set the background of your current project go to properties of any object, type ``backg`` into the text field, and chose a background of your liking. Chosing pink might help looking for holes in your data - or making your plot a bit *special*.
.. image:: background/set-background.png
.. image:: background/pink-background.png
.. _set-default-background:
Set the default background
----------------------------------------
To set the default background :ref:`open-settings` and adjust it in the ``Color Palette`` tab
.. image:: background/set-default-background.png
.. _camera-parallel-projection:
Switch to camera parallel projection
========================================
If you are using paraview for 2D mapping, switching to camera parallel projection helps removing projection artifacts.
.. image:: camera_parallel_projection/activate_camera_parallel_projection.png
.. Vis documentation master file, created by
sphinx-quickstart on Tue Sep 8 11:52:42 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Camera and perspective
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob:
*
.. */index
.. _set-view-size:
Set the view size
====================
When preparing to export images for a video or similar, forcing paraview to display the image with *correct* proportions makes things a lot easier.
Go to ``View->Preview`` and chose the aspect ratio and size of the final product.
.. image:: ./view-size/view-size-fhd.png
Your screen display will be adjusted accordingly
.. image:: ./view-size/fhd-preview.png
......@@ -4,7 +4,7 @@ Chose a different colormap
----------------------------------------
.. note::
This document is part of a series teaching how to :ref:`create_image_sea_surface_speeds`
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`
In the top left part of the paraview window, there is a color ar with a small green circle. This allows you to chose a color map.
......
.. Vis documentation master file, created by
sphinx-quickstart on Tue Sep 8 11:52:42 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Colormaps
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob:
*
.. */index
.. _prettify-colorbar:
Adjust the color bar and its legend
===================================
..
.. _get-colorbar-editor:
Open the colorbar editor
------------------------------
Open the colormap editor (``View->Color Map Editor``) and chose the top right icon (a color bar with an ``e`` in the icon).
.. image:: prettify-colorbar/get-colorbar-editor.png
Choose the gear at the top right of the menu (activates the display of less *important* aspects like the top/bottom value labels), insert a more precise label text in the ``Title`` field, e.g. "Ocean surface speed (m/s)" and set the format for the range labels (top/bottom values) to ``%.0f`` (floating-point with zero digits behind the ``.``). Use ``Apply`` to check your results and finally leave the menu with ``OK``.
.. image:: prettify-colorbar/adjust-colorbar-labels.png
The result should look somewhat like
.. image:: prettify-colorbar/adjusted-colorbar-labels.png
......@@ -4,7 +4,7 @@ Rescale the colormap to a custom range
========================================
.. note::
This document is part of a series teaching how to :ref:`create_image_sea_surface_speeds`
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`
Use this button to rescale your color map to a custom range or chose a custom color for monochromatic displays
......
.. _save-colormap-preset:
Save the colormap as a preset
========================================
Go to the colormap editor, chose the ``Save to preset`` option next to the preview.
.. image:: ./save-to-preset/save-colormap.png
You can give the colormap a name, and chose to also save the opacity information.
.. image:: ./save-to-preset/name-dialogue.png
If this name cannot be found in the following pop-up dialogue, search for ``Preset`` in the top menu and rename...
.. image:: ./save-to-preset/change-name.png
.. _colormap-transparent-clouds:
Adjust the color map for a transparent display of clouds
============================================================
.. note::
This document is based on a series teaching how to :ref:`display-transparent-clouds`
Here, we display clouds as white overlay with the opacity adjusted by the value of the field.
First :ref:`rescale-colormap-to-custom` to 0-1. We have alpbedo (alpha) values between 0 and 1.
Now go to the color map editor
Delete the center point in the bar with the color gradient (saves the effort of setting it to white).
``Enable opacity mapping for surfaces`` in the checkboxes below the bar.
Set the R/G/B values to 1 in the ``Color transfer function values`` section, and reduce the maximum opacity to 0.8 in the ``Opacity transfer function``. Play with the opacity value to find your favorite compromise between visibility of clouds and background.
Things should now be changed from
.. image:: transparent-clouds/fields-to-change.png
to
.. image:: transparent-clouds/fields-changed.png
Your result should look like
.. image:: transparent-clouds/transparent-clouds-ocean-speeds.png
Don't forget to :ref:`save-colormap-preset`.
.. _create_image_sea_surface_speeds:
.. _create-image-sea-surface-speeds:
Create an image of sea surface speeds
===========================================
......@@ -8,12 +8,16 @@ These steps will get you from
.. image:: 00-empty-main.png
to
via
.. image:: 10-ocean-speeds.png
to
.. image:: 2d-ocean-with-earth-and-adjustments.png
.. note::
Whatever you do with paraview. Keep saving state files (``File -> Save State``) at regular intervals. You can additionally :ref:`make-paraview-save-on-quit-or-crash`.
Whatever you do with paraview, keep saving state files (``File -> Save State``) (see :ref:`save-state`) at regular intervals. You can additionally :ref:`make-paraview-save-on-quit-or-crash`.
You might need to :ref:`activate_the_cdi_reader_plugin`
......@@ -28,3 +32,12 @@ For tuning your resulting image, you can
* :ref:`rescale-colormap-to-custom`
* :ref:`deactivate-light-kit`
* :ref:`texture-map-to-plane` to fill the holes in the ocean.
* :ref:`camera-parallel-projection` to reduce projection artifacts
* :ref:`set-background` (and its default).
* :ref:`prettify-colorbar`
Finally you can de-activate the display of the coordinate system in the bottom right by clicking the icon with the eye and the coordinate axis in the right of the menu (see :ref:`main-screen`).
To prepare for export (as/for a video) you should :ref:`set-view-size` before you :ref:`export-animation`.
You can continue by :ref:`display-transparent-clouds`
.. _display-transparent-clouds:
Display clouds as a semi-transparent overlay
==================================================
.. note::
This document is based on a series teaching how to :ref:`create-image-sea-surface-speeds`. If you continue from this, or other work, don't forget to :ref:`save-state`. If not, you might want to :ref:`texture-map-to-plane` to get a nice background.
First, load ``clivi_cllvi_newtime.nc`` (see :ref:`load-2d-icon` for details).
Then add a calculator with the equation
.. code-block::
(3/2 * (cllvi + clivi * 5) * 100)/ (3/2 * (cllvi + clivi * 5) * 100 + 7)
This is a rough conversion from vertically integrated cloud water and ice to optical density / albedo.
and call the result ``alpha`` (see :ref:`calculator-uv-speed`).
:ref:`colormap-transparent-clouds`
Disable the display of the color bar for the clouds (top left of :ref:`main-screen`).
Your result should look like
.. image:: transparent-clouds.png
Finally :ref:`save-state`, and :ref:`export-animation`.
......@@ -11,5 +11,6 @@ Paraview examples
:caption: Contents:
:glob:
*
*/index
.. *
.. _export-animation:
Export an animation
==============================
.. note::
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`
.. warning::
Before you start exporting :ref:`save-state`. Things can go wrong and often you want to reproduce a saved animation (with small changes).
It has proven useful to export to a sequence of png files that can then be concatenated using ``ffmpeg``.
Chose ``File->Export Animation``, enter a base file name (will be expanded by _0123/..., see the ``Suffix format`` field in the following dialogue), and ensure the correct image size in the following dialogue.
.. image:: export-animation/export-basic-screen.png
(If you change the size of the saved animation, you might want to toggle the gear in the top left and change the font scaling option, but really -- :ref:`set-view-size` beforehand!)
.. image:: export-animation/export-advanced-screen.png
This will generate a sequence of .png files. For a quick impression you can run through them using ``eog FILENAME*.png`` on linux, or preview on a mac.
.. note::
FFMPEG is not included in the software image on the VM of the ESiWACE2 HPDA and Vis course. On DKRZ's supercomputer mistral you can find a reasonable ffmpeg on the GPU nodes.
If you have a reasonable complete ffmpeg, this shell script will work:
.. code-block:: bash
#!/bin/bash
set -evxu
output_framerate=${output_framerate:-5}
ffmpeg -framerate $output_framerate -pattern_type glob -i "$1" -c:v libx264 -r $output_framerate -pix_fmt yuv420p $2
Save it as ``ffmglob``, do ``chmod a+x ffmglob`` to make it executable and then call it as ``./ffmglob 'FILENAME*.png' speeds.mp4`` -- yes, you need the quotes around the FILENAME expression.
......@@ -8,7 +8,7 @@ Apply a calculator to convert u and v into speed
-------------------------------------------------
.. note::
This document is part of a series teaching how to :ref:`create_image_sea_surface_speeds`
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`
Here we assume you alred :ref:`loaded 2D ocean data<load-2d-icon>`
......
.. Vis documentation master file, created by
sphinx-quickstart on Tue Sep 8 11:52:42 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Filters
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob:
*
.. */index
......@@ -6,7 +6,11 @@ Add an image as texture (plane) in the background
.. note::
This document is part of a series teaching how to :ref:`create_image_sea_surface_speeds`
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`.
See also :ref:`texture-map-to-sphere`
You can find beautiful images on the `NASA Blue Marble Next Generation page <https://visibleearth.nasa.gov/collection/1484/blue-marble>`_ For this example, you can use `a low-res version of the February image <https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74268/world.topo.200402.3x5400x2700.jpg>`_.
As our ocean data set has *holes* on the land points, we have to first create a plane *behind* it, before we can attach an image of Earth.
......@@ -40,7 +44,7 @@ Now use the text box and search for texture. Click the ``Texture`` dropdown menu
.. image:: texture-map-to-plane/03-find-texture-field.png
Pick the small blue marble from the directory with the sample data (or use any one of NASA's Blue Marble images (Thanks, NASA for that great service!).
Pick the small blue marble from the directory with the sample data (or use any one of NASA's Blue Marble images, e.g. `the low-res version of the February image <https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74268/world.topo.200402.3x5400x2700.jpg>`_. (Thanks, NASA for that great service!).
.. image:: texture-map-to-plane/04-texture-file.png
......
.. _texture-map-to-sphere:
Add an image as texture on a sphere
========================================
Create a sphere and follow the steps for mapping a texture to a plane in :ref:`texture-map-to-plane`, replacing *plane* by *sphere*. For CDI reader data (e.g. ICON), the radius should be 200.
Some adjustments are necessary. If you use a custom-created sphere, increase the resolution in teta and phi in the properties of the sphere (not the texture mapping).
.. image:: ../Sources/Sphere/sphere-resolution.png
To avoid a seam set the theta-range to 359.999
.. image:: ./texture-map-to-sphere/theta-range.png
To match the projection to that of icon data set all scalings to -.999
.. image:: ./texture-map-to-sphere/scale-texture.png
......@@ -5,7 +5,7 @@ Deactivate the light kit
.. note::
This document is part of a series teaching how to :ref:`create_image_sea_surface_speeds`
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`
......@@ -19,4 +19,4 @@ Use the checkbox in the top left corner to deactivate the light kit.
.. image:: deactivate-light-kit/02-light-inspector.png
If you followed the whole series of :ref:`create_image_sea_surface_speeds`, your result should look like this:
If you followed the whole series of :ref:`create-image-sea-surface-speeds`, your result should look like this:
.. Vis documentation master file, created by
sphinx-quickstart on Tue Sep 8 11:52:42 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Light
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob:
*
.. */index
......@@ -5,7 +5,7 @@ Activate the CDI reader plugin
.. note::
This document is part of a series teaching how to :ref:`create_image_sea_surface_speeds`
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`
For loading ICON data, we need to activate the CDI reader plugin (on Mistral it's active by default)
......
.. _netcdf-cf-reader:
The NetCDF CF reader
========================================
You can use the NetCDF CF reader to load data on regular (and distorted) grids.
Issues:
* The reader cannot handle negative time information (will give an error along the lines of "start + count exceeds dimension bounds").
* The reader cannot display distorted grids in the plane (e.g. most ocean models)
* The reader cannot handle a 2D field that has a depth axis (use ``cdo -setzaxis,surface INFILE OUTFILE`` or ``ncwa -a NAME_OF_DEPTH_DIMENSION INFILE OUTFILE`` to prepare files; affects a lot of MPI-OM output).
* Ocean models tend to give positive values for depth. That requires a couple switches in the reader, see :ref:`load-nemo`.
* Nemo grids cause weird hick-ups.
.. Vis documentation master file, created by
sphinx-quickstart on Tue Sep 8 11:52:42 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Readers
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob:
*
.. */index
......@@ -4,7 +4,7 @@ Load 2D ICON data with the CDI reader
-------------------------------------
.. note::
This document is part of a series teaching how to :ref:`create_image_sea_surface_speeds`
This document is part of a series teaching how to :ref:`create-image-sea-surface-speeds`
You might need to :ref:`activate_the_cdi_reader_plugin`
......
.. _load-nemo:
Load NEMO 3D data with the netCDF CF reader
==================================================
In Paraview 5.7, you can kind of load nemo data using the netCDF CF reader.
Settings that get you some idea of the output are
``Spherical Coordinates``
``Vertical Scale = -0.1``
``Vertical Bias = 1000``
``Replace Fill Value with NaN``
.. image:: ./Nemo/nemo-with-netCDF-CF-reader.png
......@@ -6,6 +6,10 @@
Documentation for visualization with Paraview
===================================================
Start by having a look at :ref:`main-screen` or take a guided tour and :ref:`create-image-sea-surface-speeds`
Or chose from the full menue:
.. toctree::
:maxdepth: 2
:caption: Contents:
......
source/Paraview/main_screen.png

2.29 MB | W: | H:

source/Paraview/main_screen.png

1.96 MB | W: | H:

source/Paraview/main_screen.png
source/Paraview/main_screen.png
source/Paraview/main_screen.png
source/Paraview/main_screen.png
  • 2-up
  • Swipe
  • Onion skin
.. _main-screen:
The Paraview main screen
===============================
......@@ -5,4 +7,5 @@ Here's the paraview main screen
.. image:: main_screen.png
It has a lot of little fields to toggle
The windows for all sub-modules can be anchored in the main screen on either side or at the top/bottom. Here, we have the pipeline above a block featuring properties, and information on the left. The right hand side is shared between the Color Map Properties and the Light Inspector.
.. _camera-controls:
Adjust / check the camera controls
==================================================
In the Settings you can adjust or just check the mouse bindings for controlling the camera.
.. image:: preferences/controls.png
.. Vis documentation master file, created by
sphinx-quickstart on Tue Sep 8 11:52:42 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Technical
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob: