Sie sind hier: Startseite / Services / Data Analysis and Visualization / Visualization / Software / Paraview / Tutorial / Extrusion of topography and bathymetry
Info
Alle Inhalte des Nutzerportal sind nur auf Englisch verfügbar.

Extrusion of topography and bathymetry

When visualizing georeferenced climate and earth system data, such as atmospheric or ocean data, we strive for a realistic representation including topography and possibly bathymetry. ParaView accepts various file formats containing grids or textures encoding height and depth information of the earth’s surface. It accepts, e.g., Global Relief Model data such as ETOPO1 provided by NOAA in the NetCDF format, and VTK Polydata files (.vtp). This section illustrates how height information and colormapping can be used to create an exaggerated representation of orography and bathymetry.


Using ParaView’s Calculator filter, surfaces can easily be extruded, as the following examples for Equidistant Cylindrical and Spherical Projection illustrate.

Equidistant cylindrical representation


Data directory: /work/kv0653/ParaView-Workshop/HDCP2/
Height data file: surface_1.nc
Area:  HD(CP)² study area Germany

The extrusion formula for the Calculator filter is:
iHat * coordsX + jHat * coordsY + (z_ifc/9000.0 * ( kHat * (1+coordsZ)))

Please note that the formula must contain the correct point data variable name (in this example: z_ifc).

You can then import and apply a colormap, e.g.  color_surface.json, and rescale the colormap range to a custom range. However, as the colormap will need some tweaking before your visualization will look like Fig. 14 with oceans in blue and islands and other landmasses in shades of green, we suggest that you use an existing topography state file created by Niklas Röber as a background for HD(CP)² data over Germany (domain 02):  

/work/kv0653/ParaView-Workshop/HDCP2/land_surface.pvsm.

Steps:
1.    File -> Open… -> surface_1.nc


Open Data

Figure 1: Open data surface_1.nc.

 

2.    Select NetCDF files generic and CF conventions

NetCDF files generic and CF conventions

Figure 2: Select reader NetCDF files generic and CF conventions.

3.    Select Output Type Unstructured and hit Apply.

Output type unstructured  - apply

Figure 3: Select Output Type Unstructured.

4.    Select variable z_ifc and Surface representation

Z_ifc displayed as Surface

Figure 4: z_ifc displayed as Surface

5.    Select Calculator filter by clicking on the Calculator symbol in the toolbar and choose the following settings:

  • Attribute Mode: Point Data
  • X Coordinate results
  • Enter extrusion formula
  • X Replace invalid results
  • Click Apply

Calculator after topography extrusion

Figure 5: Calculator filter after surface height extrusion

6.    To change the coloring of the extruded data, select the Calculator module in the Pipeline and scroll down to the
        Coloring section of the Calculator Properties. Use the button Choose preset (folder with a heart - see Fig. 6)
        to get to the overview of color presets shown in Fig. 7.

Choose colormap preset

 Figure 6: Choose colormap preset

Colormap presets

Figure 7: Import colormap preset

 

7.    Press Import, navigate to a colormap .json file of your choice (e.g. color_surface.json - see Fig. 8 ) and press
       OK

Import preset color_surface.json

Figure 8: Import preset color_surface.json

8.    Back in the Choose preset menu, the imported preset (here: Preset 3) is already selected and will be used upon
       clicking the Apply button.When applied, press Close.

Apply new colormap preset 

Figure 9: Click Apply with new preset selected

        This yields the land surface representation shown in in Fig. 10.

Preset color_surface applied

Figure 10: Colormap color_surface.json applied to extruded topography


         ParaView has automatically selected the minimum and maximum values of z_ifc as colormap limits. As the
         colormap is designed for the topography and bathymetry of the entire earth, it is necessary to adjust the
         colormap range accordingly.   

9.    To set an upper and lower colormap limit, click on the button Rescale to custom range (time bar with a black c -
        see Fig. 11) in the Coloring section of the Calculator Properties.  

Rescale to custom range

Figure 11: Button rescale to custom range

10.    In the Set range window, enter -10000 as minimum and 6306 as maximum values (see Fig. 12) and hit rescale.

Set custom range

Figure 12: Window for setting the custom range

Topography with colormap range adjusted

Figure 13: Data colored by color_surface.json and custom range -10000 to 6303


11.    To achieve the result shown in Fig. 14, with the ocean colored in light blue and land colored in shades of green,
         you need to edit the Color transfer function values in the Colormap Editor. For convenience and for HD(CP)² data
         over Germany we suggest that you load the existing state file land_surface.pvsm prior to loading your data of
         interest.

