vendredi 24 juillet 2015

In Python: how can I generate a raster map with random values 0->1, evenly spaced?

I need to generate a raster map which contains 201x51 homogeneous cells. This map will need to have a coordinate system, centered on the bottom left corner, so that the center of each cell can be identified accordingly.

Features:

  • Each cell must be assigned a random double value between 0 and 1, separated by 0.1;
  • For each cell, I must be able to obtain a property table with the X, Y coordinates, the cell ID, and the random value it has been assigned;
  • This raster is in fact a map that should represent the realization and size of a flooding event over an hypothetical area. Therefore, I must find a way to cluster the cells with values around 1.

To give you an idea of what I need, please refer to this link:

Example of a similar raster map

At any rate, a color legend exists, where white cells are assigned 0 (no flood), and the darkest blue means 1. All other pales of blue mean something in-between.

How can this be done in Python?




Aucun commentaire:

Enregistrer un commentaire