Import ECMWF netCDF

Important

It is important to be familiar with the simple UI of BlenderNC (Beginner mode!) to follow this tutorial.

Some data has been provided by ECMWF, and it is included at the main BlenderNC repository in the path blendernc/test/dataset.

blendernc
└── tests
    └── dataset
        ├── ECMWF_data.grib
        ├── ECMWF_data.nc
        ├── ssh_1995-01.nc
        └── ssh_1995-01.zarr

This example will use the file ECMWF_data.nc, follow closely the previous tutorial Simple animation, and explore the BlenderNC.

Import data!

Open Blender (>2.83), in the 3D view, open the sidebar by pressing “n”.

  • Switch to the BlenderNC panel and click on Load datacube. Then click the folder icon, navigate and select the ECMWF netcdf dataset: blendernc/test/dataset/ssh_1995-01.nc

../_images/select_dataset.png
  • Select the variable t2m from this dataset (Air-Temperature at 2 meters):

../_images/select_variable.png
  • Click over the animation checkbox to allow the dataset to be animated.

../_images/select_animate.png
  • Let’s increase the resolution to 100%:

../_images/change_resolution.png
  • Now, we can apply the material BlenderNC just created, but first, lets delete the default cube (shortuct x), create a sphere (shortcut shift + a - Mesh -> UV Sphere), and scale it to 2x (shortcut s + 2 + return)

  • Select sphere by clicking over it, then click apply material (highlighted in blue above). There will be no visible change until we switch to a rendered 3D viewport (Z and click over ) or render the camera (shortcut F12). Press 0 in your number path to change your view to the camera view. If you are using a laptop, you can emulate a number path by following the instructions in this link!

../_images/3D_view.png

Note

So far there is nothing new, but the render preview looks awful, we will fix it using the BlenderNC nodetree.

BlenderNC nodetree

Let’s switch to the BlenderNC nodetree, we have two options:

  • Switch to BlenderNC workspace (recomended):

../_images/change_workspace.png
  • or switch viewport to the BlenderNC nodetree:

../_images/change_nodetree.png

By default, the 3D view BlenderNC panel will create 4 nodes datacube Path, datacube Input, Resolution, Image Output, as seen below:

../_images/selected_nodetree.png

Note

The node datacube Input changes name to the current loaded filename.

Let’s fix some of the issues:

  1. Fix washed out colormap:

    • Import datacube range by pressing shift+a and then navegate to Datacube, then select datacube Range.

    ../_images/add_range_node.png
    • This will add a new node. The node will automatically connect if you place it between the resolution and Image Output nodes.

    ../_images/connect_range_node.png

    Note

    The previous step created a colorbar, as you can see, the values are rely low, and that’s why the render preview is awful.

    • To fix this, lets first connect the Range to the Image Output node. You can do this by draging the cyan dot on the top-right of the Range node to the bottom-left cyan dot on the Image Output.

    • Once connected, we can compute the range of the dataset by clicking over the Compute vmin & vmax button or directly change the vmin and vmax, this will automatically update the colorbar too. The range of this dataset is [204.11 - 312.75] Kelvins.

../_images/output_range_node.png
  1. Fix Earth upside-down:

Note

Now that we can actually see the data, it’s obvious that the Earth is upside-down. This will be fixed in a future release, but in the meantime there are two hacks to fix it.

  • Easy fix:

    • Select the Sphere.

    • Rotate 180 degrees in the X or Y axis by pressing r + x + 180 on your keyboard.

  • Fix using BlenderNC nodetrees:

    • Let’s add a Sortby Dimension node by pressing shift+a and then navegate to Dimensions, then select Sortby Dimension.

    ../_images/add_sortby_node.png
    • Connect the new created node, select the dimension latitude, and connect the Sortby Dimension and the Image output nodes.

    ../_images/connect_sortby.png

    Note

    Any of this fixes will orientate the sphere correctly.

After fixing the render preview:

  • Let’s change the vmin and vmax values within the Range node, to higlight temperatures within the range of [270.00, 310.00] Kelvins.

../_images/change_min_max_values.png
  • Select the Sphere by clicking over it, this will automatically show the material applied to the Sphere, by the default the name will be BlenderNC_default.

../_images/change_material.png
  • After selecting the image or changing material (changing material will assing the selected material to the selected object), the material nodetree will be displayed:

../_images/zoom_colormap_node.png
  • Within the material nodetree, you will find a node titled Colormap, in this node, you can change the colormap used for the preview and render. Currently, BlenderNC supports cmocean and matplotlib colormaps.

../_images/supported_colorbar.png
  • Select a different colormap, for example gist_heat

../_images/updated_colormap.png

Note

Changing the colormap, doesn’t change the colorbar material. This will be autimatically handle in a future release of BlenderNC.

  • To update the colorbar, click over the Create/Update colorbar in the BlenderNC nodetree Image output node highlighted in orange.

../_images/update_colorbar.png

This concludes this tutorial:

../_images/end_tutorial.png