% file: scan_demo.sl 10/28/12 - dd % % Demonstrate how to use the e2d_scan_par routine to % adjust parameter values for better data-model agreement % (lower FOM.) % % - - - - - % Setup Data, Model and Viewing parameters % Load the data and the model .source e0102_acis_data ; .source e0102_model ; % Update the model and % Look at the data, model, and residual images: e2d_pars2fom; e2d_view_resid; % It's pretty clear that the model is very crude compared with the data... % % Use coarser cells and blur the data (and model) to be more comparable to the Einstein HRI: e2d_set_view(1, [ -30 , 30 , 2.5 ] , [ -30 , 30 , 2.5 ] ); e2d_view[1].nsmoo=3; % set a higher residual color-coding threshold: e2d_view[1].chigreen=2.5; % and set a minimum fractional sigma (10%): e2d_meta[1].scisigma=0.1; % Evaluate and compare the model-data now: e2d_pars2fom; s3d_list_model; e2d_norm_optimum(0.001); % - Minimum FOM of 1144.41 at norm factor = 0.923986 e2d_view_resid; % OK, at this level the model and data have more similar amounts % of structure. % Note from the residuals that there are 3 high-data (red, yellow) regions, % these are likely the three other blobs that Hughes'94 included in % his modeling. But, we'll ignore them... #iffalse % - - - - - % DEMO of a parameter scan % Some parameters may not couple much with other ones and so % they can be roughly determined by just scanning through a % range of values using e2d_scan_par: % %hydra> e2d_scan_par; %................. Example of doing a parameter scan: % Setup the parameter to be scanned in e2d_update_pars: % public define e2d_update_pars () % { % s3d_ps.beta = e2d_scan_vals[e2d_iscan]; % } % Execute e2d_scan_par with arguments as shown in Usage, % e.g. e2d_scan_par([0.38:0.44:#7],3); % After scanning, cancel e2d_update_pars definition with: % e2d_update_pars_NULL; %Usage: ................. e2d_scan_par(scan_vals_array [, nsamps(= 1, 3 or 5) ]) % - - - % We can scan the norm of the spherical component (currently 0.52) public define e2d_update_pars () { s3d_ps.norm2 = e2d_scan_vals[e2d_iscan]; }; e2d_scan_par([0.27:0.67:#9],3); % Minimum FOM is at scan value = 0.42 giving a FOM of 1112.61 +/- 33.2813 % with a best norm adjust of 1.02058 % *** Parameter(s) set to this best-FOM value, BUT model not re-evaluated. *** % Fitting gives minimum at scan value = 0.446251 +/- 0.0296031, with a FOM of 1133.53 % OK, done with the scan, deactivate the scan definition: e2d_update_pars_NULL; % Looking at the plot it has a non-symmetric shape % and a minimum around 0.42 is reasonable:: s3d_ps.norm2=0.42; % Evaluate and compare the model-data now: e2d_pars2fom; s3d_list_model; e2d_norm_optimum(0.001); % - Minimum FOM of 1167.98 at norm factor = 1.03023 e2d_view_resid; % - - - % scan for the Blob norm... public define e2d_update_pars () { s3d_ps.norm3 = e2d_scan_vals[e2d_iscan]; }; e2d_scan_par([0.01:0.04:#9],3); % Minimum FOM is at scan value = 0.02875 giving a FOM of 1086.88 +/- 23.4107 % with a best norm adjust of 1.0178 % *** Parameter(s) set to this best-FOM value, BUT model not re-evaluated. *** % Fitting gives minimum at scan value = 0.0271766 +/- 0.00288016, with a FOM of 1090.69 % OK, done with the scan, deactivate the scan definition: e2d_update_pars_NULL; % Looking at the plot it has a minimum around 0.028: s3d_ps.norm3=0.028; % Evaluate and compare the model-data now: e2d_pars2fom; s3d_list_model; e2d_norm_optimum(0.001); % - Minimum FOM of 1056.74 at norm factor = 1.0192 e2d_view_resid; % - - - % We can scan the azimuthal max-density angle, s3d_ps.az0: public define e2d_update_pars () { s3d_ps.az0 = e2d_scan_vals[e2d_iscan]; }; e2d_scan_par([-160.0:-90.0:#13],5); % Note the increase of scan points (13) and more samples-per-point (5) % to try to get a more accurate curve for the az0. % % Minimum FOM is at scan value = -126.25 giving a FOM of 1142.06 +/- 26.0289 % with a best norm adjust of 0.924004 % *** Parameter(s) set to this best-FOM value, BUT model not re-evaluated. *** % Fitting gives minimum at scan value = -128.414 +/- 8.46612, with a FOM of 1156.97 % OK, done with the scan, deactivate the scan definition: e2d_update_pars_NULL; % Looking at the plot the value is not sharply determined and % a value of -125.0 seems reasonable: s3d_ps.az0=-125.0; % Evaluate and compare the model-data now: e2d_pars2fom; s3d_list_model; e2d_norm_optimum(0.001); % - Minimum FOM of 1039.92 at norm factor = 1.01538 e2d_view_resid; #endif