Dark theme

The Black Death


Imagine that you are an epidemiologist looking back at the Black Death outbreak in 1665. You want to calculate the total deaths from the disease using historical figures of rat populations (recorded by the local rat catchers) and the population density (derived from the parish records).

You know from small scale studies that the relationship between average rats caught per week per 100m x 100m square(r), average population density per 100m x 100m square(p) and average deaths per week per 100m x 100m square(d) is...

d = (0.8 x r) x (1.3 x p)

You have files containing a raster map of average population densities per 100m x 100m square for 16 square parishes in London. You also have an area map of average rats caught per week per 100m x 100m square for each rat catcher's area of work. These are stored as text digits. One value represents a 100m x 100m square area, but the figures are averaged at the Parish or Rat Catcher area scale and then smoothly distributed between the appropriate individual areas.

Write a Jupyter Notebook that does the following.

  1. Pulls in the two maps and puts them on the screen. Each pixel will represent a 100m x 100m square area.

  2. Calculates a map showing average deaths per 100m x 100m square area for the different geographical regions produced by the intersection of the two images.

    I.e. run through the maps and pull out the values for each pair of equivalently positioned cells. Put them through the equation above to produce a two dimensional array of absolute deaths that you can convert into an Image mapping the deaths.

  3. Displays the three maps.

  4. Saves the death map as a text file of absolute deaths. Each line should equal a line on the map.

  5. Displays the total deaths per week.
  6. Allows the user to change the parameter weights for the equation (for example with a scrollbar).

Files for this project.

2 x (400 by 400) raster maps with blocks of consistant average values in them. One represents average rats caught for that area per and the other represents the average population density for the area.

The blocks are not the same in the two files. One represents parishes, the other the domains of the rat catchers. The information for both are stored as text numbers. Each number represents a 100 x 100m area. The values are laid out from the upper left to lower right of the raster image, with each line being a line of the rasters.