Commit 229e3536 authored by Florian Ziemen's avatar Florian Ziemen
Browse files

PalMod complex example

parent c240467d
.. _hack-colormap:
Hack the color map:
Open the color map in the text editor. In the head edit as indicated, **but don't leave the comments indicated with #**::
"ColorSpace" : "Lab",
"Name" : "Vegetation", ##YOUR NAME
"Points" :
0.0, #NEW MINIMUM VALUE (if you want to change)
In the lower part, you will find quads with (data value, R, G, B). To change the maximum of the color map in accordance with the change in the header, edit at the bottom::
0.054901999999999999, # RED (if you want to change)
0.109804, # GREEN (if you want to change)
0.121569 # BLUE (if you want to change)
.. _invert-colormap:
Invert the Colormap
Go to the Colormap editor (``View -> Color Map Editor Window``), and choose the Black and White icon right of the display.
.. image:: invert/invert.png
.. _create-palmod-combined:
Create a multi-variable image / animation from a coupled ice sheet - climate simulation
This example will show how to create an animation based on ocean, vegetation, solid earth, river runoff, and ice sheet data. This requires substantial pre-processing, that will only be outlined here. All preprocessed files can be downloaded from the `DKRZ SwiftBrowser <>`_
.. image:: combined-image.png
In this example we assume a very basic level of familiarity with Paraview. If you feel lost in between, consider looking at :ref:`create-image-sea-surface-speeds`.
* :ref:`vegetation-data`
* :ref:`load-icebergs`
* :ref:`load-ice-sheets`
* Repeat the same exercise including :ref:`convert-cell-to-point` for ```` (variable ``topg`` for the topography and ``delta_topg`` for the isolines - copy and paste as appropriate). That should get you isolines on land.
* Also apply the contour to the pure Cell Data to Point Data filter, to get isolines on teh ocean.
.. _load-ice-sheets:
Load the ice sheets
* Load the ice sheet data from ` <>`_
* For random reasons, this file already is in point data. Attach a calculator and in the pipeline view select the calculator of the vegetation, copy it, and paste it to the newly created calculator (i.e. copy the settings to the calculator of the ice sheet). Change ``topg`` to ``ice_surf`` in the equation of the calculator.
.. image::
* Color by ``velsurf_mag``, chose ``Use log scale when mapping data to colors``, load the colormap of your choice.
* :ref:`contour-isolines` to show the bedrock displacement, and re-activate the display of the ice sheet calculator in the pipeline browser.
Feel free to repeat the exercise for Antarctica. You might need to :ref:`convert-cell-to-point` before adding the calculator (for whatever reason). Now the isolines are added on the ice, but end at the coast.
.. _load-icebergs:
Load the iceberg data
* Load the iceberg data from ` <>`_
* add a calculator that scales and outputs to ``surf_fw_out``::
* use a logarithmic color scale with the color map ``Blues``, and set min and max to 0.01 and 1. This should get you to
.. image::
Time to :ref:`load-ice-sheets`
.. _vegetation-data:
Load the vegetation data
* Open ` <>`_ ( see :ref:`open-with-cf-reader` for instructions).
* Use the variable ``veg_ratio_max``
* Load the colormap ``Linear Green (GR4l)`` (see :ref:`chose-BuGn`).
* :ref:`invert-colormap`
* For the exact colormap of this example:
* Remove the last points from the colormap (see :ref:`colormap-transparent-clouds` for hints on manipulating a color map).
* Save the colormap, open it in the text editor, :ref:`hack-colormap` to reset the maximum to .67, save it, and import it again.
* Then set the color values for the minimum and maximum value to 1/1/.67 and .118/.5/.25 respectively (see cloud example). (yes, that's tedious, but it can be done, and this is `a way`).
Your data should look roughly like this:
.. image:: vegetation-loaded.png
* :ref:`convert-cell-to-point` and :ref:`extrude-land-surface`.
your file should look like this:
.. image:: vegetation-topo.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.
.. toctree::
:maxdepth: 2
:caption: Contents:
.. */index
.. _extrude-land-surface:
Extrude a land surface based on topography
.. note::
This document is part of a series teaching how to :ref:`create-palmod-combined`.
If you don't already have it (files in the example are already prepared), you will need a (high-resolution) topography, e.g. from ``cdo -topo``.
Remap your data to the resolution of the topography. Something along the lines of::
cdo -f nc -topo # will create a topo on a 0.5 deg lat/lon grid.
cdo -merge -remapnn, MYFILE
.. note::
The calculator needs point data for processing. Often the topo data ends up being cell data. :ref:`cell-or-point` and, if necessary, :ref:`convert-cell-to-point` before applying the calculator.
Make sure the ``Attribute Type`` Setting in your calculator is on ``Point Data``, select ``Coordinate Results``, give your resulting coordinates a reasonable name, and use the equation (assuming your topography variable is called topg and in m, this yields a vertical exaggeration of 100) ::
Where the first paren scales the topography to a strong extrusion around a unit sphere, and the second part is the vector from the origin to the current grid point's position. Your topography variable should appear in the ``Scalars`` dropdown menu. If not, go back to :ref:`cell-or-point`.
.. image::
.. note::
For plane projections (Mercator, Mollweide / ...) use something along the lines of::
(1+topo/20000) * coordsZ*kHat + (coordsX*iHat+coordsY*jHat)
.. _cell-or-point:
Check if you have cell or point data
.. note::
This document is part of a series teaching how to :ref:`create-palmod-combined`.
Some filters are picky with regard to their input data type and require cell data or point data.
Use the dropdown for choosing the object color to check which variables of which types are available.
In this example topo exists as cell and as point data (because we just converted it). The topo with a dot in front of it is point data. That with a box is cell data.
.. image:: cell2point/cell-or-point.png
If neccessary you can
.. _convert-cell-to-point:
Convert cell data to point data
To convert cell data to point data, do ``Filters->Search`` and enter ``cell da``, use ``Enter`` to cofirm.
.. image::
In the settings of the calculator activate passing of cell data.
If you have many arrays in your input data, you might only want to process the data of relevance for this use.
.. image:: cell2point/
.. _countour-isolines:
Use the contour filter to display isolines
Add a contour filter
.. image::
Chose the variable, you want to contour by, use the red x to get rid of the default contour level, use the *scale* icon (below + and -) to create a number series, (see below), finally select the levels ``100`` and the ``0`` and use the ``+`` to add ``-50`` and ``50`` levels below them.
.. image::
.. image::
Adjust the line width to ``5`` by searching for ``line`` in the search box in the top and then adjusting it.
.. image::
Select ``BrBG`` as colormap, invert it, and set the value range to ``-100`` to ``100``.
.. _time-annotation:
Add a time annotation filter
The filter we are looking for is NetCDF Time annotation. It is not available on all systems (e.g. the default paraview).
......@@ -13,3 +13,17 @@ Issues:
* 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.
.. _open-with-cf-reader:
Open a file with the standard NetCDF Reader
Use ``File->Open`` or the top-left icon (see :ref:`main-screen`), chose the desired file and select ``NetCDF reader`` when prompted.
.. image:: cf-reader/chose-reader.png
For a spherical projection use ``Spherical Coordinates`` and (for most cases) use ``Replace Fill Value With Nan``
.. image:: cf-reader/spherical-nans.png
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