PolymerGuy / muDIC

Digital Image Correlation in Python
MIT License
160 stars 69 forks source link

Add function to export the DIC results to a CSV file #23

Closed diehlpk closed 4 years ago

diehlpk commented 4 years ago

To use the DIC results for comparison against simulations it would be nice to export the DIC results to post process them. Therefore, I added the functionality

dic.IO.readWriteUtils.exportCSV(fields,'test',-1)

to export the DIC results to an CSV file with the name test.csv having following content:

d,x,y,ux,uy,true_strain_xx,true_strain_yy,true_strain_xy,eng_strain_xx,eng_strain_yy,eng_strain_xy
0,327.5922778201115,220.96314582729968,0.0922778201115193,0.2131458272996838,-9.899334952840385e-05,0.0023194105152010173,-0.0016074806327805579,-9.898844984845834e-05,0.0023221024285851044,-0.0016061893277967932
PolymerGuy commented 4 years ago

Very nice feature and thank you for contributing! In order to aid the users, I think we should add a docstring to the function? I would suggest we stick with the Numpy-style docstrings as used in the rest of the code.

Also, I know some users are interested in the deformation gradient. Would it be possible to add that also?

I would like to change the pull-request to the dev branch. I have tried to keep the master branch synced with the code available through PIP.

diehlpk commented 4 years ago

Very nice feature and thank you for contributing! In order to aid the users, I think we should add a docstring to the function? I would suggest we stick with the Numpy-style docstrings as used in the rest of the code.

Sure, I will add a doc string.

Also, I know some users are interested in the deformation gradient. Would it be possible to add that also?

Sure, is it sufficient to have g_xx, g_yy. and g_xy or do we need more entries?

I would like to change the pull-request to the dev branch. I have tried to keep the master branch synced with the code available through PIP.

Sounds good. You might want to mention this convention in your Readme.md for new contributors.

PolymerGuy commented 4 years ago

Thank you for contributing. I will merge it now and the changes will be included in the next PIP update along with various other fixes and improvements.

I will update the Readme as suggested