Sample Python Code

Least Cost Path (Github)

Least cost paths are frequently used in spatial analysis. It can be used to construct transportation network (see David Donaldson's work) or optimal attacking routes (see my research here). This sample Python code uses Dijkstra's algorithm and illustrates how to the get least cost path based on local elevation, given starting and destination points. The following graph shows the optimal path from the border of Israel to Haifa, through the relatively flat valley.

Processing NASA air pollution data (Github)

Many NASA satellite data is available at daily basis in HDF4 format. This sample Python code illustrates how to the get the average air pollution from 4 daily air pollution GIS files covering part of Greece. It can be easily extended to generate monthly or yearly air pollution for larger areas.

Crawler --- NBA Referee Report (Github)

Data is essential for empirical research. This sample Python code illustrates how to scraps data from online NBA referee reports, and save into excel files.

Could well-trained referees be impartial? Sport fans believe that home team and superstars receive favourable calls. NBA referee reports present an opportunity to exam it. Those reports are the league's assessment of officiated events that occurred in the last two minutes of last night's games that were close. The plays assessed include all calls (whistles) and notable non-calls. You may find them here.