Visualization on The Globe


Important note: we use only cross-platform Open Source Software and Open Datasets for our publications. You can freely download all the used software and data.




These are our commonly used datasets in the same order as on the picture above:
That’s very helpful to produce a high-quality visualization for each of them to present our projects results. ParaView is the right tool to do it and we need to prepare the source data.
Prepare datasets
1.1. Prepare georasters
The original data grids are too large and that’s better to reduce the sizes. Also, only NetCDF files can be easy processed in ParaView by this way and so we convert the datasets to this format too. GDAL tool is suitable for the conversion:
gdal_translate -of NetCDF -r average -tr .25 0.25 EMAG2_V2.tif EMAG2_V2.15min.nc
gdal_translate -of NetCDF -r average -tr .25 0.25 grav_28.1.nc grav_28.1.15min.nc
gdal_translate -of NetCDF -r average -tr .25 0.25 GEBCO_2019.nc GEBCO_2019.15min.nc
1.2. Prepare texture images
We can download some great pictures at planet texture maps web site. We use below picture 8081_earthmap4k.jpg:



To load into ParaView as texture image we need to flip it vertically and swap horizontally:
convert -flip -crop 50%x100% 8081_earthmap4k.jpg _converted.png
convert _converted-1.png _converted-0.png +append 8081_earthmap4k.fixed.jpg



Show raster on globe way #1.
We use ParaView calculator expression for spherical coordinates conversion
1.1. Load the data file GEBCO_2019.15min.nc in spherical coordinates:



Note: “Output Type” option added in ParaView 5.8 and we need to specify it correct for the future calculations.
1.2. Add “CellDatatoPointData” filter where “Process All Arrays” checkbox selected or the required “elevation” variable selected.
1.3. Add “Calculator” filter with this expression:
(1 + (elevation/6370000) * 40)* ( iHat * cos(asin(coordsZ)) * cos(atan(coordsY/coordsX)) * coordsX/abs(coordsX) + jHat * cos(asin(coordsZ)) * sin(atan(coordsY/coordsX)) * coordsX/abs(coordsX) + kHat * coordsZ)
Here “40” is vertical scale factor for better visualization. We converted cell array “elevation” to “Point Data” on the previous step and so we use “Attribute Type”=”Point Data” (the calculation doesn’t work for “Cell Data”). “Coordinate Results” option allows to rewrite the existing coordinates.



Show raster on globe way #2.
We use ParaView calculator expression for planar to spherical coordinates conversion
1.1. Load the data file GEBCO_2019.15min.nc in planar coordinates:



Note: “Output Type” option added in ParaView 5.8 and we need to specify it correct for the future calculations.
1.2. Add “Calculator” filter with this expression:
( 1 + (elevation/6370000)*40)*(cos(coordsY/180*3.141592) * cos(coordsX/180*3.141592) * iHat + cos(coordsY/180*3.141592) * sin(coordsX/180*3.141592) * jHat + sin(coordsY/180*3.141592) * kHat)
Here “40” is vertical scale factor for better visualization. “Coordinate Results” option allows to rewrite the existing coordinates.



Note: by this way the surface is sharper.
See also the listed above raster datasets mapped on the globe:



Show texture on globe.
For the globe prepared by the way #1 or #2 add TextureMaptoSphere filter and load the prepared picture 8081_earthmap4k.fixed.jpg:



Show vector data on globe.
For a polygonal data in geographic coordinate system (WGS84) use “Calculator” filter with this expression:
(1 + (coordsZ/6370000)*40)*(cos(coordsY/180*3.141592) * cos(coordsX/180*3.141592) * iHat + cos(coordsY/180*3.141592) * sin(coordsX/180*3.141592) * jHat + sin(coordsY/180*3.141592) * kHat)



Where “40” is scale factor and the “Coordinate result” checkbox should be selected.



References
See the ParaView project files on our GitHub repository:

Originally published at https://www.linkedin.com.

Comments

Popular posts from this blog

Открытый софт для научных расчетов

Счетчики в SQLite

Модем Huawei E1550 в debian