Compute the STD map of a 3D array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(inout), | dimension(:,:), allocatable | :: | std_map | standard deviation map of the cube |
|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | cube | cube |
|
integer, | intent(in) | :: | lb | lower bound |
||
integer, | intent(in) | :: | ub | upper bound |
subroutine set_stdmap(std_map, cube, lb, ub)
!! Compute the STD map of a 3D array
implicit none
integer, intent(in) :: lb !! lower bound
integer, intent(in) :: ub !! upper bound
real(xp), intent(in), dimension(:,:,:), allocatable :: cube !! cube
real(xp), intent(inout), dimension(:,:), allocatable :: std_map !! standard deviation map of the cube
real(xp), dimension(:), allocatable :: line
integer, dimension(3) :: dim_cube
integer :: i, j
dim_cube = shape(cube)
do j=1, dim_cube(3)
do i=1, dim_cube(2)
line = cube(lb:ub,i,j)
std_map(i,j) = std(line)
end do
end do
end subroutine set_stdmap