correlation_parameters Subroutine

public subroutine correlation_parameters(tab, long, larg, res, cut, sub_plane, scale_xy, omp)

Note

Function that returns ellipse_acf parameters calculated on the autocorrelation function. But prior to the acf calculation, the mean plane is subtracted.

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:long, 1:larg) :: tab

2D array in

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:8) :: res

correlation parameters

real(kind=R8), intent(in), optional :: cut

cut height

logical(kind=I4), intent(in) :: sub_plane

subtract least square plane (sampling)?

real(kind=R8), intent(in), dimension(1:2) :: scale_xy

lag along x and y in micrometers

logical(kind=I4), intent(in) :: omp

multithreaded ?


Calls

proc~~correlation_parameters~~CallsGraph proc~correlation_parameters correlation_parameters least_squares_tcheby least_squares_tcheby proc~correlation_parameters->least_squares_tcheby proc~acv acv proc~correlation_parameters->proc~acv proc~ellipse_acf ellipse_acf proc~correlation_parameters->proc~ellipse_acf apod apod proc~acv->apod calc_fftw3_real_bwd calc_fftw3_real_bwd proc~acv->calc_fftw3_real_bwd calc_fftw3_real_fwd calc_fftw3_real_fwd proc~acv->calc_fftw3_real_fwd init_scal init_scal proc~acv->init_scal proc~calc_moments calc_moments proc~acv->proc~calc_moments tab_calc_fftw3_real_bwd tab_calc_fftw3_real_bwd proc~acv->tab_calc_fftw3_real_bwd tab_calc_fftw3_real_fwd tab_calc_fftw3_real_fwd proc~acv->tab_calc_fftw3_real_fwd trans_corner2center trans_corner2center proc~acv->trans_corner2center write_surf write_surf proc~acv->write_surf get_unit get_unit proc~ellipse_acf->get_unit omp_get_num_procs omp_get_num_procs proc~ellipse_acf->omp_get_num_procs sort_array2 sort_array2 proc~ellipse_acf->sort_array2 proc~calc_moments_1d calc_moments_1D proc~calc_moments->proc~calc_moments_1d

Called by

proc~~correlation_parameters~~CalledByGraph proc~correlation_parameters correlation_parameters program~test_anisotropy test_anisotropy program~test_anisotropy->proc~correlation_parameters

Source Code

   subroutine correlation_parameters(tab, long, larg, res, cut, sub_plane, scale_xy, omp)
   !================================================================================================
   !< @note Function that returns [[ellipse_acf]] parameters calculated on the autocorrelation
   !< function. But prior to the acf calculation, the mean plane is subtracted.
   !< @endnote
   !------------------------------------------------------------------------------------------------
   implicit none
   integer(kind=I4), intent(in )                             :: long       !! *2D array length*
   integer(kind=I4), intent(in )                             :: larg       !! *2D array height*
   logical(kind=I4), intent(in )                             :: sub_plane  !! *subtract least square plane (sampling)?*
   logical(kind=I4), intent(in )                             :: omp        !! *multithreaded ?*
   real   (kind=R8), intent(in ), optional                   :: cut        !! *cut height*
   real   (kind=R8), intent(in ), dimension(1:2)             :: scale_xy   !! *lag along x and y in micrometers*
   real   (kind=R8), intent(in ), dimension(1:long, 1:larg)  :: tab        !! *2D array in*
   real   (kind=R8), intent(out), dimension(1:8)             :: res        !! *correlation parameters*

      real(kind=R8), dimension(1:long, 1:larg) :: tab_tmp1, tab_tmp2


      if ( sub_plane ) then

         ! mean plane subtracted
         call least_squares_tcheby(tab_in =      tab(1:long, 1:larg),  &  ! IN
                                  tab_out = tab_tmp1(1:long, 1:larg),  &  ! OUT
                                    long1 = long,                      &  ! IN
                                    long2 = larg,                      &  ! IN
                                    nvarx = 1,                         &  ! IN
                                    nvary = 1)                            ! IN

         tab_tmp1(1:long, 1:larg) = tab(1:long, 1:larg) -tab_tmp1(1:long, 1:larg)

      else

         tab_tmp1(1:long, 1:larg) = tab(1:long, 1:larg)

      endif

      call acv( tab_in    = tab_tmp1(1:long, 1:larg),  &  ! IN
                tab_out   = tab_tmp2(1:long, 1:larg),  &  ! OUT
                long      = long,                      &  ! IN
                larg      = larg,                      &  ! IN
                sub_samp  = sub_plane )                   ! IN

      call ellipse_acf( tabin = tab_tmp2(1:long, 1:larg),   &  ! IN
                         long = long,                       &  ! IN
                         larg = larg,                       &  ! IN
                        p_acv = res(1:8),                   &  ! OUT
                          cut = cut,                        &  ! IN
                     scale_xy = scale_xy,                   &  ! IN
                          omp = omp )                          ! IN

   return
   endsubroutine correlation_parameters