1400-1425 - steven haslemore, joshua barry - blasting ... · pdf file§fishnet of points...

16
Blasting Assessment Reports - Python Beyond the Toolbox NZEUC 2017 Steven Haslemore 15/08/2017

Upload: letram

Post on 23-Mar-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

Blasting Assessment Reports - Python Beyond the Toolbox

NZEUC 2017Steven Haslemore 15/08/2017

Page 2: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

2

§GIS as the consultancy within a consultancy/organisation

§Domain vs Technical experts

§Sometimes the GIS thing just needs to get out of the way

Themes to GIS by:

Page 3: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

Tunnel Site

Page 4: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

4

Project Data

Page 5: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

5

ProjectResults

Page 6: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

6

§Read an excel file (with funny headers) ý§Calculate max charge weight from each BP to every SR ý§ Fishnet of points over the blast area to model PPV þ§Assign them an elevation from a terrain model þ§Calculate PPV from each BP to each Fishnet point ý§Generate a model of vibration from points þ§Derive contours from that model þ§Export CAD lines þ§Export complex Excel tables/ summaries/ charts ý

What does arcpy give me:

Page 7: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

7

Python 30 second overview:

Page 8: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

8

§ Read an excel file ý− xlrd þ

§ PPV & charge weights for BPs, SRs, & Surface Points ý− Classes þ

§ Sensitive Receiver§ Blast Point

− Modules þ§ BlastingUtils.py§ ReportWriter.py§ cadWriter.py

§ Export complex Excel tables/ summaries/ charts ý− xlsxwriter þ

Python to glue the gaps:

Page 9: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

9

§Modules−BlastingUtils.py−ReportWriter.py−cadWriter.py

§Classes−Sensitive Receiver−Blast Point

Executing the vision:

Page 10: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

10

§Repeat each iteration of the application 13 times þ§Keep track of changes in surface elevation þ§Calculate some extra values for AOP þ§Sensitive receivers will appear at different levels þ§Excel summary for each level þ§Create filled polygons in CAD coloured by charge weights ý§And there’ll be ~100 times more input data to process ý

Just ‘tweak’ that for surface blasting

Page 11: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

11

§ Create filled polygons in CAD coloured by charge weights ý

− ezdxf þ

Pretty Coloured Boxes…

Page 12: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

12

§And there’ll be ~100 times more input data to process ý− “We should forget about small efficiencies, say about 97% of the time: premature

optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%” – Donald Knuth, Computer Programming as an Art - 1974

§Memory usage was running high− When defining your python class use

__slots__ to name your variables þ

§ Things were too slow! ý

Memory and Performance Issues….

Page 13: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

13

§ Reduce. Reuse. Divide.§ The types of calculations that were needed fall into a category known as

embarrassingly parallel1. Read input data (from a file, database, tcp connection, etc.).2. Run calculations on the input data, where each calculation is independent of any other

calculation.3. Write results of calculations (to a file, database, tcp connection, etc.)

§ Things were too slow! ý− Python Multiprocessing þ

§ Divide the contour points into three sets§ Supply these, along with all the blast points§ Join them back up

There has to be a better way

Page 14: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

14

Putting it all together§Pre the scripted processes

− Over one days worth of drafters time

§Script pre parallel processing− Around 7 hours

§Script post parallel processing− Around 2 hours

Page 15: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

15

Putting it all together

Page 16: 1400-1425 - Steven Haslemore, Joshua Barry - Blasting ... · PDF file§Fishnet of points over the blast area to model PPV ... §Create filled polygons in CAD coloured by charge weights

Follow us onwww.twitter.com/Aurecon

Join us onwww.facebook.com/Aurecon

Watch us onwww.youtube.com/user/AureconGroup

Follow us onwww.instagram.com/Aurecon

Follow us onwww.linkedin.com/company/Aurecon

Follow us onwww.slideshare.net/Aurecon