08_Industrial_Cells.md 3.96 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# SERA Industrial Exposure Defined in 30-arcsec Cells: The Tools in GDE_TOOLS_create_industrial_cells.py

In broad terms, `GDE_TOOLS_create_industrial_cells.py` contains tools to:

- read the points in which the SERA industrial exposure model is defined

<img src="Images/industrial_30arcsec_approach_01.png" width="600">

- generate 30-arcsec cell geometries around them

<img src="Images/industrial_30arcsec_approach_02.png" width="600">

- carry out a first adjustment of the coordinates of the cells based on grouping together all longitudes and then all latitudes that "should be" the same, as per a precision criterion

<img src="Images/industrial_30arcsec_approach_03.png" width="600">

<img src="Images/industrial_30arcsec_approach_04.png" width="600">

<img src="Images/industrial_30arcsec_approach_05.png" width="600">

- check that the resulting adjusted geometries are satisfactory, that is, that no potential overlaps/gaps between cells remain

<img src="Images/industrial_30arcsec_approach_06.png" width="600">

- carry out more computationally-demanding operations to adjust the geometries when overlaps/gaps are found
- intersect the adjusted cell geometries with the country boundaries
- update the SERA industrial exposure input files to indicate the corresponding IDs of the generated cells
- export the geometries of the generated cells

The core function of the tools, which is called by `SERA_creating_industrial_cells.py` is `generate_country_industrial_cells()`. The following figures illustrate the functions that it calls and the process as a whole.

After the input points are retrieved from the SERA input files, unique points are identified according to a certain input precision. The coordinates (longitude, latitude) that "should be" the same are identified by rounding the coordinates according to a certain number of decimal places and identifying unique values at that precision level. This is done using strings and dictionaries that store the original and new coordinates. The cells dataframe is finally updated to reflect the new adjusted coordinates and geometries.

<img src="Images/industrial_30arcsec_approach_07.png" width="600">

<img src="Images/industrial_30arcsec_approach_08.png" width="600">

Steps indicated in purple and magenta in the figures that follow are only executed if the input parameters `consistency_checks` and `autoadjust_overlap_gap` are True, respectively. These steps assess whether there are any overlaps/gaps left in between neighbouring cells and adjust the geometries when this is the case. In the case of gaps, geometries are not adjusted if the cells are in diagonal with respect to one another and they participate of other cases of intersection, as this can lead to contradictory adjustments of the geometries in each step because one pair of cells that intersect each other are adjusted at a time.

Cells are only trimmed as per country boundaries after the consistency checks. Otherwise, checks that look at the distance between the resulting cell centroids and the original points and the final aras of the cells would be meaningless, because the trimmed geometry cannot guarantee such consistencies with the original input points.

<img src="Images/industrial_30arcsec_approach_09.png" width="600">

Gaps are identified by generating an enlarged version of the cells (i.e. increasing their dimensions), searching for subsequent intersections (so as to know which cells are neighbours of which other cells), and then subtracting the original cell geometries to these intersections. This resulting geometry is analysed to decide whether a gap exists between the cells or not.

<img src="Images/industrial_30arcsec_approach_10.png" width="600">

<img src="Images/industrial_30arcsec_approach_11.png" width="600">

Which coordinates need to be adjusted is determined by first identifying the relative position of one cell with respect to the other.

<img src="Images/industrial_30arcsec_approach_12.png" width="600">

<img src="Images/industrial_30arcsec_approach_13.png" width="600">