3-Reconstruct_template with regularization | mumott v 0.2.1

  • This is tutorial notebook is inspired by the one uploaded on the Mumott Git repository (https://gitlab.com/liebi-group/software/mumott.git) e.g. mumott/tutorial/reconstruct_and_visualize.ipynb. It runs with the installation of mumott v 0.2.1 (should have been installed via pip install mumott v 0.2.1)

  • More detailed information on Mumott usage can be found in this detailed notebook and it is recommended to take a closer look there for details

  • The notebook runs on CPU resources, but requires that you allocate multiple nodes. An example to get those for instance in ra would be: salloc -p day -c 20 -mem-per-cpu 10000 –time 1-00:00:00. This gets you 20 cores for a day on ra.

Step 1 - Set environment parameters for Mumott

These 2 cells need to run in order. They are required to set parameters for the CPU multithreading for the numba package. The optimal number of threads is hardware- and system-dependent. For large systems, it may be necessary to restrict the number of threads to avoid using too much RAM. In most cases, 4-20 threads is a good choice.

[1]:
import os
#--- User Input with the number of cores that you requested, 12-20 seems to work good for numba --------------------#
nthreads = 16

#--- End Input  ----------------------------------------------------------------------------------------------------#

#---- Do not modify ----#
os.environ["NUMBA_NUM_THREADS"] = f'{nthreads}'
os.environ["NUMBA_DEFAULT_NUM_THREADS"] = f'{nthreads}'
os.environ["OMP_NUM_THREADS"] = f'{nthreads}'

import numba

Step 1.1 - Please run this one after the cell above

[2]:
#---- Do not modify ----#
numba.config.NUMBA_DEFAULT_NUM_THREADS = nthreads
numba.config.NUMBA_NUM_THREADS = nthreads
numba.set_num_threads(nthreads)
OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead.

Step 1.2 - Package and libraries

[3]:
#---- Do not modify ----#
%matplotlib ipympl
import h5py
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import display
from ipywidgets import interact
# Mumott related inports
from mumott.data_handling import DataContainer, TransformParameters
from mumott.output_handling import OutputHandler, LiveViewHandler, ProjectionViewer
from mumott.optimization import OptimizationParameters, Optimizer, Regularizer, RegularizationParameters, RegularizationCurveFinder

Step 2 - Load data

  • The correctly prepared data needs to be loaded first. For this, please use the script 2-Export_template.

  • In Mumott this is performed using the path, name, and input type are defined as strings. The path can be either relative or absolute. The file name needs to include the file ending.

  • The two allowed formats are 'mat' (Aligned CSAXS-type Matlab file with a projection structure containing necessary data and metadata), and 'h5' (which requires a specially formated hdf5 file as done in the 2-Export_template).

Load first args from file

[4]:
#---- Modify input for your sample! ----#
filepath_args = '/das/work/p18/p18877/Christian/work_dir_Christian/Au_rod_short/args_Au_rod_short.pickle'
#--- End Input to load the exported args file ---------------------#

import pickle
## ---------- Don't change this if not needed ----------------- ##
with open(filepath_args,'rb') as fid:
    args = pickle.load(fid)

Fix path for data loading of Mumott

[5]:
#---- Modify input for your sample! ----#
#path = '/data/visitors/formax/20220566/2023031408/process/reconstructions/big_brain/'
#path = '/data/visitors/formax/20220566/2023031408/process/reconstructions/9425L_4w_XHP_NT/'
path = os.path.join(args['work_directory'] , args['sample_name'])

input_type = 'h5'
name = f'dataset_q_0.030_0.037.{input_type}'#f'dataset_q_0.079_0.090.{input_type}' # f"dataset_q_{q_range[0]:.3f}_{q_range[1]:.3f}"

Step 2.1 - Initializing the DataContainer

Mumott is working with the object DataContainer. It will be created based on the input paths

[6]:
#---- Do not modify ----#
try:
    data_container = DataContainer(data_path=path,
                                   data_filename=name,
                                   data_type=input_type)
except FileNotFoundError:
    print('No data file found!')

We can now take a quick look at the container object to see that the parameters make sense. Correct input values in case they are off, e.g. corrected for transmission is a candidat that might be off in case data has already been normalized during the Export

[7]:
display(data_container)

DataContainer

FieldSize
Number of projections 332
Volume shape [59 70 59]
Corrected for transmission False
Angles in radians True
Transformation applied False
Reconstruction parameters generated False

Up until now, no geometrical adjustments have been performed to the data. In the dataContainer, you should check and confirm the number of projections, the volume shape, and the fact that we have converted our angles into radians. Corrected for transmission is set to False because the code at the moment has no way of telling whether our data is transmission corrected or not, but we know and can adjust this if we like. Otherwise it can also reamin there. We also see that Transformation applied is False, and this leads us to the next important step.

[8]:
# Note, the projection viewer below can be used to also directly check the imported data
p = ProjectionViewer(data_container.stack.data, data_container.stack.dimensions, data_container.stack.detector_angles)
/das/home/appel_c/.local/lib/python3.9/site-packages/colorspacious/ciecam02.py:333: RuntimeWarning: invalid value encountered in divide
  t = (C

Step 2.2 - Transform the data container to the correct geometry

Data from different beamlines come in different coordinate systems and sorted in different ways, and they must be transformed into the coordinate system consistent with the one used by this method. There is some redundancy in this definition, but the three-dimensional coordinate system native to the code has the properties of: - principal_rotation_right_handed and secondary_rotation_right_handed - These simply denote whether the rotation and tilt, after considering data_sorting and data_index_origin, are right-handed. Setting to False will mean that the rotation or tilt value is multiplied by -1.

Generally, the interdependence of these parameters can be counterintuitive to work out and setting them correctly requires some trial and error, however, for a particular measurement setup and data processing pipeline, they only need to be worked out once. It can be very difficult to work them out correctly with a highly symmetrical sample, such as a cylinder. In this case, it is strongly recommended to work them out using a less symmetrical sample measured in the same system.

[9]:
# #---- Do not modify ----# ForMAX, loaded from args.
# transform_parameters = TransformParameters(
#     data_sorting = args['data_sorting'], #(1, 0, 2)
#     data_index_origin = args['data_index_origin'], #(0, 0),
#     principal_rotation_right_handed = args['principal_rotation_right_handed'], #True,
#     secondary_rotation_right_handed = args['secondary_rotation_right_handed'], #True,
#     detector_angle_0 = args['detector_angle_0'], #(1, 0),
#     detector_angle_right_handed = args['detector_angle_right_handed'], #=False,
#     offset_positive = args['offset_positive']) #(True, True))

#---- Do not modify ----# ForMAX, loaded from args.
transform_parameters = TransformParameters(
    data_sorting = (0, 1, 2),#args['data_sorting'], #(1, 0, 2)
    data_index_origin = (0, 1),#args['data_index_origin'], #(0, 0),
    principal_rotation_right_handed = True, #args['principal_rotation_right_handed'], #True,
    secondary_rotation_right_handed = True, #args['secondary_rotation_right_handed'], #True,
    detector_angle_0 = (1,0), #args['detector_angle_0'], #(1, 0),
    detector_angle_right_handed = False, #args['detector_angle_right_handed'], #=False,
    offset_positive = (True, True)) #args['offset_positive']) #(True, True))

Perform transformation

[10]:
#---- Do not modify ----#
data_container.transform(transform_parameters)

Step 2.3 - Visualize transformed data and check projections

The sample should appear as it was measured at the beamline. Furthermore, the sample should also rotate and tilt as expected. It is crucial to check these aspects in this step

[11]:
#---- Do not modify ----#
p = ProjectionViewer(data_container.stack.data, data_container.stack.dimensions, data_container.stack.detector_angles)

Having specified the settings (in this case, the settings are simply the default ones), we can hand this object over to the data_container.transform() method.

Step 3 - Visualize transformed data and check projections

  • IMPORTANT: The current version of Mumott has a bug reshaping the reconstruction volume. This needs to be manually adjusted in the next cell.

  • For this, use the visualization from the projection viewer to restore the volume shape. In this case, the dimension in direction of the principal (tomography) axis needs to be restored

  • X , Y , Z are dimensions |

  • Z is direction of principal rotation axis (tomography rotation axis)

  • X direction of the secondary rotation axis (tilt rotation axis)

  • Y is beam direction

[12]:
#### Bug in Mumott with reshaping the recon volume shape when transformations are applied  ##########
#---- User Input - Adjust this based on your sample ----#

print(data_container.stack.volume_shape)

# The volume shape needs to be restored here
data_container.stack.volume_shape = np.array([data_container.stack[0].diode.shape[0], *data_container.stack[0].diode.shape])

#---- End Input ----#

display(data_container)
[59 70 59]

DataContainer

FieldSize
Number of projections 332
Volume shape [57 57 70]
Corrected for transmission False
Angles in radians True
Transformation applied True
Reconstruction parameters generated False

Step 3.1 - Create reconstruction parameters

  • This is the input to the optimization algorithm and used for reconstructing the data. data_container.reconstruction_parameters

  • In the case of having to change data (e.g. removing NaNs manually), this must be handled after the reconstruction parameters and by modifying them directly

  • They are a flattened list, with the following ordering.. (to be added)

[13]:
#---- Do not modify ----#
reconstruction_parameters = data_container.reconstruction_parameters
mask = reconstruction_parameters.projection_weights>0

print(f" A few checks of the data, having 0, NAN or Infs values in the data: \n"
      f" There are vaules of 0 in the masked reconstruction_parameters.data : {(reconstruction_parameters.data[mask]==0).any()} \n"
      f" There are Infs in the reconstruction_parameters.data : {np.isinf(reconstruction_parameters.data).any()} \n"
      f" There are Infs in the reconstruction_parameters.projection_weights : {np.isinf(reconstruction_parameters.projection_weights).any()} \n"
      f" There are Nans in the reconstruction_parameters.data : {np.isnan(reconstruction_parameters.data).any()} \n"
      f" There are Nans in the reconstruction_parameters.projection_weights : {np.isnan(reconstruction_parameters.projection_weights).any()}")


 A few checks of the data, having 0, NAN or Infs values in the data:
 There are vaules of 0 in the masked reconstruction_parameters.data : False
 There are Infs in the reconstruction_parameters.data : False
 There are Infs in the reconstruction_parameters.projection_weights : False
 There are Nans in the reconstruction_parameters.data : False
 There are Nans in the reconstruction_parameters.projection_weights : False

Step 3.2 Remove Nans in case it is needed

Example code below that should work is (need to be applied to both, data and weights):

mask = np.isnan(reconstruction_parameters.data)

reconstruction_parameters.data[mask] = np.nan_2_num(reconstruction_parameters.data[mask])

reconstruction_parameters.projection_weights[mask] = np.nan_2_num(reconstruction_parameters.data[mask])

for the mask array

mask = np.isnan(reconstruction_parameters.projection_weights)

reconstruction_parameters.data[mask] = np.nan_2_num(reconstruction_parameters.data[mask])

reconstruction_parameters.projection_weights[mask] = np.nan_2_num(reconstruction_parameters.data[mask])

Step 3.3 Check data via histogram of transmission and scattering

  • Useful to also identify negative values in scattering that might be created during the background correction

  • Since that might cause problems in the optimization, one may now directly access the reconstruction parameters and mask out those values! An example is given in the next cell

[14]:
fig, [ax1, ax2] = plt.subplots(1,2, figsize = (8,3))
#print(reconstruction_parameters.projection_weights.shape)
#mask = reconstruction_parameters.data*reconstruction_parameters.projection_weights>0
mask = reconstruction_parameters.projection_weights>0
#vmin, vmax =
#print(mask.shape, (reconstruction_parameters.data*reconstruction_parameters.projection_weights).shape)
#print(np.max(reconstruction_parameters.data*reconstruction_parameters.projection_weights))
ax1.hist(np.log10((reconstruction_parameters.data[mask])),1000)
ax1.set_title('scattering')
ax2.hist(data_container._stack.diode, 1000)
ax2.set_title('diode')

[14]:
Text(0.5, 1.0, 'diode')

Step 3.3.1 Remove outliers of the data

  • Sometimes, scattering data can include some outliers. Althought it would be nice to understand why and where they come from, the most easy solution is to remove them from here.

  • For this purpose, we look at the instensity distribution for the highest 5% of intensity

  • Use threshold value or manually pick one from the plot in case you find a very high value towards 100.

[15]:
threshold = 99.90

# ---- Do not modify this section ---- #
perc= np.percentile(reconstruction_parameters.data, np.linspace(95,100,100))

plt.figure()
plt.loglog(np.linspace(95,100,100), perc.T)
plt.xlabel('percentage range')
plt.ylabel('value in percentage range')

plt.axvline(threshold, ls = '--', color='r')
[15]:
<matplotlib.lines.Line2D at 0x7f5231118e50>

Step 3.3.2 Mask outliers

Use threshold or use manual value

[17]:
thres = threshold# or e.g. 99.9

# ---- Do not modify this section ---- #
# This sets the weights of the outliers in the projections to 0
vmin, vmax = np.percentile(reconstruction_parameters.data, [0,thres])
# Set weights of these entries to 0
reconstruction_parameters.projection_weights[reconstruction_parameters.data>vmax] = 0

Double check if outliers were removed

[18]:
# ---- Do not modify this section ---- #

mask = reconstruction_parameters.projection_weights > 0
perc= np.percentile(reconstruction_parameters.data[mask], np.linspace(95,100,100))

plt.figure()
plt.loglog(np.linspace(95,100,100), perc.T)
plt.xlabel('percentage range')
plt.ylabel('value in percentage range')

plt.axvline(threshold, ls = '--', color='r')
[18]:
<matplotlib.lines.Line2D at 0x7f5230f0aeb0>

Step 3.4 Setting Optimization Parameters

The OptimizationParameters object takes some inputs used to initialize some members of the ReconstructionParameters instance, as well as settings used by scipy.optimize.minimize; these are documented in the scipy.optimize documentation. The SIGTT-specific settings are:

  1. integration_step_size This determines how large steps are taken to perform the integration necessary to compute projections; the optimal settings depend on various factors, such as how much variation there is within your sample and how many projections you have. The absolute maximum setting is 1, but generally a setting of 0.5 to 0.25 will yield better results and avoid artefacts. We will use 0.5.

  2. maximum_order This is the maximum order of the reconstructed spherical polynomial of each voxel. This must be an even number, and should be no larger than 180 / detector_segment_width - 1. Since we have eight detector segments (segment width of 22.5 degrees), 6 is an appropriate setting. The total number of coefficients fitted for each order is (maximum_order / 2 + 1) * (maximum_order + 1), or 28 for a setting of 6.

  3. initial_value The initial value of the isotropic component. The anisotropic components will be set to a fraction of this value. This will apply to all voxels, so it should not be set too large.

[19]:
optimization_parameters = OptimizationParameters(
    reconstruction_parameters=reconstruction_parameters,
    integration_step_size=0.5,
    maximum_order=6,
    initial_value=1e-5,
    minimize_args=dict(method='L-BFGS-B'),
    minimize_options=dict(maxiter=25,  # for final reconstructions 40-50, initial ones at 25 is good
                          ftol=1e-3, # convergence criteria, input on useful values will help, 1e-5 typically good start, decreasing may help with convergence
                          gtol=1e-5, # tolerance for the largest absolute value in the gradient, convergence criteria for gradient
                          disp=1, # display updates
                          maxls=10, # maximum number of line search for stepsize
                          maxcor=3)) # how many terms in its approx of the Hess matrix (gradient matrix), momentum parameter of gradient
Increasing maximum order ...

Step 3.4.1 Initiate the regularizer

[20]:
"""
regularization_coefficients : Regularize Coeff, this is a pythonic way of given startvalues 1e-5 for all order (0,2,4,6)
orders : Need to match the maximum_order from optimization_parameters
"""
l2_dict = RegularizationParameters(
    function_name='nearest_neighbor_l2',
    regularization_coefficients=tuple([1e-5 for i in range(4)]),
    orders=(0, 2, 4, 6))

regularization_parameter_list = [l2_dict]

regularizer = Regularizer(
    reconstruction_parameters=reconstruction_parameters,
    regularization_parameter_list=regularization_parameter_list)

Step 3.4.2 Setting save data - Creating the output Handler

  • To create output, we need to create an OutputHandler object. We want to store our output in a folder called output. This can be relative to our execution directory of the current script, or given a basepath for the output, e.g. “…/reconstructions/sample_name/.” based on preferences

  • It will overwrite existing files in case the argument is set to True. Enclosing folder gets overwritten?

[21]:
output_handler = OutputHandler(
    reconstruction_parameters=reconstruction_parameters,
    base_output_path = path, # Change to absolute path of where output folder should be generated
    create_enclosing_folder = True, # overwrite enclosing folder, should be True to automatically create folders
    overwrite_existing_files = True, # Overwrite existing files, should be True to automatically create folders
    enclosing_folder_name = 'output', # filename for output folder
    output_file_name = f'{name}_output') # filename appendix, name is the dataset name as from the import
Output directory already exists!

Step 3.4.3 LiveViewHandler - Feedback on running reconstructions

We would like live feedback on our reconstruction, so we create a LiveViewHandler object (to get live feedback in a notebook, one can run it with %matplotlib widget). Apart from the reconstruction_parameters argument, the others are equal to the default arguments.

  1. shown_orders shown_orders=[2, 4, 6] means that we will get a separate plot of the order-2, 4 and 6 contributions to the overall standard deviation of the spherical function.

  2. plane plane=1 means that we will see a cut of the plane orthogonal to the Y-direction. cut_index='middle' means that we will see a central cut;

  3. orientation orientation='transversal' means that we expect the orientation to be defined by fiber-like or great circle symmetry in the spherical polynomial, as opposed to 'longitudinal' or polar symmetry.

[22]:
live_view_handler = LiveViewHandler(
    reconstruction_parameters=reconstruction_parameters,
    shown_orders=[0, 2],
    plane=1,
    cut_index= 'middle',
    orientation='transversal')

Step 3.4.4 Init the optimizer

Finally, we need to create the Optimizer object and pass on to it the OptimizationParameters instance (which also contain our ReconstructionParameters instance), as well as the LiveViewHandler instance.

[27]:
#---- Do not modify ----#
optimizer = Optimizer(
    optimization_parameters=optimization_parameters,
    regularizer=regularizer,
    live_view_handler=live_view_handler)
Initializing optimizer...

Step 3.4.5 Prepare optimization with regularization loop

  • We then need to explicitly run the optimization, and it is possible to e.g. modify the OptimizationParameters instance and resume the reconstruction again if we are not satisfied after the first run. We will get feedback on the optimization progress as well as live updates in the plot created by the LiveViewHandler instance.

  • We also have a plot with the regularization parameters: L-curve plot

[28]:
regularizer.regularizer_dict_list = [dict(function_name='nearest_neighbour')]
regularizer._regularization_parameters = regularization_parameter_list
regularization_curve_finder = RegularizationCurveFinder(regularizer = regularizer,
    reconstruction_parameters = reconstruction_parameters,
    #multiplier_range = (1, -1),
    multiplier_range = (2, -2),   # paramter range for regularization parameters that is screened. The value (2,-2) screens 4 decades in parameter space
    number_of_iterations = 10,   # define the number of sample to be split
    regularization_index = 0) # ??

fun_name = "nearest_neighbour_l2"

basic_file_name = f'{name}'

Controls over how often output is being updated

Control how often the output is plotted. Output files can be large, so if a large range is being searched, consider setting interval. Larger than 1 means output every other iteration, 3 every third iteration, etc. Set to a large number to not output at all during curve finding. The values below should work for the beginning

[29]:
interval = 1
iteration = 0

Step 4 - Start optimization with optimization loop

We then need to explicitly run the optimization, and it is possible to e.g. modify the OptimizationParameters instance and resume the reconstruction again if we are not satisfied after the first run. We will get feedback on the optimization progress as well as live updates in the plot created by the LiveViewHandler instance.

Note: Data is automatically saved with a coeffizient for the regularization

[30]:
#---- Do not modify ----#
while regularization_curve_finder.continue_loop:
    optimizer.run_optimization()
    regularization_curve_finder.next_iteration()
    if (iteration) % interval == 0:
        coeff = regularization_curve_finder._actual_coefficient[-1]
        output_handler._output_file_name = f'{basic_file_name}_{fun_name}_{coeff:1.2e}'
        output_handler.save_output()
    optimization_parameters.reinitialize_parameters(reset_coefficients = True)
    iteration +=1
Running optimization...
Updating plot...
Calculating residual...
End time forward: 2.73
Total projection time forward: 2.69
Residual norm: 1.6806e+02
Regularizing...
Regularization norm: ['5.2166e-07']
End time adjoint: 2.85
Total projection time adjoint: 2.43
Gradient norm: 7.0471e-03
Regularizer call: 2
Regularization gradients: ['5.2218e-06']
RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =      6368040     M =            3

At X0         0 variables are exactly at the bounds

At iterate    0    f=  1.68055D+02    |proj g|=  7.04718D-03
Iteration wall time: 9.41
Total wall time: 9.41
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 1.6512e+02
Regularizing...
Regularization norm: ['4.1029e-03']
End time adjoint: 2.88
Total projection time adjoint: 2.47
Gradient norm: 6.9819e-03
Regularizer call: 4
Regularization gradients: ['5.8173e-04']
Iteration wall time: 7.28
Total wall time: 16.68
Updating plot...
Calculating residual...
End time forward: 2.54
Total projection time forward: 2.49
Residual norm: 1.6372e+02
Regularizing...
Regularization norm: ['8.9686e-03']
End time adjoint: 2.84
Total projection time adjoint: 2.44
Gradient norm: 6.9507e-03
Regularizer call: 6
Regularization gradients: ['8.6094e-04']

At iterate    1    f=  1.63733D+02    |proj g|=  6.50024D-03
Iteration wall time: 7.47
Total wall time: 24.15
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.49
Residual norm: 5.3178e+01
Regularizing...
Regularization norm: ['4.6462e+02']
End time adjoint: 2.87
Total projection time adjoint: 2.46
Gradient norm: 2.2550e-03
Regularizer call: 8
Regularization gradients: ['2.0102e-01']
Iteration wall time: 7.21
Total wall time: 31.36
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.2075e+02
Regularizing...
Regularization norm: ['6.3189e+00']
End time adjoint: 2.80
Total projection time adjoint: 2.41
Gradient norm: 5.9008e-03
Regularizer call: 10
Regularization gradients: ['2.3360e-02']

At iterate    2    f=  1.27071D+02    |proj g|=  3.42405D-02
Iteration wall time: 7.69
Total wall time: 39.05
Updating plot...
Calculating residual...
End time forward: 2.66
Total projection time forward: 2.62
Residual norm: 2.6843e+01
Regularizing...
Regularization norm: ['1.4956e+01']
End time adjoint: 2.92
Total projection time adjoint: 2.52
Gradient norm: 2.2042e-03
Regularizer call: 12
Regularization gradients: ['1.5586e-02']

At iterate    3    f=  4.17990D+01    |proj g|=  1.56803D-02
Iteration wall time: 7.94
Total wall time: 46.99
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.48
Residual norm: 2.5621e+01
Regularizing...
Regularization norm: ['7.8033e+01']
End time adjoint: 2.87
Total projection time adjoint: 2.46
Gradient norm: 1.9353e-03
Regularizer call: 14
Regularization gradients: ['6.7266e-02']
Iteration wall time: 7.20
Total wall time: 54.19
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.52
Residual norm: 2.6734e+01
Regularizing...
Regularization norm: ['1.3353e+01']
End time adjoint: 2.82
Total projection time adjoint: 2.43
Gradient norm: 2.1876e-03
Regularizer call: 16
Regularization gradients: ['1.2410e-02']

At iterate    4    f=  4.00869D+01    |proj g|=  1.15756D-02
Iteration wall time: 7.73
Total wall time: 61.92
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 2.7923e+01
Regularizing...
Regularization norm: ['1.0329e+01']
End time adjoint: 2.80
Total projection time adjoint: 2.41
Gradient norm: 2.4331e-03
Regularizer call: 18
Regularization gradients: ['5.5433e-03']

At iterate    5    f=  3.82517D+01    |proj g|=  3.11019D-03
Iteration wall time: 7.83
Total wall time: 69.75
Updating plot...
Calculating residual...
End time forward: 2.61
Total projection time forward: 2.56
Residual norm: 2.7821e+01
Regularizing...
Regularization norm: ['1.0196e+01']
End time adjoint: 2.86
Total projection time adjoint: 2.46
Gradient norm: 2.4393e-03
Regularizer call: 20
Regularization gradients: ['5.2627e-03']

At iterate    6    f=  3.80167D+01    |proj g|=  2.82342D-03
Iteration wall time: 7.75
Total wall time: 77.50
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 2.6283e+01
Regularizing...
Regularization norm: ['1.0292e+01']
End time adjoint: 2.91
Total projection time adjoint: 2.51
Gradient norm: 2.4279e-03
Regularizer call: 22
Regularization gradients: ['4.8198e-03']

At iterate    7    f=  3.65748D+01    |proj g|=  5.63881D-03
Iteration wall time: 7.77
Total wall time: 85.28
Updating plot...
Calculating residual...
End time forward: 2.48
Total projection time forward: 2.44
Residual norm: 2.4159e+01
Regularizing...
Regularization norm: ['1.2606e+01']
End time adjoint: 2.74
Total projection time adjoint: 2.32
Gradient norm: 2.3365e-03
Regularizer call: 24
Regularization gradients: ['1.0600e-02']
Iteration wall time: 7.01
Total wall time: 92.28
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.48
Residual norm: 2.5354e+01
Regularizing...
Regularization norm: ['1.0655e+01']
End time adjoint: 2.89
Total projection time adjoint: 2.46
Gradient norm: 2.3899e-03
Regularizer call: 26
Regularization gradients: ['5.5159e-03']

At iterate    8    f=  3.60089D+01    |proj g|=  6.08151D-03
Iteration wall time: 7.68
Total wall time: 99.96
Updating plot...
Calculating residual...
End time forward: 2.50
Total projection time forward: 2.46
Residual norm: 2.4425e+01
Regularizing...
Regularization norm: ['1.0859e+01']
End time adjoint: 2.89
Total projection time adjoint: 2.50
Gradient norm: 2.3514e-03
Regularizer call: 28
Regularization gradients: ['3.6739e-03']

At iterate    9    f=  3.52842D+01    |proj g|=  4.86980D-03
Iteration wall time: 7.75
Total wall time: 107.71
Updating plot...
Calculating residual...
End time forward: 2.62
Total projection time forward: 2.58
Residual norm: 2.2871e+01
Regularizing...
Regularization norm: ['1.1521e+01']
End time adjoint: 2.88
Total projection time adjoint: 2.48
Gradient norm: 2.2658e-03
Regularizer call: 30
Regularization gradients: ['3.1276e-03']

At iterate   10    f=  3.43922D+01    |proj g|=  5.81898D-03
Iteration wall time: 7.80
Total wall time: 115.51
Updating plot...
Calculating residual...
End time forward: 2.51
Total projection time forward: 2.47
Residual norm: 2.1566e+01
Regularizing...
Regularization norm: ['1.2091e+01']
End time adjoint: 2.84
Total projection time adjoint: 2.42
Gradient norm: 2.1794e-03
Regularizer call: 32
Regularization gradients: ['4.4816e-03']

At iterate   11    f=  3.36566D+01    |proj g|=  4.64897D-03
Iteration wall time: 7.65
Total wall time: 123.16
Updating plot...
Calculating residual...
End time forward: 2.63
Total projection time forward: 2.59
Residual norm: 2.0632e+01
Regularizing...
Regularization norm: ['1.2353e+01']
End time adjoint: 2.88
Total projection time adjoint: 2.47
Gradient norm: 2.1102e-03
Regularizer call: 34
Regularization gradients: ['4.1001e-03']

At iterate   12    f=  3.29854D+01    |proj g|=  2.88048D-03
Iteration wall time: 7.83
Total wall time: 130.98
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 1.9664e+01
Regularizing...
Regularization norm: ['1.2949e+01']
End time adjoint: 2.85
Total projection time adjoint: 2.44
Gradient norm: 2.0386e-03
Regularizer call: 36
Regularization gradients: ['5.1076e-03']

At iterate   13    f=  3.26128D+01    |proj g|=  3.97145D-03
Iteration wall time: 7.87
Total wall time: 138.85
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 1.9554e+01
Regularizing...
Regularization norm: ['1.2742e+01']
End time adjoint: 2.85
Total projection time adjoint: 2.45
Gradient norm: 2.0370e-03
Regularizer call: 38
Regularization gradients: ['3.6934e-03']

At iterate   14    f=  3.22951D+01    |proj g|=  1.99326D-03
Iteration wall time: 7.72
Total wall time: 146.57
Updating plot...
Calculating residual...
End time forward: 2.45
Total projection time forward: 2.41
Residual norm: 1.9452e+01
Regularizing...
Regularization norm: ['1.2590e+01']
End time adjoint: 2.77
Total projection time adjoint: 2.37
Gradient norm: 2.0449e-03
Regularizer call: 40
Regularization gradients: ['3.9276e-03']

At iterate   15    f=  3.20419D+01    |proj g|=  1.88270D-03
Iteration wall time: 7.56
Total wall time: 154.13
Updating plot...
Calculating residual...
End time forward: 2.45
Total projection time forward: 2.41
Residual norm: 1.9201e+01
Regularizing...
Regularization norm: ['1.2633e+01']
End time adjoint: 2.85
Total projection time adjoint: 2.42
Gradient norm: 2.0499e-03
Regularizer call: 42
Regularization gradients: ['3.2118e-03']

At iterate   16    f=  3.18336D+01    |proj g|=  1.89722D-03
Iteration wall time: 7.77
Total wall time: 161.90
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 1.8774e+01
Regularizing...
Regularization norm: ['1.3126e+01']
End time adjoint: 2.84
Total projection time adjoint: 2.45
Gradient norm: 2.0641e-03
Regularizer call: 44
Regularization gradients: ['5.1814e-03']
Iteration wall time: 7.27
Total wall time: 169.17
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.48
Residual norm: 1.9056e+01
Regularizing...
Regularization norm: ['1.2682e+01']
End time adjoint: 2.87
Total projection time adjoint: 2.48
Gradient norm: 2.0545e-03
Regularizer call: 46
Regularization gradients: ['2.9542e-03']

At iterate   17    f=  3.17375D+01    |proj g|=  1.66699D-03
Iteration wall time: 7.84
Total wall time: 177.01
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.48
Residual norm: 1.8737e+01
Regularizing...
Regularization norm: ['1.2862e+01']
End time adjoint: 2.86
Total projection time adjoint: 2.46
Gradient norm: 2.0623e-03
Regularizer call: 48
Regularization gradients: ['2.0807e-03']

At iterate   18    f=  3.15989D+01    |proj g|=  1.35202D-03
Iteration wall time: 7.71
Total wall time: 184.71
Updating plot...
Calculating residual...
End time forward: 2.51
Total projection time forward: 2.47
Residual norm: 1.8346e+01
Regularizing...
Regularization norm: ['1.3169e+01']
End time adjoint: 2.86
Total projection time adjoint: 2.47
Gradient norm: 2.0803e-03
Regularizer call: 50
Regularization gradients: ['3.2327e-03']

At iterate   19    f=  3.15150D+01    |proj g|=  2.76065D-03
Iteration wall time: 7.88
Total wall time: 192.59
Updating plot...
Calculating residual...
End time forward: 2.54
Total projection time forward: 2.50
Residual norm: 1.8019e+01
Regularizing...
Regularization norm: ['1.3455e+01']
End time adjoint: 2.80
Total projection time adjoint: 2.41
Gradient norm: 2.1013e-03
Regularizer call: 52
Regularization gradients: ['2.6923e-03']

At iterate   20    f=  3.14743D+01    |proj g|=  2.20292D-03
Iteration wall time: 7.74
Total wall time: 200.33
Updating plot...
Calculating residual...
End time forward: 2.59
Total projection time forward: 2.54
Residual norm: 1.8055e+01
Regularizing...
Regularization norm: ['1.3301e+01']
End time adjoint: 2.78
Total projection time adjoint: 2.39
Gradient norm: 2.1039e-03
Regularizer call: 54
Regularization gradients: ['2.3343e-03']

At iterate   21    f=  3.13558D+01    |proj g|=  1.43815D-03
Iteration wall time: 7.70
Total wall time: 208.03
Updating plot...
Calculating residual...
End time forward: 2.50
Total projection time forward: 2.46
Residual norm: 1.8053e+01
Regularizing...
Regularization norm: ['1.3239e+01']
End time adjoint: 2.80
Total projection time adjoint: 2.39
Gradient norm: 2.1130e-03
Regularizer call: 56
Regularization gradients: ['2.3971e-03']

At iterate   22    f=  3.12915D+01    |proj g|=  1.08887D-03
Iteration wall time: 7.66
Total wall time: 215.69
Updating plot...
Calculating residual...
End time forward: 2.37
Total projection time forward: 2.33
Residual norm: 1.8005e+01
Regularizing...
Regularization norm: ['1.3304e+01']
End time adjoint: 2.70
Total projection time adjoint: 2.30
Gradient norm: 2.1242e-03
Regularizer call: 58
Regularization gradients: ['2.5536e-03']
Iteration wall time: 6.84
Total wall time: 222.53
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.48
Residual norm: 1.8041e+01
Regularizing...
Regularization norm: ['1.3241e+01']
End time adjoint: 2.85
Total projection time adjoint: 2.45
Gradient norm: 2.1156e-03
Regularizer call: 60
Regularization gradients: ['2.2714e-03']

At iterate   23    f=  3.12819D+01    |proj g|=  1.06674D-03

           * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

           * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
*****     23     30     26     0     8   1.067D-03   3.128D+01
  F =   31.281902486074422

CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH
/das/home/appel_c/.local/lib/python3.9/site-packages/mumott/output_handling/output_handler.py:222: RuntimeWarning: divide by zero encountered in divide
  return np.nan_to_num(self._std_of_amplitude() / self._mean_of_amplitude(),
Saving coefficients to h5 ...
Saving rms_of_amplitude to h5 ...
Saving mean_of_amplitude to h5 ...
Saving std_of_amplitude to h5 ...
Saving relative_std_of_amplitude to h5 ...
Saving eigenvectors to h5 ...
Saving eigenvalues to h5 ...
Saving order_amplitude to h5 ...
Saving rank_2_tensor to h5 ...
Saving synthetic_data to h5 ...
reconstruction_type
algorithm
Maximum order not increased.
Running optimization...
Updating plot...
Calculating residual...
End time forward: 2.51
Total projection time forward: 2.47
Residual norm: 1.6806e+02
Regularizing...
Regularization norm: ['1.8644e-07']
End time adjoint: 2.80
Total projection time adjoint: 2.41
Gradient norm: 7.0471e-03
Regularizer call: 62
Regularization gradients: ['1.8724e-06']
RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =      6368040     M =            3

At X0         0 variables are exactly at the bounds

At iterate    0    f=  1.68055D+02    |proj g|=  7.04705D-03
Iteration wall time: 8.88
Total wall time: 8.88
Updating plot...
Calculating residual...
End time forward: 2.50
Total projection time forward: 2.45
Residual norm: 1.6512e+02
Regularizing...
Regularization norm: ['1.4745e-03']
End time adjoint: 2.81
Total projection time adjoint: 2.41
Gradient norm: 6.9819e-03
Regularizer call: 64
Regularization gradients: ['2.0899e-04']
Iteration wall time: 7.00
Total wall time: 15.88
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.6372e+02
Regularizing...
Regularization norm: ['3.2231e-03']
End time adjoint: 2.92
Total projection time adjoint: 2.51
Gradient norm: 6.9507e-03
Regularizer call: 66
Regularization gradients: ['3.0908e-04']

At iterate    1    f=  1.63728D+02    |proj g|=  6.66389D-03
Iteration wall time: 7.80
Total wall time: 23.69
Updating plot...
Calculating residual...
End time forward: 2.66
Total projection time forward: 2.62
Residual norm: 4.9903e+01
Regularizing...
Regularization norm: ['7.0279e+02']
End time adjoint: 2.97
Total projection time adjoint: 2.57
Gradient norm: 2.2266e-03
Regularizer call: 68
Regularization gradients: ['1.5060e-01']
Iteration wall time: 7.43
Total wall time: 31.12
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.48
Residual norm: 1.3489e+02
Regularizing...
Regularization norm: ['3.9498e+00']
End time adjoint: 2.93
Total projection time adjoint: 2.52
Gradient norm: 6.2727e-03
Regularizer call: 70
Regularization gradients: ['1.1295e-02']

At iterate    2    f=  1.38842D+02    |proj g|=  2.01102D-02
Iteration wall time: 7.68
Total wall time: 38.79
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 2.5040e+01
Regularizing...
Regularization norm: ['6.7709e+00']
End time adjoint: 2.89
Total projection time adjoint: 2.49
Gradient norm: 1.9342e-03
Regularizer call: 72
Regularization gradients: ['6.7949e-03']

At iterate    3    f=  3.18108D+01    |proj g|=  7.27224D-03
Iteration wall time: 7.75
Total wall time: 46.55
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.50
Residual norm: 2.2534e+01
Regularizing...
Regularization norm: ['1.3490e+02']
End time adjoint: 2.80
Total projection time adjoint: 2.40
Gradient norm: 1.5446e-03
Regularizer call: 74
Regularization gradients: ['5.7581e-02']
Iteration wall time: 7.12
Total wall time: 53.67
Updating plot...
Calculating residual...
End time forward: 2.64
Total projection time forward: 2.59
Residual norm: 2.4917e+01
Regularizing...
Regularization norm: ['5.8837e+00']
End time adjoint: 2.83
Total projection time adjoint: 2.43
Gradient norm: 1.9210e-03
Regularizer call: 76
Regularization gradients: ['5.3161e-03']

At iterate    4    f=  3.08008D+01    |proj g|=  5.09135D-03
Iteration wall time: 7.75
Total wall time: 61.42
Updating plot...
Calculating residual...
End time forward: 2.49
Total projection time forward: 2.45
Residual norm: 2.4576e+01
Regularizing...
Regularization norm: ['4.6507e+00']
End time adjoint: 2.89
Total projection time adjoint: 2.50
Gradient norm: 2.0852e-03
Regularizer call: 78
Regularization gradients: ['2.6858e-03']

At iterate    5    f=  2.92269D+01    |proj g|=  1.58954D-03
Iteration wall time: 7.83
Total wall time: 69.25
Updating plot...
Calculating residual...
End time forward: 2.64
Total projection time forward: 2.59
Residual norm: 2.4139e+01
Regularizing...
Regularization norm: ['4.6553e+00']
End time adjoint: 2.84
Total projection time adjoint: 2.46
Gradient norm: 2.1049e-03
Regularizer call: 80
Regularization gradients: ['2.9306e-03']

At iterate    6    f=  2.87941D+01    |proj g|=  1.97816D-03
Iteration wall time: 7.81
Total wall time: 77.06
Updating plot...
Calculating residual...
End time forward: 2.67
Total projection time forward: 2.62
Residual norm: 2.0361e+01
Regularizing...
Regularization norm: ['5.5196e+00']
End time adjoint: 2.94
Total projection time adjoint: 2.54
Gradient norm: 2.1854e-03
Regularizer call: 82
Regularization gradients: ['4.3149e-03']

At iterate    7    f=  2.58811D+01    |proj g|=  5.35681D-03
Iteration wall time: 7.92
Total wall time: 84.98
Updating plot...
Calculating residual...
End time forward: 2.66
Total projection time forward: 2.62
Residual norm: 1.6680e+01
Regularizing...
Regularization norm: ['8.8315e+00']
End time adjoint: 2.91
Total projection time adjoint: 2.50
Gradient norm: 2.1691e-03
Regularizer call: 84
Regularization gradients: ['8.2355e-03']

At iterate    8    f=  2.55117D+01    |proj g|=  9.23326D-03
Iteration wall time: 7.94
Total wall time: 92.92
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.6482e+01
Regularizing...
Regularization norm: ['6.2853e+00']
End time adjoint: 2.81
Total projection time adjoint: 2.41
Gradient norm: 2.1765e-03
Regularizer call: 86
Regularization gradients: ['2.6723e-03']

At iterate    9    f=  2.27673D+01    |proj g|=  3.28240D-03
Iteration wall time: 7.65
Total wall time: 100.56
Updating plot...
Calculating residual...
End time forward: 2.50
Total projection time forward: 2.46
Residual norm: 1.6172e+01
Regularizing...
Regularization norm: ['6.1072e+00']
End time adjoint: 2.84
Total projection time adjoint: 2.44
Gradient norm: 2.1518e-03
Regularizer call: 88
Regularization gradients: ['1.5532e-03']

At iterate   10    f=  2.22787D+01    |proj g|=  2.04602D-03
Iteration wall time: 7.58
Total wall time: 108.15
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.50
Residual norm: 1.5447e+01
Regularizing...
Regularization norm: ['6.3574e+00']
End time adjoint: 2.84
Total projection time adjoint: 2.44
Gradient norm: 2.0994e-03
Regularizer call: 90
Regularization gradients: ['1.5335e-03']

At iterate   11    f=  2.18044D+01    |proj g|=  2.15161D-03
Iteration wall time: 7.72
Total wall time: 115.87
Updating plot...
Calculating residual...
End time forward: 2.61
Total projection time forward: 2.57
Residual norm: 1.4723e+01
Regularizing...
Regularization norm: ['6.7096e+00']
End time adjoint: 2.82
Total projection time adjoint: 2.43
Gradient norm: 2.0295e-03
Regularizer call: 92
Regularization gradients: ['2.0226e-03']

At iterate   12    f=  2.14328D+01    |proj g|=  1.86902D-03
Iteration wall time: 7.76
Total wall time: 123.63
Updating plot...
Calculating residual...
End time forward: 2.64
Total projection time forward: 2.60
Residual norm: 1.3398e+01
Regularizing...
Regularization norm: ['8.2286e+00']
End time adjoint: 2.96
Total projection time adjoint: 2.55
Gradient norm: 1.8648e-03
Regularizer call: 94
Regularization gradients: ['4.9505e-03']
Iteration wall time: 7.49
Total wall time: 131.13
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 1.4252e+01
Regularizing...
Regularization norm: ['6.9559e+00']
End time adjoint: 2.65
Total projection time adjoint: 2.24
Gradient norm: 1.9761e-03
Regularizer call: 96
Regularization gradients: ['1.6993e-03']

At iterate   13    f=  2.12079D+01    |proj g|=  1.89764D-03
Iteration wall time: 7.58
Total wall time: 138.70
Updating plot...
Calculating residual...
End time forward: 2.32
Total projection time forward: 2.27
Residual norm: 1.3636e+01
Regularizing...
Regularization norm: ['7.3549e+00']
End time adjoint: 2.71
Total projection time adjoint: 2.31
Gradient norm: 1.8985e-03
Regularizer call: 98
Regularization gradients: ['2.3181e-03']

At iterate   14    f=  2.09906D+01    |proj g|=  7.94936D-04
Iteration wall time: 7.34
Total wall time: 146.04
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.49
Residual norm: 1.3304e+01
Regularizing...
Regularization norm: ['7.6070e+00']
End time adjoint: 2.86
Total projection time adjoint: 2.46
Gradient norm: 1.8575e-03
Regularizer call: 100
Regularization gradients: ['2.9870e-03']

At iterate   15    f=  2.09112D+01    |proj g|=  1.12952D-03
Iteration wall time: 7.93
Total wall time: 153.97
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.3019e+01
Regularizing...
Regularization norm: ['7.7821e+00']
End time adjoint: 2.89
Total projection time adjoint: 2.49
Gradient norm: 1.8258e-03
Regularizer call: 102
Regularization gradients: ['2.8792e-03']

At iterate   16    f=  2.08011D+01    |proj g|=  1.05338D-03
Iteration wall time: 7.86
Total wall time: 161.83
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.51
Residual norm: 1.2707e+01
Regularizing...
Regularization norm: ['8.0037e+00']
End time adjoint: 2.79
Total projection time adjoint: 2.37
Gradient norm: 1.7948e-03
Regularizer call: 104
Regularization gradients: ['2.0700e-03']

At iterate   17    f=  2.07109D+01    |proj g|=  9.52759D-04
Iteration wall time: 7.86
Total wall time: 169.69
Updating plot...
Calculating residual...
End time forward: 2.61
Total projection time forward: 2.56
Residual norm: 1.2331e+01
Regularizing...
Regularization norm: ['8.5576e+00']
End time adjoint: 2.89
Total projection time adjoint: 2.48
Gradient norm: 1.7578e-03
Regularizer call: 106
Regularization gradients: ['2.9049e-03']
Iteration wall time: 7.35
Total wall time: 177.04
Updating plot...
Calculating residual...
End time forward: 2.68
Total projection time forward: 2.63
Residual norm: 1.2652e+01
Regularizing...
Regularization norm: ['8.0399e+00']
End time adjoint: 2.84
Total projection time adjoint: 2.44
Gradient norm: 1.7899e-03
Regularizer call: 108
Regularization gradients: ['2.1246e-03']

At iterate   18    f=  2.06924D+01    |proj g|=  5.62563D-04

           * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

           * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
*****     18     24    273     0  1136   5.626D-04   2.069D+01
  F =   20.692391076229150

CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH
Saving coefficients to h5 ...
Saving rms_of_amplitude to h5 ...
Saving mean_of_amplitude to h5 ...
Saving std_of_amplitude to h5 ...
Saving relative_std_of_amplitude to h5 ...
Saving eigenvectors to h5 ...
Saving eigenvalues to h5 ...
Saving order_amplitude to h5 ...
Saving rank_2_tensor to h5 ...
Saving synthetic_data to h5 ...
reconstruction_type
algorithm
Maximum order not increased.
Running optimization...
Updating plot...
Calculating residual...
End time forward: 2.73
Total projection time forward: 2.69
Residual norm: 1.6806e+02
Regularizing...
Regularization norm: ['6.7035e-08']
End time adjoint: 2.93
Total projection time adjoint: 2.52
Gradient norm: 7.0471e-03
Regularizer call: 110
Regularization gradients: ['6.7405e-07']
RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =      6368040     M =            3

At X0         0 variables are exactly at the bounds

At iterate    0    f=  1.68055D+02    |proj g|=  7.04713D-03
Iteration wall time: 9.29
Total wall time: 9.29
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.52
Residual norm: 1.6512e+02
Regularizing...
Regularization norm: ['5.2994e-04']
End time adjoint: 2.83
Total projection time adjoint: 2.43
Gradient norm: 6.9819e-03
Regularizer call: 112
Regularization gradients: ['7.5421e-05']
Iteration wall time: 7.18
Total wall time: 16.47
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.49
Residual norm: 1.6372e+02
Regularizing...
Regularization norm: ['1.1584e-03']
End time adjoint: 2.66
Total projection time adjoint: 2.25
Gradient norm: 6.9507e-03
Regularizer call: 114
Regularization gradients: ['1.1134e-04']

At iterate    1    f=  1.63725D+02    |proj g|=  6.84762D-03
Iteration wall time: 7.56
Total wall time: 24.03
Updating plot...
Calculating residual...
End time forward: 2.50
Total projection time forward: 2.46
Residual norm: 2.0155e+01
Regularizing...
Regularization norm: ['1.6768e+02']
End time adjoint: 2.81
Total projection time adjoint: 2.38
Gradient norm: 1.2612e-03
Regularizer call: 116
Regularization gradients: ['4.3991e-02']
Iteration wall time: 7.32
Total wall time: 31.35
Updating plot...
Calculating residual...
End time forward: 2.43
Total projection time forward: 2.38
Residual norm: 6.0386e+01
Regularizing...
Regularization norm: ['2.8867e+01']
End time adjoint: 2.77
Total projection time adjoint: 2.36
Gradient norm: 4.1577e-03
Regularizer call: 118
Regularization gradients: ['1.8253e-02']

At iterate    2    f=  8.92533D+01    |proj g|=  2.65656D-02
Iteration wall time: 7.41
Total wall time: 38.76
Updating plot...
Calculating residual...
End time forward: 2.42
Total projection time forward: 2.38
Residual norm: 2.2658e+01
Regularizing...
Regularization norm: ['1.4697e+01']
End time adjoint: 2.74
Total projection time adjoint: 2.30
Gradient norm: 1.1426e-03
Regularizer call: 120
Regularization gradients: ['1.2740e-02']

At iterate    3    f=  3.73546D+01    |proj g|=  1.33126D-02
Iteration wall time: 7.54
Total wall time: 46.29
Updating plot...
Calculating residual...
End time forward: 2.36
Total projection time forward: 2.31
Residual norm: 1.8263e+01
Regularizing...
Regularization norm: ['3.5908e+00']
End time adjoint: 2.86
Total projection time adjoint: 2.46
Gradient norm: 1.7349e-03
Regularizer call: 122
Regularization gradients: ['3.4723e-03']

At iterate    4    f=  2.18539D+01    |proj g|=  3.67915D-03
Iteration wall time: 7.50
Total wall time: 53.79
Updating plot...
Calculating residual...
End time forward: 2.49
Total projection time forward: 2.44
Residual norm: 1.7904e+01
Regularizing...
Regularization norm: ['2.3872e+00']
End time adjoint: 2.71
Total projection time adjoint: 2.28
Gradient norm: 1.8146e-03
Regularizer call: 124
Regularization gradients: ['1.1731e-03']

At iterate    5    f=  2.02910D+01    |proj g|=  1.20456D-03
Iteration wall time: 7.92
Total wall time: 61.71
Updating plot...
Calculating residual...
End time forward: 2.63
Total projection time forward: 2.58
Residual norm: 1.7361e+01
Regularizing...
Regularization norm: ['2.4153e+00']
End time adjoint: 2.91
Total projection time adjoint: 2.49
Gradient norm: 1.8167e-03
Regularizer call: 126
Regularization gradients: ['1.3407e-03']

At iterate    6    f=  1.97765D+01    |proj g|=  1.00857D-03
Iteration wall time: 8.18
Total wall time: 69.90
Updating plot...
Calculating residual...
End time forward: 2.63
Total projection time forward: 2.59
Residual norm: 1.3784e+01
Regularizing...
Regularization norm: ['3.3743e+00']
End time adjoint: 2.90
Total projection time adjoint: 2.50
Gradient norm: 1.8283e-03
Regularizer call: 128
Regularization gradients: ['2.5579e-03']

At iterate    7    f=  1.71584D+01    |proj g|=  2.39606D-03
Iteration wall time: 8.26
Total wall time: 78.16
Updating plot...
Calculating residual...
End time forward: 2.87
Total projection time forward: 2.82
Residual norm: 1.1766e+01
Regularizing...
Regularization norm: ['4.2207e+00']
End time adjoint: 3.14
Total projection time adjoint: 2.69
Gradient norm: 1.8090e-03
Regularizer call: 130
Regularization gradients: ['3.2700e-03']

At iterate    8    f=  1.59863D+01    |proj g|=  2.66640D-03
Iteration wall time: 8.90
Total wall time: 87.05
Updating plot...
Calculating residual...
End time forward: 2.79
Total projection time forward: 2.75
Residual norm: 1.1207e+01
Regularizing...
Regularization norm: ['3.9980e+00']
End time adjoint: 2.85
Total projection time adjoint: 2.45
Gradient norm: 1.7831e-03
Regularizer call: 132
Regularization gradients: ['2.1664e-03']

At iterate    9    f=  1.52047D+01    |proj g|=  1.36693D-03
Iteration wall time: 8.21
Total wall time: 95.27
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.51
Residual norm: 1.1136e+01
Regularizing...
Regularization norm: ['3.8402e+00']
End time adjoint: 2.87
Total projection time adjoint: 2.46
Gradient norm: 1.7682e-03
Regularizer call: 134
Regularization gradients: ['1.6762e-03']

At iterate   10    f=  1.49765D+01    |proj g|=  5.30134D-04
Iteration wall time: 7.80
Total wall time: 103.07
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.48
Residual norm: 1.0900e+01
Regularizing...
Regularization norm: ['3.8764e+00']
End time adjoint: 2.78
Total projection time adjoint: 2.37
Gradient norm: 1.7340e-03
Regularizer call: 136
Regularization gradients: ['1.3865e-03']

At iterate   11    f=  1.47769D+01    |proj g|=  7.43135D-04
Iteration wall time: 7.65
Total wall time: 110.72
Updating plot...
Calculating residual...
End time forward: 2.49
Total projection time forward: 2.45
Residual norm: 1.0267e+01
Regularizing...
Regularization norm: ['4.1764e+00']
End time adjoint: 2.79
Total projection time adjoint: 2.39
Gradient norm: 1.6362e-03
Regularizer call: 138
Regularization gradients: ['1.2840e-03']

At iterate   12    f=  1.44434D+01    |proj g|=  8.67823D-04
Iteration wall time: 7.72
Total wall time: 118.44
Updating plot...
Calculating residual...
End time forward: 2.58
Total projection time forward: 2.53
Residual norm: 9.6656e+00
Regularizing...
Regularization norm: ['4.9141e+00']
End time adjoint: 2.84
Total projection time adjoint: 2.42
Gradient norm: 1.5093e-03
Regularizer call: 140
Regularization gradients: ['2.3528e-03']
Iteration wall time: 7.23
Total wall time: 125.67
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.50
Residual norm: 1.0050e+01
Regularizing...
Regularization norm: ['4.2812e+00']
End time adjoint: 2.84
Total projection time adjoint: 2.43
Gradient norm: 1.6001e-03
Regularizer call: 142
Regularization gradients: ['1.2836e-03']

At iterate   13    f=  1.43314D+01    |proj g|=  7.27215D-04
Iteration wall time: 7.71
Total wall time: 133.38
Updating plot...
Calculating residual...
End time forward: 2.69
Total projection time forward: 2.65
Residual norm: 9.7092e+00
Regularizing...
Regularization norm: ['4.5022e+00']
End time adjoint: 2.97
Total projection time adjoint: 2.56
Gradient norm: 1.5395e-03
Regularizer call: 144
Regularization gradients: ['1.3657e-03']

At iterate   14    f=  1.42114D+01    |proj g|=  2.95801D-04
Iteration wall time: 8.07
Total wall time: 141.46
Updating plot...
Calculating residual...
End time forward: 2.62
Total projection time forward: 2.57
Residual norm: 9.4749e+00
Regularizing...
Regularization norm: ['4.7010e+00']
End time adjoint: 2.87
Total projection time adjoint: 2.47
Gradient norm: 1.5172e-03
Regularizer call: 146
Regularization gradients: ['1.6246e-03']

At iterate   15    f=  1.41758D+01    |proj g|=  5.04461D-04
Iteration wall time: 7.81
Total wall time: 149.27
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 9.2802e+00
Regularizing...
Regularization norm: ['4.8716e+00']
End time adjoint: 2.87
Total projection time adjoint: 2.48
Gradient norm: 1.5251e-03
Regularizer call: 148
Regularization gradients: ['1.9479e-03']

At iterate   16    f=  1.41518D+01    |proj g|=  4.32463D-04
Iteration wall time: 7.79
Total wall time: 157.05
Updating plot...
Calculating residual...
End time forward: 2.66
Total projection time forward: 2.61
Residual norm: 9.2389e+00
Regularizing...
Regularization norm: ['4.8836e+00']
End time adjoint: 2.91
Total projection time adjoint: 2.51
Gradient norm: 1.5478e-03
Regularizer call: 150
Regularization gradients: ['1.9015e-03']

At iterate   17    f=  1.41225D+01    |proj g|=  3.53662D-04
Iteration wall time: 8.11
Total wall time: 165.16
Updating plot...
Calculating residual...
End time forward: 2.66
Total projection time forward: 2.61
Residual norm: 9.1828e+00
Regularizing...
Regularization norm: ['4.9414e+00']
End time adjoint: 2.88
Total projection time adjoint: 2.47
Gradient norm: 1.6065e-03
Regularizer call: 152
Regularization gradients: ['1.7291e-03']
Iteration wall time: 7.36
Total wall time: 172.52
Updating plot...
Calculating residual...
End time forward: 2.58
Total projection time forward: 2.54
Residual norm: 9.2106e+00
Regularizing...
Regularization norm: ['4.8957e+00']
End time adjoint: 2.82
Total projection time adjoint: 2.43
Gradient norm: 1.5678e-03
Regularizer call: 154
Regularization gradients: ['1.8427e-03']

At iterate   18    f=  1.41062D+01    |proj g|=  2.90241D-04
Iteration wall time: 8.00
Total wall time: 180.52
Updating plot...
Calculating residual...
End time forward: 2.58
Total projection time forward: 2.54
Residual norm: 9.1877e+00
Regularizing...
Regularization norm: ['4.9397e+00']
End time adjoint: 2.87
Total projection time adjoint: 2.47
Gradient norm: 1.6247e-03
Regularizer call: 156
Regularization gradients: ['1.5376e-03']
Iteration wall time: 7.40
Total wall time: 187.92
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.52
Residual norm: 9.2001e+00
Regularizing...
Regularization norm: ['4.8996e+00']
End time adjoint: 2.91
Total projection time adjoint: 2.51
Gradient norm: 1.5792e-03
Regularizer call: 158
Regularization gradients: ['1.7816e-03']

At iterate   19    f=  1.40997D+01    |proj g|=  2.31757D-04

           * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

           * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
*****     19     25    956     0  4977   2.318D-04   1.410D+01
  F =   14.099696246993780

CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH
Saving coefficients to h5 ...
Saving rms_of_amplitude to h5 ...
Saving mean_of_amplitude to h5 ...
Saving std_of_amplitude to h5 ...
Saving relative_std_of_amplitude to h5 ...
Saving eigenvectors to h5 ...
Saving eigenvalues to h5 ...
Saving order_amplitude to h5 ...
Saving rank_2_tensor to h5 ...
Saving synthetic_data to h5 ...
reconstruction_type
algorithm
Maximum order not increased.
Running optimization...
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.6806e+02
Regularizing...
Regularization norm: ['2.4078e-08']
End time adjoint: 2.86
Total projection time adjoint: 2.46
Gradient norm: 7.0471e-03
Regularizer call: 160
Regularization gradients: ['2.4134e-07']
RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =      6368040     M =            3

At X0         0 variables are exactly at the bounds

At iterate    0    f=  1.68055D+02    |proj g|=  7.04716D-03
Iteration wall time: 9.30
Total wall time: 9.30
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.52
Residual norm: 1.6512e+02
Regularizing...
Regularization norm: ['1.9046e-04']
End time adjoint: 2.90
Total projection time adjoint: 2.49
Gradient norm: 6.9819e-03
Regularizer call: 162
Regularization gradients: ['2.6970e-05']
Iteration wall time: 7.22
Total wall time: 16.52
Updating plot...
Calculating residual...
End time forward: 2.48
Total projection time forward: 2.44
Residual norm: 1.6372e+02
Regularizing...
Regularization norm: ['4.1630e-04']
End time adjoint: 2.85
Total projection time adjoint: 2.45
Gradient norm: 6.9507e-03
Regularizer call: 164
Regularization gradients: ['3.9890e-05']

At iterate    1    f=  1.63725D+02    |proj g|=  6.91368D-03
Iteration wall time: 7.49
Total wall time: 24.01
Updating plot...
Calculating residual...
End time forward: 2.50
Total projection time forward: 2.46
Residual norm: 1.5478e+01
Regularizing...
Regularization norm: ['9.0009e+00']
End time adjoint: 2.85
Total projection time adjoint: 2.46
Gradient norm: 1.6283e-03
Regularizer call: 166
Regularization gradients: ['5.8958e-03']

At iterate    2    f=  2.44792D+01    |proj g|=  7.41813D-03
Iteration wall time: 7.61
Total wall time: 31.61
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.4935e+01
Regularizing...
Regularization norm: ['7.9460e+01']
End time adjoint: 2.88
Total projection time adjoint: 2.48
Gradient norm: 9.7456e-04
Regularizer call: 168
Regularization gradients: ['2.0578e-02']
Iteration wall time: 7.24
Total wall time: 38.86
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.5019e+01
Regularizing...
Regularization norm: ['3.9384e+00']
End time adjoint: 2.83
Total projection time adjoint: 2.44
Gradient norm: 1.5435e-03
Regularizer call: 170
Regularization gradients: ['3.3035e-03']

At iterate    3    f=  1.89575D+01    |proj g|=  4.41853D-03
Iteration wall time: 7.66
Total wall time: 46.52
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.49
Residual norm: 1.3615e+01
Regularizing...
Regularization norm: ['1.3320e+00']
End time adjoint: 2.86
Total projection time adjoint: 2.47
Gradient norm: 1.5733e-03
Regularizer call: 172
Regularization gradients: ['1.1622e-03']

At iterate    4    f=  1.49472D+01    |proj g|=  8.09108D-04
Iteration wall time: 7.81
Total wall time: 54.33
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.49
Residual norm: 1.2713e+01
Regularizing...
Regularization norm: ['1.4707e+00']
End time adjoint: 2.86
Total projection time adjoint: 2.45
Gradient norm: 1.5527e-03
Regularizer call: 174
Regularization gradients: ['1.3187e-03']

At iterate    5    f=  1.41842D+01    |proj g|=  8.28000D-04
Iteration wall time: 7.77
Total wall time: 62.10
Updating plot...
Calculating residual...
End time forward: 2.54
Total projection time forward: 2.50
Residual norm: 9.3630e+00
Regularizing...
Regularization norm: ['2.3816e+00']
End time adjoint: 2.82
Total projection time adjoint: 2.43
Gradient norm: 1.4569e-03
Regularizer call: 176
Regularization gradients: ['1.7256e-03']

At iterate    6    f=  1.17446D+01    |proj g|=  1.51592D-03
Iteration wall time: 7.70
Total wall time: 69.81
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.49
Residual norm: 8.2057e+00
Regularizing...
Regularization norm: ['5.8595e+00']
End time adjoint: 2.89
Total projection time adjoint: 2.45
Gradient norm: 1.3851e-03
Regularizer call: 178
Regularization gradients: ['3.6317e-03']
Iteration wall time: 7.28
Total wall time: 77.09
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 9.1274e+00
Regularizing...
Regularization norm: ['2.3363e+00']
End time adjoint: 2.82
Total projection time adjoint: 2.41
Gradient norm: 1.4478e-03
Regularizer call: 180
Regularization gradients: ['1.6640e-03']

At iterate    7    f=  1.14637D+01    |proj g|=  1.26643D-03
Iteration wall time: 7.70
Total wall time: 84.79
Updating plot...
Calculating residual...
End time forward: 2.54
Total projection time forward: 2.49
Residual norm: 8.4976e+00
Regularizing...
Regularization norm: ['2.3961e+00']
End time adjoint: 2.86
Total projection time adjoint: 2.47
Gradient norm: 1.4131e-03
Regularizer call: 182
Regularization gradients: ['1.4883e-03']

At iterate    8    f=  1.08937D+01    |proj g|=  4.07476D-04
Iteration wall time: 7.82
Total wall time: 92.61
Updating plot...
Calculating residual...
End time forward: 2.57
Total projection time forward: 2.53
Residual norm: 8.1853e+00
Regularizing...
Regularization norm: ['2.4934e+00']
End time adjoint: 2.80
Total projection time adjoint: 2.41
Gradient norm: 1.3884e-03
Regularizer call: 184
Regularization gradients: ['1.3450e-03']

At iterate    9    f=  1.06787D+01    |proj g|=  2.55591D-04
Iteration wall time: 7.98
Total wall time: 100.59
Updating plot...
Calculating residual...
End time forward: 2.58
Total projection time forward: 2.54
Residual norm: 7.8826e+00
Regularizing...
Regularization norm: ['2.6426e+00']
End time adjoint: 2.93
Total projection time adjoint: 2.54
Gradient norm: 1.3573e-03
Regularizer call: 186
Regularization gradients: ['1.3106e-03']

At iterate   10    f=  1.05252D+01    |proj g|=  4.37517D-04
Iteration wall time: 8.08
Total wall time: 108.66
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.51
Residual norm: 7.7587e+00
Regularizing...
Regularization norm: ['2.7002e+00']
End time adjoint: 2.83
Total projection time adjoint: 2.42
Gradient norm: 1.3467e-03
Regularizer call: 188
Regularization gradients: ['1.3142e-03']

At iterate   11    f=  1.04589D+01    |proj g|=  2.38103D-04
Iteration wall time: 7.65
Total wall time: 116.32
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.47
Residual norm: 7.7290e+00
Regularizing...
Regularization norm: ['2.6902e+00']
End time adjoint: 2.86
Total projection time adjoint: 2.45
Gradient norm: 1.3573e-03
Regularizer call: 190
Regularization gradients: ['1.3803e-03']

At iterate   12    f=  1.04192D+01    |proj g|=  2.12827D-04
Iteration wall time: 7.66
Total wall time: 123.98
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.48
Residual norm: 7.6960e+00
Regularizing...
Regularization norm: ['2.6902e+00']
End time adjoint: 2.85
Total projection time adjoint: 2.47
Gradient norm: 1.3762e-03
Regularizer call: 192
Regularization gradients: ['1.4434e-03']

At iterate   13    f=  1.03862D+01    |proj g|=  2.11054D-04
Iteration wall time: 7.64
Total wall time: 131.62
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.52
Residual norm: 7.6644e+00
Regularizing...
Regularization norm: ['2.7092e+00']
End time adjoint: 2.86
Total projection time adjoint: 2.47
Gradient norm: 1.4231e-03
Regularizer call: 194
Regularization gradients: ['1.3322e-03']

At iterate   14    f=  1.03736D+01    |proj g|=  3.10608D-04
Iteration wall time: 7.79
Total wall time: 139.41
Updating plot...
Calculating residual...
End time forward: 2.56
Total projection time forward: 2.52
Residual norm: 7.6367e+00
Regularizing...
Regularization norm: ['2.7612e+00']
End time adjoint: 2.87
Total projection time adjoint: 2.47
Gradient norm: 1.4350e-03
Regularizer call: 196
Regularization gradients: ['1.4716e-03']
Iteration wall time: 7.26
Total wall time: 146.67
Updating plot...
Calculating residual...
End time forward: 2.62
Total projection time forward: 2.57
Residual norm: 7.6563e+00
Regularizing...
Regularization norm: ['2.7084e+00']
End time adjoint: 2.94
Total projection time adjoint: 2.54
Gradient norm: 1.4256e-03
Regularizer call: 198
Regularization gradients: ['1.3611e-03']

At iterate   15    f=  1.03647D+01    |proj g|=  2.27116D-04

           * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

           * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
*****     15     20   2361     0 10300   2.271D-04   1.036D+01
  F =   10.364690407470937

CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH
Saving coefficients to h5 ...
Saving rms_of_amplitude to h5 ...
Saving mean_of_amplitude to h5 ...
Saving std_of_amplitude to h5 ...
Saving relative_std_of_amplitude to h5 ...
Saving eigenvectors to h5 ...
Saving eigenvalues to h5 ...
Saving order_amplitude to h5 ...
Saving rank_2_tensor to h5 ...
Saving synthetic_data to h5 ...
reconstruction_type
algorithm
Maximum order not increased.
Running optimization...
Updating plot...
Calculating residual...
End time forward: 2.53
Total projection time forward: 2.49
Residual norm: 1.6806e+02
Regularizing...
Regularization norm: ['8.6611e-09']
End time adjoint: 2.82
Total projection time adjoint: 2.41
Gradient norm: 7.0471e-03
Regularizer call: 200
Regularization gradients: ['9.1000e-08']
RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =      6368040     M =            3

At X0         0 variables are exactly at the bounds

At iterate    0    f=  1.68055D+02    |proj g|=  7.04710D-03
Iteration wall time: 8.93
Total wall time: 8.93
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.47
Residual norm: 1.6512e+02
Regularizing...
Regularization norm: ['6.8447e-05']
End time adjoint: 2.76
Total projection time adjoint: 2.35
Gradient norm: 6.9819e-03
Regularizer call: 202
Regularization gradients: ['9.6893e-06']
Iteration wall time: 7.06
Total wall time: 15.99
Updating plot...
Calculating residual...
End time forward: 2.55
Total projection time forward: 2.51
Residual norm: 1.6372e+02
Regularizing...
Regularization norm: ['1.4961e-04']
End time adjoint: 2.88
Total projection time adjoint: 2.48
Gradient norm: 6.9507e-03
Regularizer call: 204
Regularization gradients: ['1.4333e-05']

At iterate    1    f=  1.63724D+02    |proj g|=  6.93735D-03
Iteration wall time: 7.67
Total wall time: 23.66
Updating plot...
Calculating residual...
End time forward: 2.52
Total projection time forward: 2.48
Residual norm: 1.4907e+01
Regularizing...
Regularization norm: ['5.9663e-01']
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
Cell In[30], line 3
      1 #---- Do not modify ----#
      2 while regularization_curve_finder.continue_loop:
----> 3     optimizer.run_optimization()
      4     regularization_curve_finder.next_iteration()
      5     if (iteration) % interval == 0:

File ~/.local/lib/python3.9/site-packages/mumott/optimization/optimizer.py:76, in Optimizer.run_optimization(self)
     74 self._wall_time = None
     75 self._total_wall_time = None
---> 76 self._result = minimize(**self._minimize_args,
     77                         options=self._minimize_options)
     78 self._recon_in.optimization_coefficients = self._result.x

File /das/work/units/pem/p19745/Christian/miniconda3/envs/pysaxs/lib/python3.9/site-packages/scipy/optimize/_minimize.py:699, in minimize(fun, x0, args, method, jac, hess, hessp, bounds, constraints, tol, callback, options)
    696     res = _minimize_newtoncg(fun, x0, args, jac, hess, hessp, callback,
    697                              **options)
    698 elif meth == 'l-bfgs-b':
--> 699     res = _minimize_lbfgsb(fun, x0, args, jac, bounds,
    700                            callback=callback, **options)
    701 elif meth == 'tnc':
    702     res = _minimize_tnc(fun, x0, args, jac, bounds, callback=callback,
    703                         **options)

File /das/work/units/pem/p19745/Christian/miniconda3/envs/pysaxs/lib/python3.9/site-packages/scipy/optimize/_lbfgsb_py.py:360, in _minimize_lbfgsb(fun, x0, args, jac, bounds, disp, maxcor, ftol, gtol, eps, maxfun, maxiter, iprint, callback, maxls, finite_diff_rel_step, **unknown_options)
    354 task_str = task.tobytes()
    355 if task_str.startswith(b'FG'):
    356     # The minimization routine wants f and g at the current x.
    357     # Note that interruptions due to maxfun are postponed
    358     # until the completion of the current minimization iteration.
    359     # Overwrite f and g:
--> 360     f, g = func_and_grad(x)
    361 elif task_str.startswith(b'NEW_X'):
    362     # new iteration
    363     n_iterations += 1

File /das/work/units/pem/p19745/Christian/miniconda3/envs/pysaxs/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:286, in ScalarFunction.fun_and_grad(self, x)
    284     self._update_x_impl(x)
    285 self._update_fun()
--> 286 self._update_grad()
    287 return self.f, self.g

File /das/work/units/pem/p19745/Christian/miniconda3/envs/pysaxs/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:256, in ScalarFunction._update_grad(self)
    254 def _update_grad(self):
    255     if not self.g_updated:
--> 256         self._update_grad_impl()
    257         self.g_updated = True

File /das/work/units/pem/p19745/Christian/miniconda3/envs/pysaxs/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:167, in ScalarFunction.__init__.<locals>.update_grad()
    166 def update_grad():
--> 167     self.g = grad_wrapped(self.x)

File /das/work/units/pem/p19745/Christian/miniconda3/envs/pysaxs/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:164, in ScalarFunction.__init__.<locals>.grad_wrapped(x)
    162 def grad_wrapped(x):
    163     self.ngev += 1
--> 164     return np.atleast_1d(grad(np.copy(x), *args))

File ~/.local/lib/python3.9/site-packages/mumott/optimization/optimizer.py:163, in Optimizer._jacobian(self, new_coefficients)
    158 def _jacobian(self,
    159               new_coefficients: ArrayLike):
    160     np.einsum('..., ...', self._difference,
    161               self._reconstruction_parameters.projection_weights,
    162               out=self._difference, casting='same_kind')
--> 163     self._project_stack_adjoint(self._gradient_field)
    164     self._gradient_field *= np.reciprocal(np.float64(self._difference.size))
    165     gradient = self._gradient_field.ravel()

File ~/.local/lib/python3.9/site-packages/mumott/optimization/optimizer.py:115, in Optimizer._project_stack_adjoint(self, gradient_field)
    109     temp_frame = np.einsum('ijl, lk->ijk',
    110                            self._difference[start:stop].reshape(shape),
    111                            field_matrix,
    112                            order='C',
    113                            optimize='greedy')
    114     last = time()
--> 115     self._proj_params.adjoint(temp_frame, i, temp_volume, get_num_threads())
    116     accum += time() - last
    117 np.einsum('i...->...', temp_volume.reshape(-1, gradient_field.size),
    118           out=gradient_field, order='C', optimize='greedy')

File ~/.local/lib/python3.9/site-packages/mumott/core/projection_parameters.py:436, in ProjectionParameters.adjoint(self, projection, index, output_field, number_of_threads)
    434     np.einsum('i...->...', temp_output_field, out=output_field)
    435 else:
--> 436     john_transform_adjoint(projection, output_field, vector_p,
    437                            vector_j, vector_k, self._integration_step_size, projection_offsets,
    438                            self._sampling_kernel.ravel(), self._kernel_offsets.reshape(2, -1))
    439 set_num_threads(old_num_threads)
    440 return output_field

KeyboardInterrupt:

Step 5 - Pick regularization parameter for reconstruction

  • Choose a parameter based on the feedback plot (explanations will be added, or discuss with colleagues which to choose)

  • Rerun reconstructions with extended optimization parameters and for optimized regularization parameter

  • Potentially adapt the output_handler parameters too to adjust output path

optimization_parameters

[27]:
optimization_parameters = OptimizationParameters(
    reconstruction_parameters=reconstruction_parameters,
    integration_step_size=0.5,
    maximum_order=6,
    initial_value=1e-5,
    minimize_args=dict(method='L-BFGS-B'),
    minimize_options=dict(maxiter=50,  # for final reconstructions 40-50, initial ones at 25 is good
                          ftol=1e-6, # convergence criteria, input on useful values will help, 1e-5 typically good start, decreasing may help with convergence
                          gtol=1e-5, # tolerance for the largest absolute value in the gradient, convergence criteria for gradient
                          disp=1, # display updates
                          maxls=10, # maximum number of line search for stepsize
                          maxcor=3)) # how many terms in its approx of the Hess matrix (gradient matrix), momentum parameter of gradient
Maximum order not increased.

regularization_parameter

[28]:
l2_dict = RegularizationParameters(
    function_name='nearest_neighbor_l2',
    regularization_coefficients=tuple([1e-5 for i in range(4)]), # Regularize Coeff, this is a pythonic way of given startvalues 1e-7 for all order (0,2,4,6)
    orders=(0, 2, 4, 6)) # Which orders are included, should match the number of maximum_order from optimization_parameters

regularization_parameter_list = [l2_dict]

regularizer = Regularizer(
    reconstruction_parameters=reconstruction_parameters,
    regularization_parameter_list=regularization_parameter_list)

output_handler

[29]:
output_handler = OutputHandler(
    reconstruction_parameters=reconstruction_parameters,
    base_output_path = path, # Change to absolute path of where output folder should be generated
    create_enclosing_folder = True, # overwrite enclosing folder, should be True to automatically create folders
    overwrite_existing_files = True, # Overwrite existing files, should be True to automatically create folders
    enclosing_folder_name = 'output', # filename for output folder
    output_file_name = f'{name}_{fun_name}_{regularization_parameter_list:1.2e}_opt') # filename appendix, name is the dataset name as from the import

Output directory already exists!

Live view handler

[30]:
live_view_handler = LiveViewHandler(
    reconstruction_parameters=reconstruction_parameters,
    shown_orders=[0, 2],
    plane=1,
    cut_index= 'middle',
    orientation='transversal')
[31]:
optimizer = Optimizer(
    optimization_parameters=optimization_parameters,
        regularizer=regularizer,
    live_view_handler=live_view_handler)
Initializing optimizer...
[32]:
#---- Do not modify ----#
optimizer.run_optimization()
Running optimization...
Updating plot...
Calculating residual...
End time forward: 3.02
Total projection time forward: 2.94
Residual norm: 4.8097e+08
Regularizing...
Regularization norm: ['8.6638e-11']
End time adjoint: 3.33
Total projection time adjoint: 2.78
Gradient norm: 7.3993e+00
Regularizer call: 2
Regularization gradients: ['5.3221e-10']
RUNNING THE L-BFGS-B CODE

           * * *

Machine precision = 2.220D-16
 N =     10502800     M =            3

At X0         0 variables are exactly at the bounds

At iterate    0    f=  4.80968D+08    |proj g|=  7.39933D+00
Iteration wall time: 11.44
Total wall time: 11.44
Updating plot...
Calculating residual...
End time forward: 3.03
Total projection time forward: 2.92
Residual norm: 4.8096e+08
Regularizing...
Regularization norm: ['5.4001e-07']
End time adjoint: 3.28
Total projection time adjoint: 2.77
Gradient norm: 7.3993e+00
Regularizer call: 4
Regularization gradients: ['5.5126e-08']
Iteration wall time: 9.21
Total wall time: 20.65
Updating plot...
Calculating residual...
End time forward: 3.02
Total projection time forward: 2.94
Residual norm: 4.8095e+08
Regularizing...
Regularization norm: ['1.3498e-05']
End time adjoint: 3.98
Total projection time adjoint: 3.50
Gradient norm: 7.3992e+00
Regularizer call: 6
Regularization gradients: ['2.7486e-07']
Iteration wall time: 9.73
Total wall time: 30.38
Updating plot...
Calculating residual...
End time forward: 3.64
Total projection time forward: 3.56
Residual norm: 4.8089e+08
Regularizing...
Regularization norm: ['2.3811e-04']
End time adjoint: 3.83
Total projection time adjoint: 3.32
Gradient norm: 7.3988e+00
Regularizer call: 8
Regularization gradients: ['1.1538e-06']
Iteration wall time: 10.14
Total wall time: 40.52
Updating plot...
Calculating residual...
End time forward: 3.33
Total projection time forward: 3.25
Residual norm: 4.8064e+08
Regularizing...
Regularization norm: ['3.9009e-03']
End time adjoint: 3.62
Total projection time adjoint: 3.08
Gradient norm: 7.3971e+00
Regularizer call: 10
Regularization gradients: ['4.6694e-06']
Iteration wall time: 9.61
Total wall time: 50.13
Updating plot...
Calculating residual...
End time forward: 3.26
Total projection time forward: 3.18
Residual norm: 4.7966e+08
Regularizing...
Regularization norm: ['6.2783e-02']
End time adjoint: 3.70
Total projection time adjoint: 3.19
Gradient norm: 7.3903e+00
Regularizer call: 12
Regularization gradients: ['1.8732e-05']
Iteration wall time: 9.59
Total wall time: 59.72
Updating plot...
Calculating residual...
End time forward: 3.37
Total projection time forward: 3.29
Residual norm: 4.7574e+08
Regularizing...
Regularization norm: ['1.0060e+00']
End time adjoint: 3.75
Total projection time adjoint: 3.27
Gradient norm: 7.3634e+00
Regularizer call: 14
Regularization gradients: ['7.4983e-05']
Iteration wall time: 9.73
Total wall time: 69.44
Updating plot...
Calculating residual...
End time forward: 3.41
Total projection time forward: 3.34
Residual norm: 4.7361e+08
Regularizing...
Regularization norm: ['1.9996e+00']
End time adjoint: 4.16
Total projection time adjoint: 3.68
Gradient norm: 7.3486e+00
Regularizer call: 16
Regularization gradients: ['1.0571e-04']

At iterate    1    f=  4.73607D+08    |proj g|=  7.34858D+00
Iteration wall time: 10.70
Total wall time: 80.14
Updating plot...
Calculating residual...
End time forward: 3.56
Total projection time forward: 3.48
Residual norm: 4.7180e+07
Regularizing...
Regularization norm: ['4.8663e+04']
End time adjoint: 3.63
Total projection time adjoint: 3.13
Gradient norm: 1.7628e+00
Regularizer call: 18
Regularization gradients: ['1.8370e-02']

At iterate    2    f=  4.72292D+07    |proj g|=  1.74736D+00
Iteration wall time: 10.59
Total wall time: 90.73
Updating plot...
Calculating residual...
End time forward: 3.37
Total projection time forward: 3.29
Residual norm: 3.0662e+07
Regularizing...
Regularization norm: ['8.5151e+04']
End time adjoint: 3.81
Total projection time adjoint: 3.25
Gradient norm: 1.4034e+00
Regularizer call: 20
Regularization gradients: ['2.5492e-02']

At iterate    3    f=  3.07472D+07    |proj g|=  1.38115D+00
Iteration wall time: 10.77
Total wall time: 101.50
Updating plot...
Calculating residual...
End time forward: 3.47
Total projection time forward: 3.40
Residual norm: 1.2991e+07
Regularizing...
Regularization norm: ['2.5556e+05']
End time adjoint: 3.87
Total projection time adjoint: 3.38
Gradient norm: 6.9323e-01
Regularizer call: 22
Regularization gradients: ['4.6511e-02']

At iterate    4    f=  1.32470D+07    |proj g|=  6.52392D-01
Iteration wall time: 10.85
Total wall time: 112.35
Updating plot...
Calculating residual...
End time forward: 3.46
Total projection time forward: 3.39
Residual norm: 8.6728e+06
Regularizing...
Regularization norm: ['4.5228e+05']
End time adjoint: 3.41
Total projection time adjoint: 2.94
Gradient norm: 5.3147e-01
Regularizer call: 24
Regularization gradients: ['6.0194e-02']

At iterate    5    f=  9.12510D+06    |proj g|=  5.39801D-01
Iteration wall time: 10.35
Total wall time: 122.70
Updating plot...
Calculating residual...
End time forward: 3.18
Total projection time forward: 3.11
Residual norm: 6.3818e+06
Regularizing...
Regularization norm: ['6.2791e+05']
End time adjoint: 3.93
Total projection time adjoint: 3.44
Gradient norm: 3.7368e-01
Regularizer call: 26
Regularization gradients: ['7.1808e-02']

At iterate    6    f=  7.00968D+06    |proj g|=  3.65263D-01
Iteration wall time: 10.60
Total wall time: 133.30
Updating plot...
Calculating residual...
End time forward: 3.65
Total projection time forward: 3.59
Residual norm: 5.4202e+06
Regularizing...
Regularization norm: ['6.5607e+05']
End time adjoint: 3.82
Total projection time adjoint: 3.32
Gradient norm: 2.7716e-01
Regularizer call: 28
Regularization gradients: ['7.3534e-02']

At iterate    7    f=  6.07625D+06    |proj g|=  2.22017D-01
Iteration wall time: 10.98
Total wall time: 144.27
Updating plot...
Calculating residual...
End time forward: 3.85
Total projection time forward: 3.78
Residual norm: 4.7113e+06
Regularizing...
Regularization norm: ['7.2206e+05']
End time adjoint: 4.13
Total projection time adjoint: 3.63
Gradient norm: 2.7602e-01
Regularizer call: 30
Regularization gradients: ['7.7207e-02']

At iterate    8    f=  5.43333D+06    |proj g|=  2.22756D-01
Iteration wall time: 11.58
Total wall time: 155.85
Updating plot...
Calculating residual...
End time forward: 3.80
Total projection time forward: 3.73
Residual norm: 4.0405e+06
Regularizing...
Regularization norm: ['8.3904e+05']
End time adjoint: 4.11
Total projection time adjoint: 3.60
Gradient norm: 2.0690e-01
Regularizer call: 32
Regularization gradients: ['8.3041e-02']

At iterate    9    f=  4.87958D+06    |proj g|=  1.52748D-01
Iteration wall time: 11.51
Total wall time: 167.36
Updating plot...
Calculating residual...
End time forward: 3.60
Total projection time forward: 3.53
Residual norm: 3.7782e+06
Regularizing...
Regularization norm: ['1.0298e+06']
End time adjoint: 3.89
Total projection time adjoint: 3.32
Gradient norm: 2.6161e-01
Regularizer call: 34
Regularization gradients: ['9.1546e-02']

At iterate   10    f=  4.80797D+06    |proj g|=  2.34498D-01
Iteration wall time: 11.27
Total wall time: 178.64
Updating plot...
Calculating residual...
End time forward: 3.64
Total projection time forward: 3.58
Residual norm: 3.3644e+06
Regularizing...
Regularization norm: ['1.0226e+06']
End time adjoint: 3.81
Total projection time adjoint: 3.31
Gradient norm: 1.6307e-01
Regularizer call: 36
Regularization gradients: ['9.1465e-02']

At iterate   11    f=  4.38701D+06    |proj g|=  8.80596D-02
Iteration wall time: 11.39
Total wall time: 190.03
Updating plot...
Calculating residual...
End time forward: 3.78
Total projection time forward: 3.70
Residual norm: 3.2526e+06
Regularizing...
Regularization norm: ['1.0346e+06']
End time adjoint: 3.87
Total projection time adjoint: 3.40
Gradient norm: 1.5077e-01
Regularizer call: 38
Regularization gradients: ['9.2298e-02']

At iterate   12    f=  4.28721D+06    |proj g|=  7.05635D-02
Iteration wall time: 11.44
Total wall time: 201.46
Updating plot...
Calculating residual...
End time forward: 3.77
Total projection time forward: 3.71
Residual norm: 3.0783e+06
Regularizing...
Regularization norm: ['1.0896e+06']
End time adjoint: 4.02
Total projection time adjoint: 3.56
Gradient norm: 1.2792e-01
Regularizer call: 40
Regularization gradients: ['9.5312e-02']

At iterate   13    f=  4.16782D+06    |proj g|=  6.55816D-02
Iteration wall time: 11.40
Total wall time: 212.86
Updating plot...
Calculating residual...
End time forward: 3.76
Total projection time forward: 3.70
Residual norm: 2.9332e+06
Regularizing...
Regularization norm: ['1.1519e+06']
End time adjoint: 3.97
Total projection time adjoint: 3.39
Gradient norm: 1.1488e-01
Regularizer call: 42
Regularization gradients: ['9.9146e-02']

At iterate   14    f=  4.08512D+06    |proj g|=  8.93694D-02
Iteration wall time: 14.56
Total wall time: 227.42
Updating plot...
Calculating residual...
End time forward: 3.65
Total projection time forward: 3.58
Residual norm: 2.8034e+06
Regularizing...
Regularization norm: ['1.2140e+06']
End time adjoint: 3.93
Total projection time adjoint: 3.47
Gradient norm: 1.0172e-01
Regularizer call: 44
Regularization gradients: ['1.0268e-01']

At iterate   15    f=  4.01744D+06    |proj g|=  4.95052D-02
Iteration wall time: 11.31
Total wall time: 238.73
Updating plot...
Calculating residual...
End time forward: 3.84
Total projection time forward: 3.76
Residual norm: 2.7622e+06
Regularizing...
Regularization norm: ['1.2119e+06']
End time adjoint: 4.05
Total projection time adjoint: 3.48
Gradient norm: 1.0098e-01
Regularizer call: 46
Regularization gradients: ['1.0296e-01']

At iterate   16    f=  3.97419D+06    |proj g|=  4.36788D-02
Iteration wall time: 11.64
Total wall time: 250.37
Updating plot...
Calculating residual...
End time forward: 3.80
Total projection time forward: 3.73
Residual norm: 2.6991e+06
Regularizing...
Regularization norm: ['1.2234e+06']
End time adjoint: 4.05
Total projection time adjoint: 3.48
Gradient norm: 1.0403e-01
Regularizer call: 48
Regularization gradients: ['1.0454e-01']

At iterate   17    f=  3.92255D+06    |proj g|=  2.95803D-02
Iteration wall time: 11.64
Total wall time: 262.02
Updating plot...
Calculating residual...
End time forward: 3.82
Total projection time forward: 3.73
Residual norm: 2.6637e+06
Regularizing...
Regularization norm: ['1.2313e+06']
End time adjoint: 5.13
Total projection time adjoint: 4.59
Gradient norm: 1.2007e-01
Regularizer call: 50
Regularization gradients: ['1.0544e-01']

At iterate   18    f=  3.89499D+06    |proj g|=  5.60470D-02
Iteration wall time: 12.54
Total wall time: 274.56
Updating plot...
Calculating residual...
End time forward: 3.70
Total projection time forward: 3.64
Residual norm: 2.6324e+06
Regularizing...
Regularization norm: ['1.2345e+06']
End time adjoint: 4.04
Total projection time adjoint: 3.55
Gradient norm: 1.0640e-01
Regularizer call: 52
Regularization gradients: ['1.0568e-01']

At iterate   19    f=  3.86686D+06    |proj g|=  2.80285D-02
Iteration wall time: 11.51
Total wall time: 286.06
Updating plot...
Calculating residual...
End time forward: 3.69
Total projection time forward: 3.63
Residual norm: 2.6035e+06
Regularizing...
Regularization norm: ['1.2420e+06']
End time adjoint: 3.99
Total projection time adjoint: 3.47
Gradient norm: 1.0545e-01
Regularizer call: 54
Regularization gradients: ['1.0621e-01']

At iterate   20    f=  3.84545D+06    |proj g|=  2.50243D-02
Iteration wall time: 11.37
Total wall time: 297.44
Updating plot...
Calculating residual...
End time forward: 3.74
Total projection time forward: 3.67
Residual norm: 2.5850e+06
Regularizing...
Regularization norm: ['1.2473e+06']
End time adjoint: 4.04
Total projection time adjoint: 3.57
Gradient norm: 1.0597e-01
Regularizer call: 56
Regularization gradients: ['1.0656e-01']

At iterate   21    f=  3.83228D+06    |proj g|=  2.43931D-02
Iteration wall time: 11.31
Total wall time: 308.75
Updating plot...
Calculating residual...
End time forward: 3.83
Total projection time forward: 3.75
Residual norm: 2.5586e+06
Regularizing...
Regularization norm: ['1.2606e+06']
End time adjoint: 4.19
Total projection time adjoint: 3.71
Gradient norm: 1.0870e-01
Regularizer call: 58
Regularization gradients: ['1.0730e-01']

At iterate   22    f=  3.81918D+06    |proj g|=  3.68980D-02
Iteration wall time: 11.58
Total wall time: 320.33
Updating plot...
Calculating residual...
End time forward: 3.79
Total projection time forward: 3.72
Residual norm: 2.5368e+06
Regularizing...
Regularization norm: ['1.2639e+06']
End time adjoint: 4.02
Total projection time adjoint: 3.52
Gradient norm: 1.0877e-01
Regularizer call: 60
Regularization gradients: ['1.0747e-01']

At iterate   23    f=  3.80071D+06    |proj g|=  1.86047D-02
Iteration wall time: 11.34
Total wall time: 331.67
Updating plot...
Calculating residual...
End time forward: 3.87
Total projection time forward: 3.79
Residual norm: 2.5257e+06
Regularizing...
Regularization norm: ['1.2641e+06']
End time adjoint: 4.02
Total projection time adjoint: 3.48
Gradient norm: 1.0803e-01
Regularizer call: 62
Regularization gradients: ['1.0751e-01']

At iterate   24    f=  3.78981D+06    |proj g|=  2.15529D-02
Iteration wall time: 11.66
Total wall time: 343.33
Updating plot...
Calculating residual...
End time forward: 3.75
Total projection time forward: 3.69
Residual norm: 2.5119e+06
Regularizing...
Regularization norm: ['1.2654e+06']
End time adjoint: 4.06
Total projection time adjoint: 3.58
Gradient norm: 1.0475e-01
Regularizer call: 64
Regularization gradients: ['1.0759e-01']

At iterate   25    f=  3.77733D+06    |proj g|=  2.36646D-02
Iteration wall time: 11.73
Total wall time: 355.05
Updating plot...
Calculating residual...
End time forward: 3.80
Total projection time forward: 3.73
Residual norm: 2.5097e+06
Regularizing...
Regularization norm: ['1.2687e+06']
End time adjoint: 4.08
Total projection time adjoint: 3.59
Gradient norm: 1.1638e-01
Regularizer call: 66
Regularization gradients: ['1.0763e-01']
Iteration wall time: 10.86
Total wall time: 365.91
Updating plot...
Calculating residual...
End time forward: 3.80
Total projection time forward: 3.74
Residual norm: 2.5031e+06
Regularizing...
Regularization norm: ['1.2664e+06']
End time adjoint: 4.11
Total projection time adjoint: 3.63
Gradient norm: 1.0464e-01
Regularizer call: 68
Regularization gradients: ['1.0760e-01']

At iterate   26    f=  3.76946D+06    |proj g|=  2.41023D-02
Iteration wall time: 11.58
Total wall time: 377.49
Updating plot...
Calculating residual...
End time forward: 3.85
Total projection time forward: 3.80
Residual norm: 2.4907e+06
Regularizing...
Regularization norm: ['1.2691e+06']
End time adjoint: 4.27
Total projection time adjoint: 3.69
Gradient norm: 1.0182e-01
Regularizer call: 70
Regularization gradients: ['1.0763e-01']

At iterate   27    f=  3.75983D+06    |proj g|=  1.70979D-02
Iteration wall time: 15.07
Total wall time: 392.57
Updating plot...
Calculating residual...
End time forward: 3.89
Total projection time forward: 3.82
Residual norm: 2.4801e+06
Regularizing...
Regularization norm: ['1.2726e+06']
End time adjoint: 4.31
Total projection time adjoint: 3.82
Gradient norm: 1.0452e-01
Regularizer call: 72
Regularization gradients: ['1.0759e-01']

At iterate   28    f=  3.75265D+06    |proj g|=  2.20343D-02
Iteration wall time: 11.87
Total wall time: 404.44
Updating plot...
Calculating residual...
End time forward: 3.76
Total projection time forward: 3.69
Residual norm: 2.4705e+06
Regularizing...
Regularization norm: ['1.2778e+06']
End time adjoint: 3.91
Total projection time adjoint: 3.43
Gradient norm: 1.0449e-01
Regularizer call: 74
Regularization gradients: ['1.0754e-01']

At iterate   29    f=  3.74821D+06    |proj g|=  2.47928D-02
Iteration wall time: 11.22
Total wall time: 415.66
Updating plot...
Calculating residual...
End time forward: 3.67
Total projection time forward: 3.61
Residual norm: 2.4640e+06
Regularizing...
Regularization norm: ['1.2793e+06']
End time adjoint: 3.92
Total projection time adjoint: 3.43
Gradient norm: 1.0708e-01
Regularizer call: 76
Regularization gradients: ['1.0749e-01']

At iterate   30    f=  3.74330D+06    |proj g|=  1.42675D-02
Iteration wall time: 11.15
Total wall time: 426.80
Updating plot...
Calculating residual...
End time forward: 3.73
Total projection time forward: 3.67
Residual norm: 2.4569e+06
Regularizing...
Regularization norm: ['1.2805e+06']
End time adjoint: 3.97
Total projection time adjoint: 3.49
Gradient norm: 1.1046e-01
Regularizer call: 78
Regularization gradients: ['1.0743e-01']

At iterate   31    f=  3.73744D+06    |proj g|=  1.71928D-02
Iteration wall time: 11.22
Total wall time: 438.03
Updating plot...
Calculating residual...
End time forward: 3.74
Total projection time forward: 3.68
Residual norm: 2.4548e+06
Regularizing...
Regularization norm: ['1.2812e+06']
End time adjoint: 4.00
Total projection time adjoint: 3.51
Gradient norm: 1.1034e-01
Regularizer call: 80
Regularization gradients: ['1.0740e-01']

At iterate   32    f=  3.73593D+06    |proj g|=  3.41666D-02
Iteration wall time: 11.27
Total wall time: 449.30
Updating plot...
Calculating residual...
End time forward: 3.80
Total projection time forward: 3.73
Residual norm: 2.4483e+06
Regularizing...
Regularization norm: ['1.2802e+06']
End time adjoint: 3.96
Total projection time adjoint: 3.47
Gradient norm: 1.0869e-01
Regularizer call: 82
Regularization gradients: ['1.0741e-01']

At iterate   33    f=  3.72851D+06    |proj g|=  2.23274D-02
Iteration wall time: 11.29
Total wall time: 460.59
Updating plot...
Calculating residual...
End time forward: 3.83
Total projection time forward: 3.76
Residual norm: 2.4448e+06
Regularizing...
Regularization norm: ['1.2795e+06']
End time adjoint: 4.14
Total projection time adjoint: 3.58
Gradient norm: 1.0641e-01
Regularizer call: 84
Regularization gradients: ['1.0740e-01']

At iterate   34    f=  3.72426D+06    |proj g|=  1.95762D-02
Iteration wall time: 11.82
Total wall time: 472.41
Updating plot...
Calculating residual...
End time forward: 3.86
Total projection time forward: 3.78
Residual norm: 2.4421e+06
Regularizing...
Regularization norm: ['1.2791e+06']
End time adjoint: 3.95
Total projection time adjoint: 3.40
Gradient norm: 1.0460e-01
Regularizer call: 86
Regularization gradients: ['1.0736e-01']

At iterate   35    f=  3.72118D+06    |proj g|=  1.70718D-02
Iteration wall time: 11.65
Total wall time: 484.07
Updating plot...
Calculating residual...
End time forward: 3.78
Total projection time forward: 3.70
Residual norm: 2.4427e+06
Regularizing...
Regularization norm: ['1.2800e+06']
End time adjoint: 3.98
Total projection time adjoint: 3.44
Gradient norm: 1.0236e-01
Regularizer call: 88
Regularization gradients: ['1.0708e-01']
Iteration wall time: 10.69
Total wall time: 494.75
Updating plot...
Calculating residual...
End time forward: 3.85
Total projection time forward: 3.77
Residual norm: 2.4394e+06
Regularizing...
Regularization norm: ['1.2792e+06']
End time adjoint: 3.96
Total projection time adjoint: 3.41
Gradient norm: 1.0385e-01
Regularizer call: 90
Regularization gradients: ['1.0727e-01']

At iterate   36    f=  3.71855D+06    |proj g|=  1.71926D-02
Iteration wall time: 11.72
Total wall time: 506.47
Updating plot...
Calculating residual...
End time forward: 3.92
Total projection time forward: 3.83
Residual norm: 2.4352e+06
Regularizing...
Regularization norm: ['1.2801e+06']
End time adjoint: 6.15
Total projection time adjoint: 5.34
Gradient norm: 1.0288e-01
Regularizer call: 92
Regularization gradients: ['1.0705e-01']

At iterate   37    f=  3.71535D+06    |proj g|=  1.40979D-02
Iteration wall time: 15.12
Total wall time: 521.59
Updating plot...
Calculating residual...
End time forward: 3.75
Total projection time forward: 3.68
Residual norm: 2.4330e+06
Regularizing...
Regularization norm: ['1.2818e+06']
End time adjoint: 3.97
Total projection time adjoint: 3.49
Gradient norm: 1.0497e-01
Regularizer call: 94
Regularization gradients: ['1.0675e-01']

At iterate   38    f=  3.71475D+06    |proj g|=  1.63970D-02
Iteration wall time: 12.38
Total wall time: 533.98
Updating plot...
Calculating residual...
End time forward: 3.72
Total projection time forward: 3.64
Residual norm: 2.4293e+06
Regularizing...
Regularization norm: ['1.2830e+06']
End time adjoint: 4.03
Total projection time adjoint: 3.47
Gradient norm: 1.0467e-01
Regularizer call: 96
Regularization gradients: ['1.0656e-01']

At iterate   39    f=  3.71227D+06    |proj g|=  1.11507D-02
Iteration wall time: 11.55
Total wall time: 545.53
Updating plot...
Calculating residual...
End time forward: 3.78
Total projection time forward: 3.69
Residual norm: 2.4263e+06
Regularizing...
Regularization norm: ['1.2846e+06']
End time adjoint: 4.05
Total projection time adjoint: 3.49
Gradient norm: 1.0595e-01
Regularizer call: 98
Regularization gradients: ['1.0630e-01']

At iterate   40    f=  3.71087D+06    |proj g|=  1.26809D-02
Iteration wall time: 11.64
Total wall time: 557.17
Updating plot...
Calculating residual...
End time forward: 3.75
Total projection time forward: 3.69
Residual norm: 2.4240e+06
Regularizing...
Regularization norm: ['1.2863e+06']
End time adjoint: 4.01
Total projection time adjoint: 3.53
Gradient norm: 1.0740e-01
Regularizer call: 100
Regularization gradients: ['1.0604e-01']

At iterate   41    f=  3.71031D+06    |proj g|=  1.19423D-02
Iteration wall time: 11.33
Total wall time: 568.50
Updating plot...
Calculating residual...
End time forward: 3.84
Total projection time forward: 3.78
Residual norm: 2.4250e+06
Regularizing...
Regularization norm: ['1.2900e+06']
End time adjoint: 4.07
Total projection time adjoint: 3.54
Gradient norm: 1.0886e-01
Regularizer call: 102
Regularization gradients: ['1.0556e-01']
Iteration wall time: 10.60
Total wall time: 579.10
Updating plot...
Calculating residual...
End time forward: 3.91
Total projection time forward: 3.84
Residual norm: 2.4231e+06
Regularizing...
Regularization norm: ['1.2867e+06']
End time adjoint: 4.00
Total projection time adjoint: 3.53
Gradient norm: 1.0744e-01
Regularizer call: 104
Regularization gradients: ['1.0597e-01']

At iterate   42    f=  3.70982D+06    |proj g|=  1.25948D-02
Iteration wall time: 11.64
Total wall time: 590.74
Updating plot...
Calculating residual...
End time forward: 3.78
Total projection time forward: 3.70
Residual norm: 2.4204e+06
Regularizing...
Regularization norm: ['1.2902e+06']
End time adjoint: 4.00
Total projection time adjoint: 3.51
Gradient norm: 1.0827e-01
Regularizer call: 106
Regularization gradients: ['1.0551e-01']
Iteration wall time: 10.49
Total wall time: 601.23
Updating plot...
Calculating residual...
End time forward: 3.90
Total projection time forward: 3.82
Residual norm: 2.4217e+06
Regularizing...
Regularization norm: ['1.2874e+06']
End time adjoint: 4.03
Total projection time adjoint: 3.53
Gradient norm: 1.0764e-01
Regularizer call: 108
Regularization gradients: ['1.0586e-01']

At iterate   43    f=  3.70910D+06    |proj g|=  1.04994D-02
Iteration wall time: 11.81
Total wall time: 613.04
Updating plot...
Calculating residual...
End time forward: 3.73
Total projection time forward: 3.66
Residual norm: 2.4249e+06
Regularizing...
Regularization norm: ['1.2936e+06']
End time adjoint: 3.96
Total projection time adjoint: 3.47
Gradient norm: 1.0424e-01
Regularizer call: 110
Regularization gradients: ['1.0510e-01']
Iteration wall time: 10.75
Total wall time: 623.79
Updating plot...
Calculating residual...
End time forward: 3.90
Total projection time forward: 3.84
Residual norm: 2.4207e+06
Regularizing...
Regularization norm: ['1.2879e+06']
End time adjoint: 4.02
Total projection time adjoint: 3.53
Gradient norm: 1.0720e-01
Regularizer call: 112
Regularization gradients: ['1.0576e-01']

At iterate   44    f=  3.70856D+06    |proj g|=  1.28869D-02
Iteration wall time: 11.47
Total wall time: 635.26
Updating plot...
Calculating residual...
End time forward: 3.90
Total projection time forward: 3.82
Residual norm: 2.4199e+06
Regularizing...
Regularization norm: ['1.2955e+06']
End time adjoint: 4.03
Total projection time adjoint: 3.54
Gradient norm: 1.0569e-01
Regularizer call: 114
Regularization gradients: ['1.0491e-01']
Iteration wall time: 10.60
Total wall time: 645.86
Updating plot...
Calculating residual...
End time forward: 3.85
Total projection time forward: 3.79
Residual norm: 2.4194e+06
Regularizing...
Regularization norm: ['1.2886e+06']
End time adjoint: 3.97
Total projection time adjoint: 3.49
Gradient norm: 1.0698e-01
Regularizer call: 116
Regularization gradients: ['1.0563e-01']

At iterate   45    f=  3.70801D+06    |proj g|=  9.92253D-03
Iteration wall time: 11.32
Total wall time: 657.18
Updating plot...
Calculating residual...
End time forward: 3.78
Total projection time forward: 3.71
Residual norm: 2.4201e+06
Regularizing...
Regularization norm: ['1.2970e+06']
End time adjoint: 3.97
Total projection time adjoint: 3.49
Gradient norm: 1.0466e-01
Regularizer call: 118
Regularization gradients: ['1.0469e-01']
Iteration wall time: 10.36
Total wall time: 667.54
Updating plot...
Calculating residual...
End time forward: 3.84
Total projection time forward: 3.77
Residual norm: 2.4186e+06
Regularizing...
Regularization norm: ['1.2893e+06']
End time adjoint: 4.04
Total projection time adjoint: 3.50
Gradient norm: 1.0671e-01
Regularizer call: 120
Regularization gradients: ['1.0552e-01']

At iterate   46    f=  3.70785D+06    |proj g|=  1.04822D-02
Iteration wall time: 11.76
Total wall time: 679.30
Updating plot...
Calculating residual...
End time forward: 3.75
Total projection time forward: 3.67
Residual norm: 2.4543e+06
Regularizing...
Regularization norm: ['1.3068e+06']
End time adjoint: 4.02
Total projection time adjoint: 3.51
Gradient norm: 1.0154e-01
Regularizer call: 122
Regularization gradients: ['1.0389e-01']
Iteration wall time: 10.71
Total wall time: 690.01
Updating plot...
Calculating residual...
End time forward: 3.87
Total projection time forward: 3.78
Residual norm: 2.4176e+06
Regularizing...
Regularization norm: ['1.2899e+06']
End time adjoint: 4.11
Total projection time adjoint: 3.54
Gradient norm: 1.0637e-01
Regularizer call: 124
Regularization gradients: ['1.0542e-01']

At iterate   47    f=  3.70750D+06    |proj g|=  9.50193D-03
Iteration wall time: 11.90
Total wall time: 701.90
Updating plot...
Calculating residual...
End time forward: 4.28
Total projection time forward: 4.21
Residual norm: 2.4180e+06
Regularizing...
Regularization norm: ['1.2998e+06']
End time adjoint: 4.00
Total projection time adjoint: 3.53
Gradient norm: 1.0447e-01
Regularizer call: 126
Regularization gradients: ['1.0437e-01']
Iteration wall time: 11.02
Total wall time: 712.93
Updating plot...
Calculating residual...
End time forward: 3.77
Total projection time forward: 3.70
Residual norm: 2.4169e+06
Regularizing...
Regularization norm: ['1.2906e+06']
End time adjoint: 4.00
Total projection time adjoint: 3.53
Gradient norm: 1.0616e-01
Regularizer call: 128
Regularization gradients: ['1.0530e-01']
Iteration wall time: 10.43
Total wall time: 723.36
Updating plot...
Calculating residual...
End time forward: 3.76
Total projection time forward: 3.70
Residual norm: 2.4175e+06
Regularizing...
Regularization norm: ['1.2900e+06']
End time adjoint: 3.99
Total projection time adjoint: 3.52
Gradient norm: 1.0633e-01
Regularizer call: 130
Regularization gradients: ['1.0539e-01']
Iteration wall time: 10.38
Total wall time: 733.74
Updating plot...
Calculating residual...
End time forward: 3.76
Total projection time forward: 3.69
Residual norm: 2.4171e+06
Regularizing...
Regularization norm: ['1.2904e+06']
End time adjoint: 3.99
Total projection time adjoint: 3.52
Gradient norm: 1.0622e-01
Regularizer call: 132
Regularization gradients: ['1.0533e-01']
Iteration wall time: 10.38
Total wall time: 744.13
Updating plot...
Calculating residual...
End time forward: 3.79
Total projection time forward: 3.72
Residual norm: 2.4174e+06
Regularizing...
Regularization norm: ['1.2901e+06']
End time adjoint: 4.03
Total projection time adjoint: 3.55
Gradient norm: 1.0630e-01
Regularizer call: 134
Regularization gradients: ['1.0538e-01']
Iteration wall time: 10.46
Total wall time: 754.59
Updating plot...
Calculating residual...
End time forward: 3.81
Total projection time forward: 3.75
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.08
Total projection time adjoint: 3.59
Gradient norm: 1.0625e-01
Regularizer call: 136
Regularization gradients: ['1.0535e-01']
Iteration wall time: 10.95
Total wall time: 765.54
Updating plot...
Calculating residual...
End time forward: 3.91
Total projection time forward: 3.83
Residual norm: 2.4173e+06
Regularizing...
Regularization norm: ['1.2902e+06']
End time adjoint: 4.06
Total projection time adjoint: 3.50
Gradient norm: 1.0629e-01
Regularizer call: 138
Regularization gradients: ['1.0537e-01']
Iteration wall time: 11.81
Total wall time: 777.36
Updating plot...
Calculating residual...
End time forward: 3.90
Total projection time forward: 3.82
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.09
Total projection time adjoint: 3.52
Gradient norm: 1.0626e-01
Regularizer call: 140
Regularization gradients: ['1.0536e-01']
Iteration wall time: 10.86
Total wall time: 788.22
Updating plot...
Calculating residual...
End time forward: 3.85
Total projection time forward: 3.79
Residual norm: 2.4173e+06
Regularizing...
Regularization norm: ['1.2902e+06']
End time adjoint: 3.99
Total projection time adjoint: 3.51
Gradient norm: 1.0628e-01
Regularizer call: 142
Regularization gradients: ['1.0537e-01']
Iteration wall time: 10.51
Total wall time: 798.73
Updating plot...
Calculating residual...
End time forward: 3.75
Total projection time forward: 3.69
Residual norm: 2.4173e+06
Regularizing...
Regularization norm: ['1.2902e+06']
End time adjoint: 4.00
Total projection time adjoint: 3.52
Gradient norm: 1.0629e-01
Regularizer call: 144
Regularization gradients: ['1.0537e-01']

At iterate   48    f=  3.70748D+06    |proj g|=  9.55807D-03
Iteration wall time: 11.29
Total wall time: 810.01
Updating plot...
Calculating residual...
End time forward: 4.31
Total projection time forward: 4.24
Residual norm: 2.4426e+06
Regularizing...
Regularization norm: ['1.3089e+06']
End time adjoint: 5.19
Total projection time adjoint: 4.69
Gradient norm: 1.0075e-01
Regularizer call: 146
Regularization gradients: ['1.0365e-01']
Iteration wall time: 12.52
Total wall time: 822.54
Updating plot...
Calculating residual...
End time forward: 3.68
Total projection time forward: 3.61
Residual norm: 2.4168e+06
Regularizing...
Regularization norm: ['1.2908e+06']
End time adjoint: 4.11
Total projection time adjoint: 3.55
Gradient norm: 1.0578e-01
Regularizer call: 148
Regularization gradients: ['1.0526e-01']
Iteration wall time: 10.77
Total wall time: 833.30
Updating plot...
Calculating residual...
End time forward: 3.85
Total projection time forward: 3.76
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.06
Total projection time adjoint: 3.50
Gradient norm: 1.0619e-01
Regularizer call: 150
Regularization gradients: ['1.0535e-01']
Iteration wall time: 10.80
Total wall time: 844.11
Updating plot...
Calculating residual...
End time forward: 3.88
Total projection time forward: 3.79
Residual norm: 2.4169e+06
Regularizing...
Regularization norm: ['1.2906e+06']
End time adjoint: 4.06
Total projection time adjoint: 3.50
Gradient norm: 1.0592e-01
Regularizer call: 152
Regularization gradients: ['1.0529e-01']
Iteration wall time: 10.82
Total wall time: 854.93
Updating plot...
Calculating residual...
End time forward: 3.88
Total projection time forward: 3.79
Residual norm: 2.4171e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.02
Total projection time adjoint: 3.49
Gradient norm: 1.0614e-01
Regularizer call: 154
Regularization gradients: ['1.0534e-01']
Iteration wall time: 10.75
Total wall time: 865.67
Updating plot...
Calculating residual...
End time forward: 3.94
Total projection time forward: 3.87
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.06
Total projection time adjoint: 3.54
Gradient norm: 1.0618e-01
Regularizer call: 156
Regularization gradients: ['1.0535e-01']
Iteration wall time: 10.96
Total wall time: 876.63
Updating plot...
Calculating residual...
End time forward: 3.82
Total projection time forward: 3.76
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.19
Total projection time adjoint: 3.70
Gradient norm: 1.0615e-01
Regularizer call: 158
Regularization gradients: ['1.0534e-01']
Iteration wall time: 10.73
Total wall time: 887.36
Updating plot...
Calculating residual...
End time forward: 3.86
Total projection time forward: 3.78
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.12
Total projection time adjoint: 3.63
Gradient norm: 1.0617e-01
Regularizer call: 160
Regularization gradients: ['1.0535e-01']
Iteration wall time: 10.98
Total wall time: 898.34
Updating plot...
Calculating residual...
End time forward: 3.78
Total projection time forward: 3.70
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.06
Total projection time adjoint: 3.50
Gradient norm: 1.0616e-01
Regularizer call: 162
Regularization gradients: ['1.0534e-01']
Iteration wall time: 10.75
Total wall time: 909.09
Updating plot...
Calculating residual...
End time forward: 3.76
Total projection time forward: 3.66
Residual norm: 2.4172e+06
Regularizing...
Regularization norm: ['1.2903e+06']
End time adjoint: 4.01
Total projection time adjoint: 3.50
Gradient norm: 1.0617e-01
Regularizer call: 164
Regularization gradients: ['1.0535e-01']

 Bad direction in the line search;
   refresh the lbfgs memory and restart the iteration.
Iteration wall time: 11.11
Total wall time: 920.20
Updating plot...
Calculating residual...
End time forward: 3.76
Total projection time forward: 3.70
Residual norm: 2.4173e+06
Regularizing...
Regularization norm: ['1.2902e+06']
End time adjoint: 3.95
Total projection time adjoint: 3.48
Gradient norm: 1.0629e-01
Regularizer call: 166
Regularization gradients: ['1.0537e-01']

At iterate   49    f=  3.70748D+06    |proj g|=  9.53718D-03
Iteration wall time: 10.92
Total wall time: 931.12
Updating plot...
Calculating residual...
End time forward: 3.80
Total projection time forward: 3.74
Residual norm: 2.4161e+06
Regularizing...
Regularization norm: ['1.2889e+06']
End time adjoint: 3.95
Total projection time adjoint: 3.48
Gradient norm: 1.0622e-01
Regularizer call: 168
Regularization gradients: ['1.0537e-01']

At iterate   50    f=  3.70499D+06    |proj g|=  7.90266D-03

           * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

           * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
*****     50     84  85533     0 61143   7.903D-03   3.705D+06
  F =   3704991.8773366986

STOP: TOTAL NO. of ITERATIONS REACHED LIMIT

Step 4.1 - Check results

  • This is a quick and dirty hacked way to access the data for the reconstruction along different planes. Visualization might be a bit ackward (partly duplicated plot), but it works fine for the moment: 0: yz plane ; 1: xz plane ; 2: xy plane

  • You can scroll through the tomogram and see if results match your expectations

  • For details on representation, you can type LiveViewHandler? in a new tab - the widget/scrolling option is the hacked part

[34]:
# ----- modify here which which plane to look at ----- #
plane_chosen = 0
data_container.stack.volume_shape

#---- Do not modify ----#
# Hacked version to access parameters from the live_view_handler of getting information for slices along different planes through the reconstruction
live_view_handler = LiveViewHandler(
    reconstruction_parameters=reconstruction_parameters,
    shown_orders=[0, 2],
    plane=plane_chosen,
    cut_index= data_container.stack.volume_shape[plane_chosen]//2,
    orientation='transversal')
#display(live_view_handler.figure)

@interact(slice_cut=(0,data_container.stack.volume_shape[plane_chosen]-1))
def plot(slice_cut):
    live_view_handler._cut_index = slice_cut
    live_view_handler.update_plots()
    #display(live_view_handler.figure)

We now run the save_output method of our OutputHandler instance.

Step 6 - Save output to file

This stores the results of the reconstruction to a file. It takes the input parameters as given within the initialization of the output_handler

[50]:
#---- Do not modify ----#
# Can I get the full output name, I do not find access to the enclosing folder here
print(f"Saving data to file {os.path.join(output_handler._base_output_path, 'output', output_handler._output_file_name)}")
output_handler.save_output()
Saving data to file ./output/dataset_q_0.027_0.031.h5_output
/data/visitors/formax/sw/envs/mumott-env/lib/python3.9/site-packages/mumott-0.2-py3.9.egg/mumott/output_handling/output_handler.py:222: RuntimeWarning: divide by zero encountered in divide
  return np.nan_to_num(self._std_of_amplitude() / self._mean_of_amplitude(),
h5 file already exists, but overwrite_existing_files is set to True. File will be overwritten.
Saving coefficients to h5 ...
Saving rms_of_amplitude to h5 ...
Saving mean_of_amplitude to h5 ...
Saving std_of_amplitude to h5 ...
Saving relative_std_of_amplitude to h5 ...
Saving eigenvectors to h5 ...
Saving eigenvalues to h5 ...
Saving order_amplitude to h5 ...
Saving rank_2_tensor to h5 ...
Saving synthetic_data to h5 ...
reconstruction_type
algorithm