Topography colormap adjusted

Figure 14: Land surface height with realistic ocean and land coloring

12.    Last but not least: If you would like to change the colormap labeling, press the button Edit colormap legend
        
properties (colormap symbol and black e - see Fig. 6) in the Coloring section of the Calculator Properties.  


Spherical representation


ETOPO data provided by NOAA is a suitable for extruding global topography and bathymetry data in a spherical projection. In this example we are going to use an ETOPO texture in the VTK Polydata format (.vtp). However, we might just as well use a netCDF data file.
 
Data directory: /work/kv0653/ParaView-Workshop/HAMOCC/
Height data file:topography.vtp (texture)
Area: global
Colormap file: topography_color.json

The extrusion formula for the Calculator filter is:

(1 + (altitude/6370000) * 100)* ( iHat * cos(asin(coordsZ)) * cos(atan(coordsY/coordsX)) * coordsX/abs(coordsX) + jHat * cos(asin(coordsZ)) * sin(atan(coordsY/coordsX)) * coordsX/abs(coordsX) + kHat * coordsZ )

After copying & pasting this formula, check for blanks introduced in variable- or coordinate names!


Steps:
1.    File -> Open…
2.    Navigate to topography.vtp, click OK
3.    Press Apply in the Properties of topography.vtp

 Texture with altitude shown as surface

Figure 15: Altitude displayed as Surface

4.    Select Calculator filter by clicking on the Calculator symbol in the toolbar and choose the following settings:

  • Attribute Mode: Point Data
  • X Coordinate results
  • Enter extrusion formula
  • X Replace invalid results
  • Click Apply

 Altitude extruded

Figure 16: Altitude extruded

5.    Load the colormap topography_color.json via Choose Preset and Import (see above for details). The result is
       shown in Fig. 17.

Colormap topography.json applied

Figure 17: Colormap topography_color.json applied


In the Colormap Editor, you can click on one of the control points in the Color transfer function editor to show the table of Color transfer function values. Here you can see which data values have RGB values defined. Double-click on a control point to see its color or look up the respective RGB values in an RGB Color Code Charts. For the current colormap and dataset, a data value of -0.2 m is shaded in blue while a value 0 m has a green color assigned. 

Save your project as a ParaView state file in a directory where you have write access, e.g. as spherical_earth_orography.pvsm.

 

Coastlines for spherical representation

 

Coast line data files:
low resolution: /work/kv0653/ParaviewTutorial/coastlines.vtk
slightly higher resolution: World_Coastlines_and_Lakes.vtp *

* (source: http://www.earthmodels.org/data-and-tools/coastlines/peter-bird )

Both equidistant cylindrical and spherical representations of the earth can be displayed together with datasets of coastlines, continental and national borders. Here we show the procedure exemplarily for the spherical projection in the previous section, using two different coastline datasets.

Continue from your previous session or load the respective state file.

Steps:

1.    File -> Open… coastlines.vtk (see Fig. 18)

  • Click OK
  • Click Apply


Open coastlines.vtk

Figure 18: Open coastlines.vtk

For an equidistant cylindrical projection of the earth, you would use the file coastlines_planar.vtk instead. To find out more about this, have a look at the ParaView tutorial document.

Fig. 19 shows the result of applying coastlines.vtk. The coastlines are very thin and do not exactly match the transition from land to water as indicated by the colormap. Moreover, the coastlines are quite coarse and angular, as looking at the coastlines only (see Fig. 20) shows.


coastlines.vtk applied

Figure 19: coastlines.vtk applied

coastlines with line width 2

Figure 20: Displaying only the coastlines with line width increased to 2.

To have the coastlines displayed on top of the topography (see Fig. 21):

2.    In the coastlines.vtk module, scroll down to the Transforming section and enter 0.002 in the third field behind
       Translation (see Fig. 21).

 

Coastlines translated vertically by 0.002

Figure 21: Coastlines translated vertically by 0.002

To further improve the appearance of the coastlines we suggest that you use the coastline data set World_coastlines_and_Lakes.vtp instead (see Fig. 22) and adjust the colormap for the Calculator1 module to achieve a better match between coastlines and the transition between ocean and land colors (not shown here).


Higher resolution coastlines translated vertically by 0.002

Figure 22: Higher resolution coastlines translated vertically by 0.002

 

When done, remember to save your project as a state file.

If you are interested in mapping an earth texture to the extruded surface of the earth, scroll down to the bottom part of this tutorial.

 

Artikelaktionen