This module contains the main routines of ROHSA
Compute nside value from and
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(3) | :: | dim_cube | cube dimension |
nside of the cube
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | nside | ||||
integer, | intent(in), | dimension(3) | :: | dim_data | ||
integer, | intent(inout), | dimension(3) | :: | dim_cube |
Reshape the data in a grid of
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | data | original cube |
|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | cube | reshape cube |
|
integer, | intent(in), | dimension(3) | :: | dim_data | original cube dimension |
|
integer, | intent(in), | dimension(3) | :: | dim_cube | new cube dimension |
Reshape the cube () into a grid with original dimension (opposite of reshape_up)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | cube | original cube |
|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | data | reshape cube |
|
integer, | intent(in), | dimension(3) | :: | dim_cube | new cube dimension |
|
integer, | intent(in), | dimension(3) | :: | dim_data | original cube dimension |
Average cube along spatial axis depending on level n
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nside | nside of the cube |
||
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | cube | cube |
|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | cube_mean | average cube |
Average map depending on level nside
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nside | nside |
||
real(kind=xp), | intent(in), | dimension(:,:), allocatable | :: | map | map |
|
real(kind=xp), | intent(inout), | dimension(:,:), allocatable | :: | map_mean | avarage map |
Projection of the solution at next level (nside += 1)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | cube_params | cube of parameters |
Initialization of the mean sprectrum with N Gaussian
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n_gauss | number of Gaussian |
||
real(kind=xp), | intent(inout), | dimension(3*n_gauss) | :: | params | params to optimize |
|
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
real(kind=xp), | intent(in), | dimension(dim_v) | :: | line | spectrum |
|
real(kind=xp), | intent(in) | :: | amp_fact_init | times max amplitude of additional Gaussian |
||
real(kind=xp), | intent(in) | :: | sig_init | dispersion of additional Gaussian |
||
integer, | intent(in) | :: | maxiter | Max number of iteration |
||
integer, | intent(in) | :: | m | number of corrections used in the limited memory matrix by LBFGS-B |
||
integer, | intent(in) | :: | iprint | print option |
Initialize parameters bounds for optimization
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(dim_v) | :: | line | spectrum |
|
integer, | intent(in) | :: | n_gauss | number of Gaussian |
||
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
real(kind=xp), | intent(inout), | dimension(3*n_gauss) | :: | lb | lower bounds |
|
real(kind=xp), | intent(inout), | dimension(3*n_gauss) | :: | ub | upper bounds |
Upgrade parameters (spectra to spectra) using minimize function (here based on L-BFGS-B optimization module)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | cube | cube |
|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | params | cube parameters to update |
|
integer, | intent(in) | :: | power | nside of the cube |
||
integer, | intent(in) | :: | n_gauss | number of Gaussian |
||
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
integer, | intent(in) | :: | maxiter | max number of iteration |
||
integer, | intent(in) | :: | m | number of corrections used in the limited memory matrix by LBFGS-B |
||
integer, | intent(in) | :: | iprint | print option |
Update parameters (entire cube) using minimize function (here based on L-BFGS-B optimization module)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | cube | cube |
|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | params | parameters cube to update |
|
integer, | intent(in) | :: | n_gauss | Number of Gaussian |
||
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
integer, | intent(in) | :: | dim_y | dimension along spatial axis y |
||
integer, | intent(in) | :: | dim_x | dimension along spatial axis x |
||
real(kind=xp), | intent(in) | :: | lambda_amp | lambda for amplitude parameter |
||
real(kind=xp), | intent(in) | :: | lambda_mu | lambda for mean position parameter |
||
real(kind=xp), | intent(in) | :: | lambda_sig | lambda for dispersion parameter |
||
real(kind=xp), | intent(in) | :: | lambda_var_amp | lambda for amp dispersion parameter |
||
real(kind=xp), | intent(in) | :: | lambda_var_mu | lambda for mean position dispersion parameter |
||
real(kind=xp), | intent(in) | :: | lambda_var_sig | lambda for variance dispersion parameter |
||
integer, | intent(in) | :: | maxiter | max number of iteration |
||
integer, | intent(in) | :: | m | number of corrections used in the limited memory matrix by LBFGS-B |
||
real(kind=xp), | intent(in), | dimension(:,:), allocatable | :: | kernel | convolution kernel |
|
integer, | intent(in) | :: | iprint | print option |
||
real(kind=xp), | intent(in), | dimension(:,:), allocatable | :: | std_map | Standard deviation map |
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 |
Compute the STD spectrum of a cube along the spatial axis
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | data | initial fits data |
|
real(kind=xp), | intent(inout), | dimension(:), allocatable | :: | spectrum | std_spectrum of the observation |
|
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
integer, | intent(in) | :: | dim_y | dimension along spatial axis y |
||
integer, | intent(in) | :: | dim_x | dimension along spatial axis x |
Compute the MAX spectrum of a cube along the spatial axis
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | data | initial fits data |
|
real(kind=xp), | intent(inout), | dimension(:), allocatable | :: | spectrum | max_spectrum of the observation |
|
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
integer, | intent(in) | :: | dim_y | dimension along spatial axis y |
||
integer, | intent(in) | :: | dim_x | dimension along spatial axis x |
||
real(kind=xp), | intent(in), | optional | :: | norm_value | max value of the mean spectrum to normalze the max spectrum if present |
Compute the MEAN spectrum of a cube along the spatial axis
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | data | initial fits data |
|
real(kind=xp), | intent(inout), | dimension(:), allocatable | :: | spectrum | std_spectrum of the observation |
|
integer, | intent(in) | :: | dim_v | dimension along v axis |
||
integer, | intent(in) | :: | dim_y | dimension along spatial axis y |
||
integer, | intent(in) | :: | dim_x | dimension along spatial axis x |
Set up a grid params array with std spectrum at each spatial position
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | params | grid of paramters |
|
real(kind=xp), | intent(in), | dimension(:), allocatable | :: | guess_spectrum | std spectrum of the observation |
|
integer, | intent(in) | :: | dim_y | dimension along spatial axis y |
||
integer, | intent(in) | :: | dim_x | dimension along spatial axis x |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=xp), | intent(in), | dimension(:,:,:), allocatable | :: | cube | mean cube over spatial axis |
|
real(kind=xp), | intent(inout), | dimension(:,:,:), allocatable | :: | params | parameters to optimize with cube mean at each iteration |
|
real(kind=xp), | intent(in), | dimension(:,:), allocatable | :: | std_map | standard deviation map fo the cube computed by ROHSA with lb and ub |
|
integer, | intent(inout) | :: | n_gauss | |||
integer, | intent(in) | :: | dim_v | |||
integer, | intent(in) | :: | dim_y | |||
integer, | intent(in) | :: | dim_x | |||
real(kind=xp), | intent(in) | :: | amp_fact_init | times max amplitude of additional Gaussian |
||
real(kind=xp), | intent(in) | :: | sig_init | dispersion of additional Gaussian |