sosbrumadinho / victims_location_prediction

Software library to predict victims location after dam rupture or similar disasters.
32 stars 8 forks source link

Code translated from MATLAB and ABOUTTHECODE markdown added. #10

Open jsmatias opened 5 years ago

jsmatias commented 5 years ago

@cacarrara, sorry the late reply. Here is the code moved from: https://github.com/sosbrumadinho/brumadinho_location o/

volpatto commented 5 years ago

@jsmatias could you provide some explanation about what this code does? I took a look but don't get it. The code uses external results such as CFD simulation computed velocity fields?

jsmatias commented 5 years ago

@jsmatias could you provide some explanation about what this code does? I took a look but don't get it. The code uses external results such as CFD simulation computed velocity fields?

The original code was written in MATLAB and then translated to Python. All the MATLAB code can be found in the matlab_code folder.

The main.py file gets the geolocation coordinates and converts to x and y positions, which are used as an initial position. Data in the data folder are used to identify the the region affected by the accident. This region is passed to the FLUID class which calculates the velocity field and force field. As follows, using an average mass equals 80kg (average person), the acceleration field is obtained.
After two integrations of the acceleration field, the code determines the positions of the body. The final position is then determined using the last value in the position array. All this info and more details are available in the ABOUTTHECODE.md file.

@volpatto Could you have a look again on the code? Let me know if you have any question. If you run the main file you should have a plot and a final position as shown here:

This is a representation of the mud flowing. image

Thank you guys for the reviews! cc.: @volpatto @pictos

pictos commented 5 years ago

@volpatto, can you review this PR for us?

volpatto commented 5 years ago

@volpatto, can you review this PR for us?

@pictos sure, I will take it after work ASAP, today or tomorrow. @jsmatias I will check your code, now it seems to be more complete.

volpatto commented 5 years ago

@jsmatias thanks for your changes. I will take a look again ASAP. I think there is not too much to do for improving the code, but it's always worth to check if it's possible.