Commit 866b41a0 authored by Florian Ziemen's avatar Florian Ziemen
Browse files

work on 2d ocean paraview example.

parent 9b4c69dd
Pipeline #4469 passed with stages
in 10 seconds
Loading 2D ICON data
===============================
An example using Ocean speeds
.. image:: 00-empty-main.png
For loading ICON data, we need to activate the CDI reader plugin (on Mistral it's active by default)
Chose Tools-> Manage Plugins
.. image:: 00a-load-plugin.png
Select the CDIReader plugin, open the detailed view, activate Auto Load, and Chose "Load selected" at the bottom.
.. image:: 00b-activate-cdi-plugin.png
Use File-> Open.., or use the top-left icon to open the file choser.
.. image:: 01-load-file.png
Chose uv.nc (get it from ....)
.. image:: 02-chose-file.png
Chose the CDI reader for ICON files -- Model with a regular (lat/lon, or stretched) grid usually go via "NetCDF Reader".
.. image:: 02a-chose-reader.png
uv.nc now appears in the top of the pipeline (top left).
You can now chose which variables to load (we want u and v). They are considered as cell arrays, as we have all grid corners for them.
Below that, you can chose the projection. We'll use Lat/Lon for now.
Some ICON Ocean data comes with zeros on land points. Then a wet_c variable can be used to get rid of land points.
With "Vertical levels" you can chose which vertical level you want to see if there's more than one in the source file (not in uv.nc).
.. image:: 03-viever-properties.png
Now we want to apply a "Calculator" filter to compute the absolute speed from the velocity.
Choose Filters->Common->Calculator, or use the calculator symbol just above the pipeline.
.. image:: 04-pipeline.png
In the calculator, you can chose the data type to operate on ("cell data" is correct here), give your result variable a sensible name (color maps are associated with these names, so "Result" can lead to conflicts and hassle once you have a second calculator). In the next field, you can define the equation that is computed. We want to use::
sqrt (u*u+v*v)
You can also use the drop-down menus at the bottom to get access to the variables available (sorted by scalars and vector quantities).
.. image:: 05-calculator.png
.. image:: 06-chose-colormap.png
.. image:: 07-colormap-overview.png
.. image:: 08-colormap-choser.png
.. image:: 09-rescale-to-custom.png
.. image:: 10-ocean-speeds.png
.. _chose-BuGn:
Chose a different colormap
----------------------------------------
.. note::
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.
In the Color Map Editor window (View-> Color Map Editor Window) it's on the right hand side of the color map preview
.. image:: chose-BuGn/06-chose-colormap.png
..
image:: chose-BuGn/07-colormap-overview.png
In the color map chooser window, you can select a color map from a wide range of options. By default, only a few of them are displayed. With the dropdown menu on the right [Default] you can chose from a couple groups or display all of them.
In the text field in the top, you can start typing letters that should appear in the name of the color bar. For anything with Blue, best chose ``b``, Python-Style names usually exist, so we just type ``Bu``.
You can chose to import a color map with its ``preset range`` (top right) - this can be useful if you e.g. customize a color map for display of annual mean temperatures and save it with that preset range for later use.
.. image:: chose-BuGn/08-colormap-choser.png
This should get you something like this:
.. image:: chose-BuGn/09-BuGn-currents.png
You can now :ref:`rescale-colormap-to-custom`.
To brighten the colors you can :ref:`deactivate-light-kit`.
.. _rescale-colormap-to-custom:
Rescale the colormap to a custom range
========================================
.. note::
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
.. image:: rescale-to-custom/09-rescale-to-custom.png
Chose 0 to 1 to get this image:
.. image:: rescale-to-custom/10-rescaled-to-custom.png
you can now :ref:`deactivate-light-kit` to make the colors stand out even better.
.. _create_image_sea_surface_speeds:
Create an image of sea surface speeds
===========================================
These steps will get you from
.. image:: 00-empty-main.png
to
.. image:: 10-ocean-speeds.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`.
You might need to :ref:`activate_the_cdi_reader_plugin`
With the cdi reader loaded, you can :ref:`load-2d-icon`
You can now :ref:`calculator-uv-speed`
With the data loaded, you can :ref:`chose-BuGn`
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.
.. 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.
Paraview examples
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob:
*
*/index
.. meta::
:description: Basic calculator usage
:keywords: calculator, magnitude, square root
.. _calculator-uv-speed:
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`
Here we assume you alred :ref:`loaded 2D ocean data<load-2d-icon>`
Now we want to apply a "Calculator" filter to compute the absolute speed from the velocity.
Choose Filters->Common->Calculator, or use the calculator symbol just above the pipeline.
.. image:: calculator-uv-speed/04-pipeline.png
In the calculator, you can chose the data type to operate on ("cell data" is correct here), give your result variable a sensible name -- we chose ``vel`` here -- ``speed`` would have been correct...
Naming your output immediately is useful, as color maps are associated with these names, so "Result" can lead to conflicts and hassle once you have a second calculator.
In the next field, you can define the equation that is computed. We want to use::
sqrt (u*u+v*v)
You can also use the drop-down menus at the bottom to get access to the variables available (sorted by scalars and vector quantities).
.. image:: calculator-uv-speed/05-calculator.png
The result should look similar to this:
.. image:: calculator-uv-speed/05a-speed-image.png
With the speed computed, you can :ref:`chose-BuGn`
Alternatively, you can :ref:`rescale-colormap-to-custom`
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment