solve_use_matrix

PURPOSE ^

SOLVE_USE_MATRIX solve using reconstruction matrix

SYNOPSIS ^

function img= solve_use_matrix( inv_model, data1, data2)

DESCRIPTION ^

 SOLVE_USE_MATRIX solve using reconstruction matrix
 img= solve_use_matrix( inv_model, data1, data2)
 img        => output image (or vector of images)
 data1      => differential data at earlier time
 data2      => differential data at later time
 inv_model  => inverse model struct
 inv_model.solve_use_matrix.RM  = rec_matrix
 inv_model.solve_use_matrix.map = map to elements (optional)
    map is the size of the reconst model. contains
    zero if elem is unfilled, otherwise pointer to matrix row
 inv_model.solve_use_matrix.solve_nodes (default to elements)
    if 1, then solution goes to the img.node_data value

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function img= solve_use_matrix( inv_model, data1, data2)
0002 % SOLVE_USE_MATRIX solve using reconstruction matrix
0003 % img= solve_use_matrix( inv_model, data1, data2)
0004 % img        => output image (or vector of images)
0005 % data1      => differential data at earlier time
0006 % data2      => differential data at later time
0007 % inv_model  => inverse model struct
0008 % inv_model.solve_use_matrix.RM  = rec_matrix
0009 % inv_model.solve_use_matrix.map = map to elements (optional)
0010 %    map is the size of the reconst model. contains
0011 %    zero if elem is unfilled, otherwise pointer to matrix row
0012 % inv_model.solve_use_matrix.solve_nodes (default to elements)
0013 %    if 1, then solution goes to the img.node_data value
0014 
0015 % (C) 2008 Andy Adler. License: GPL version 2 or version 3
0016 % $Id: solve_use_matrix.m 5289 2016-11-02 08:43:12Z fab-b $
0017 
0018 dv = calc_difference_data( data1, data2, inv_model.fwd_model);
0019 
0020 RM = inv_model.solve_use_matrix.RM;
0021 
0022 if isfield(inv_model.solve_use_matrix,'map')
0023    map = inv_model.solve_use_matrix.map;
0024 else
0025    map = 1:size(RM,1);
0026 end
0027 
0028 
0029 rec= inv_model.solve_use_matrix.RM * dv;
0030 sol = rec(map,:);
0031 
0032 % create a data structure to return
0033 try   
0034     img.name= ['solved by ', inv_model.name];
0035 catch
0036     img.name= ['solved by solve_use_matrix'];
0037 end
0038 
0039 solve_to = 'elem_data';
0040 try if inv_model.solve_use_matrix.solve_nodes == 1
0041    solve_to = 'node_data';
0042 end; end
0043 
0044 if isfield(inv_model.solve_use_matrix,'params')
0045     img.(inv_model.solve_use_matrix.params).(solve_to) = sol;
0046 else
0047     img.(solve_to) = sol;
0048 end
0049 img.fwd_model= inv_model.fwd_model;

Generated on Wed 21-Jun-2017 09:29:07 by m2html © 2005