Morphological operations
Function that returns the fraction of surface nearly horizontal (normal less than 5 degrees from a vertical line)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(in), | dimension(1:long,1:larg) | :: | tab_in |
surface array |
|
integer(kind=I4), | intent(in) | :: | long |
surface array length |
||
integer(kind=I4), | intent(in) | :: | larg |
surface array width |
||
real(kind=R8), | intent(in), | dimension(1:3) | :: | scale_xyz |
lag along x, y and scale z |
|
real(kind=R8), | intent(in) | :: | cone_angle |
cone angle |
||
real(kind=R8), | intent(out) | :: | hori |
fraction of facets nearly horizontal |
||
logical(kind=I4), | intent(in), | optional | :: | print_mask |
mask output ? |
Calculate the number of cells in a mask, as well as the cell median size
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(inout), | dimension(1:long, 1:larg) | :: | msk |
mask |
|
integer(kind=I4), | intent(in) | :: | long |
2D array length |
||
integer(kind=I4), | intent(in) | :: | larg |
2D array height |
||
integer(kind=I4), | intent(out) | :: | nbr_cell |
number of cells |
||
real(kind=R8), | intent(out), | optional | :: | med_cell |
median size of the cells |
Height mask without deepest pits and highest peaks
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(out), | dimension(1:long, 1:larg) | :: | msk |
mask |
|
real(kind=R8), | intent(in), | dimension(1:long, 1:larg) | :: | tab |
heights 2D array |
|
integer(kind=I4), | intent(in) | :: | long |
2D array length |
||
integer(kind=I4), | intent(in) | :: | larg |
2D array height |
||
real(kind=R8), | intent(in) | :: | crit1 |
%age for deepest pits to remove |
||
real(kind=R8), | intent(in) | :: | crit2 |
%age for highest peaks to remove |
||
real(kind=R8), | intent(out) | :: | top |
%age of surface masked |
Perform erosion or dilation on a binary mask depending on the value of act. The operations utilize a defined kernel to affect neighboring pixels based on the specified val
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(inout), | dimension(1:long,1:larg) | :: | msk |
2D mask |
|
integer(kind=I4), | intent(in) | :: | long |
2D mask length |
||
integer(kind=I4), | intent(in) | :: | larg |
2D mask height |
||
integer(kind=I4), | intent(in) | :: | val |
size of the structuring element for the erosion/dilation operation |
||
character(len=5), | intent(in) | :: | act |
action to be performed, either “erode” or another operation, presumably “dilate”. |
Perform some kind of flood fill or connected component labeling on a grid (masque), starting from an initial ‘1’ element found and spreading out to adjacent ‘1’ elements, updating them to a specified value or zero if no value (niv) is specified.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(inout), | dimension(1:nx, 1:ny) | :: | masque |
Input/output matrix |
|
integer(kind=I4), | intent(out) | :: | taille |
Output scalar |
||
integer(kind=I4), | intent(in) | :: | nx |
Input dimensions |
||
integer(kind=I4), | intent(in) | :: | ny |
Input dimensions |
||
integer(kind=I4), | intent(in), | optional | :: | niv |
Optional input level |
The subroutine generates a composite mask based on specified parameters. The mask is filled with a number of shapes (in this case, ellipses) placed randomly within a defined area, while ensuring that the shapes do not overlap.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(out), | dimension(1:long, 1:larg) | :: | msk |
Output mask that will be filled with shapes |
|
integer(kind=I4), | intent(in) | :: | n_cells |
Number of cells to create in the composite mask |
||
character(len=6), | intent(in) | :: | locus |
Position of the shape (e.g., ‘center’ for centering) |
||
integer(kind=I4), | intent(in) | :: | a |
ellipsis first parameter |
||
integer(kind=I4), | intent(in) | :: | b |
ellipsis second parameter |
||
integer(kind=I4), | intent(in) | :: | width |
Width of each shape to be drawn in the mask |
||
integer(kind=I4), | intent(in) | :: | height |
Height of each shape to be drawn in the mask |
||
character(len=8), | intent(in) | :: | shap |
Type of shape to be drawn (here, ‘ellipsis’ is used) |
||
integer(kind=I4), | intent(in) | :: | long |
Length (dimensions) of the mask |
||
integer(kind=I4), | intent(in) | :: | larg |
Width (dimensions) of the mask |
Mask a region within a given shape (for the moment an ellipsis)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | x0 |
mask shape center 1st coordinate |
||
integer(kind=I4), | intent(in) | :: | y0 |
mask shape center 2nd coordinate |
||
integer(kind=I4), | intent(in) | :: | a |
ellipsis semi-length |
||
integer(kind=I4), | intent(in) | :: | b |
ellipsis semi-height |
||
character(len=8), | intent(in) | :: | shap |
kind of mask shape |
||
integer(kind=I4), | intent(inout), | dimension(1:long, 1:larg) | :: | msk |
mask |
|
integer(kind=I4), | intent(in) | :: | long |
2D array length |
||
integer(kind=I4), | intent(in) | :: | larg |
2D array height |
Function that returns the relative area of a surface minus 1.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(in), | dimension(1:long,1:larg) | :: | tab_in |
surface array |
|
integer(kind=I4), | intent(in) | :: | long |
2D array length |
||
integer(kind=I4), | intent(in) | :: | larg |
2D array width |
||
real(kind=R8), | intent(in), | dimension(1:3) | :: | scale_xyz |
scale along x, y, z |
|
real(kind=R8), | intent(out) | :: | aire |
computed area |
The function performs the following operations on a surface:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(in), | dimension(1:long, 1:larg) | :: | tab |
heights 2D array |
|
integer(kind=I4), | intent(in) | :: | long |
2D array length |
||
integer(kind=I4), | intent(in) | :: | larg |
2D array height |
||
real(kind=R8), | intent(out), | dimension(1:6) | :: | res |
results |