calculate_mean_value_in_neighbouring_cells
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
calculate_mean_value_in_neighbouring_cells [2023/04/21 15:30] – external edit 127.0.0.1 | calculate_mean_value_in_neighbouring_cells [2023/04/21 16:04] (current) – irladmin | ||
---|---|---|---|
Line 42: | Line 42: | ||
# number of pixels to take into account for the neighborhood | # number of pixels to take into account for the neighborhood | ||
npix = int(d/ | npix = int(d/ | ||
- | print SCRIPT_NAME, | + | print(SCRIPT_NAME, |
input_data = getNodeByName(nodes_data, | input_data = getNodeByName(nodes_data, | ||
if (not input_data): | if (not input_data): | ||
- | print SCRIPT_NAME, | + | print(SCRIPT_NAME, |
return [] | return [] | ||
# create a list with only the prob of the state of interest (road) | # create a list with only the prob of the state of interest (road) | ||
Line 59: | Line 59: | ||
| | ||
# check if the values are correct | # check if the values are correct | ||
- | print " | + | print(" |
| | ||
# create 2D array from the vector (easier for edge problems) | # create 2D array from the vector (easier for edge problems) | ||
Line 86: | Line 86: | ||
neighb[i,j] = average | neighb[i,j] = average | ||
# check maximum and minimum | # check maximum and minimum | ||
- | print " | + | print(" |
- | print " | + | print(" |
# write the values into the node_data format | # write the values into the node_data format | ||
# into a continuous node format | # into a continuous node format | ||
Line 93: | Line 93: | ||
# translate to 1D list | # translate to 1D list | ||
neighb_list = neighb.flatten().tolist() | neighb_list = neighb.flatten().tolist() | ||
- | print " | + | print(" |
| | ||
new_nodes_data = [{' | new_nodes_data = [{' | ||
| | ||
for i in range(CELLS_PRINTING): | for i in range(CELLS_PRINTING): | ||
- | print " | + | print(" |
return new_nodes_data | return new_nodes_data | ||
calculate_mean_value_in_neighbouring_cells.1682083809.txt.gz · Last modified: 2023/04/21 15:30 by 127.0.0.1