dice icon indicating copy to clipboard operation
dice copied to clipboard

Exodus File evaluation and netCDF4 structure

Open Jakobs95 opened this issue 2 years ago • 2 comments

Hello together! First of all: great software and many thanks for your work.

I use DICe for the evaluation of high-speed videos, so my result files are very large. Therefore I have to work directly with the exodus files, which I manipulate and plot in a Jupyter notebook. Unfortunately it's quite messy to work with the xarray, since the dimensions and coordinates written by DICe are sub-optimal and can't be changed easily. (E.g. num_nodes is a dimension, but the coordinates x and y are not...) Screenshot 2023-09-13 141413

With this import routine plotting was possible using: dataset.sel(time_step=16937).plot.scatter(x="coordx", y='coordy', hue=DISPLACEMENT_Y, cmap='viridis', marker='s', robust=True, ax=ax1, s= 50)

It seems like the new xarray release and their modification to the .scatterplot() function broke my work-around, now it seems to be impossible to make 2D plots using xarray, if the dimensions are not set correctly.

I have two questions, maybe someone encountered the same problem and found a solution:

  1. Is there any documentation about the structure of the netCDF4 dataset that DICe saves? E.g. What is the difference between INITAL_COORDINATES_X, MODEL_COORDINATS_X, COORDINATE_X and coordx?
  2. Does someone have advice on how to change the dimensions of the xarray (num_nodes to x and y) or knows a good way to make plots from the xarray? Converting data to Pandas/NumPy is not an option unfortunately.

Thanks alot!

Jakobs95 avatar Sep 13 '23 12:09 Jakobs95

Hi,

Regarding your question 1: The INITIAL_COORDINATES_X field is the location (in image pixels) of the centroids of the subsets as defined in the input deck. This field does not change throughout the analysis. The MODEL_COORDIATES_X field is the physical coordinates of the subset in model space. These coordinates change as the analysis progresses. They are computed by triangulating the location of the subset in the left and right image. The COORDINATE_X and coordx fileds are artifacts of how the exodus output files work. Exodus needs a coordinate field to be defined so we use this field. If the analysis is 2D, the COORDINATE_X field is the same as the INITIAL_COORDINATE_X field, for stereo, the field is the same as the MODEL_COORDINATES field since for stereo the user is more interested in the physical location of the point rather than the image location in pixels.

I don't have any good ideas for question 2. Hopefully someone else has some good ideas.

dicengine avatar Sep 13 '23 15:09 dicengine

Hey, thanks for the fast reply, this helps alot! So the displacement fields are basically just the difference between INITIAL_COORDINATES and MODEL_COORDINATES.

If someone has any ideas about the dimensions this would be really appreciated. :)

Jakobs95 avatar Sep 13 '23 15:09 Jakobs95