Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exodus File evaluation and netCDF4 structure #303

Open
Jakobs95 opened this issue Sep 13, 2023 · 2 comments
Open

Exodus File evaluation and netCDF4 structure #303

Jakobs95 opened this issue Sep 13, 2023 · 2 comments

Comments

@Jakobs95
Copy link

Jakobs95 commented Sep 13, 2023

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!

@dicengine
Copy link
Owner

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.

@Jakobs95
Copy link
Author

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants