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)
0.0,
0.5,
0.0,
0.67, #NEW MAXIMUM VALUE
1.0,
0.5,
0.0
],
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.67, # NEW MAXIMUM VALUE
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 <https://swiftbrowser.dkrz.de/public/dkrz_8656c91ce0734327b6dc867fc5b6b068/ESiWACE2-Public/Paraview%20Sample%20Data/PalMod_example/>`_
.. 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 ``vilma_ss_777.nc`` (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 `pism_NH_777.nc <https://swiftbrowser.dkrz.de/public/dkrz_8656c91ce0734327b6dc867fc5b6b068/ESiWACE2-Public/Paraview%20Sample%20Data/PalMod_example/>`_
n
* 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::
copy-calculator.png
* 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 `surf_fw_out_pv_777.nc <https://swiftbrowser.dkrz.de/public/dkrz_8656c91ce0734327b6dc867fc5b6b068/ESiWACE2-Public/Paraview%20Sample%20Data/PalMod_example/>`_
* add a calculator that scales and outputs to ``surf_fw_out``::
surf_fw_out*86400*360
* 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::
icebergs-added.png
Time to :ref:`load-ice-sheets`
.. _vegetation-data:
Load the vegetation data
========================================
* Open `veg_ratio_max_nn_777.nc <https://swiftbrowser.dkrz.de/public/dkrz_8656c91ce0734327b6dc867fc5b6b068/ESiWACE2-Public/Paraview%20Sample%20Data/PalMod_example/>`_ ( 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.
Export
===================================================
.. toctree::
:maxdepth: 2
:caption: Contents:
:glob:
*
.. */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 topo.nc # will create a topo on a 0.5 deg lat/lon grid.
cdo -merge -remapnn,topo.nc MYFILE topo.nc MYFILE_TOPO.nc
.. 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) ::
((1+topg*100/6731000)*(coordsX*iHat+coordsY*jHat+coordsZ*kHat)
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::
calculator-topography/calculator-settings.png
.. 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::
cell2point/cell2point.png
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/
pass-cell.png
.. _countour-isolines:
Use the contour filter to display isolines
===========================================
Add a contour filter
.. image::
contour-isolines/add-contour.png
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::
contour-isolines/contour-levels.png
.. image::
contour-isolines/number-series.png
Adjust the line width to ``5`` by searching for ``line`` in the search box in the top and then adjusting it.
.. image::
contour-isolines/line-width.png
Select ``BrBG`` as colormap, invert it, and set the value range to ``-100`` to ``100``.
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