Change Log for v3d.sl, source3d.sl, and event2d.sl See also: http://space.mit.edu/home/dd/Event2D/ ====================================== v3d: ===================================== Changes to consider making: > allow nominal viewing angles for volview from v3d_view. Changes made: ---- 1.2.1 ---- 5/3/11 - Small change in v3d_mc_cells to speed it up. - Added v3d_evtimg to v3d_help output. ---- 1.2.0 ---- 5/10/10 - Added public variable save_image_file : NULL for screen viewing, if a non-NULL string then the output is writted to a file, e.g. for v3d_view and v3d_project. * The value is reset to NULL after it is used. - v3d_histxy: fill the middle z-plane: changed v3d_na+1 to v3d_na. ---- 1.0.1 ---- 9/2/08 - Check for hist2d added to v3d_histxy. - Added "..."s to usage message for clarity in output. - v3d_reproject added. - v3d_histxy added to make realistic 3d arrays from events. ---- 1.0.0 ---- 10/16/07 - v3d_evtimg: add selection before histogram to keep only events less than cube radius in x and y (that dang hist2d's upper-most bin...) ====================================== source3d: ====================================== Changes to consider making: > include option of spectral plots in erg/s[.cm^2]/Hz vs Hz > Make it not need isis - add ifexists on the NH stuff? > Make it not need any plotting stuff, e.g. "xlog" etc. though ifexists... > Use "grace" for s3d plotting of spectra. > Add routine(s) to calcualate physical parameters from the model, e.g., n_e, mass, etc. based on interpretation of "norm"... > Add an s3d_NPIX to set the size of imdisplay output (instead of 256). > Make sure it compiles without imdisplay and volview etc. ifexists ... Changes made: ---- 1.2.0 ---- 5/10/10 - s3d_default_title: Reset the s3d_TITLE to NULL after it is used. - Change "s3d_ps_last=s3d_ps" to "s3d_ps_last=@s3d_ps" in s3d_update to make/save a copy of the values (rather just a pointer). - add type "xabs2d": a 2D absorption'screen' component. - make s3d_addin_spectrum(index, file) to add a spectrum to an existing one. - make_spectrum_lookup: remove middle 0's - yeesh. ---- 1.1.3 ---- 12/28/08 - added a public variable s3d_TITLE that can be user defined to set the plot title; a routines s3d_default_title(string) is called to set a nominal title in case the user does not provide one by leaving s3d_TITLE=NULL. - little cosmetic changes. ---- 1.1.2 ---- 12/15/08 - make_spectrum_lookup: remove leading and trailing 0's and 1's in flux lookup array (interp_linear wants strictly increasing values) ---- 1.1.1 ---- 9/23/08 - interp_linear fails if the flup has leading 0's - remove them in make_spectrum_lookup. - added "..."s to usage output for clarity. - include the s3d component id in the output of s3d_xray_photons. ---- 1.1.0 ---- 1/6/08 - add support for "opaque" type components through the routine s3d_update_opaque which is called following the users s3d_update_comp routine. - change s3d_view_comps default to 0 - no axis slicing. ---- 1.0.0 ---- 11/12/07 - only generate events from "xray" type components ---- 0.9.5 ---- 10/16/07 - show the s3d_SHOW_NHARF_PLOT variable in 'help. - nh_plot: check for NULL NH value - s3d_list_model: list_spectra, list_comps, print(s3d_ps) and print some of the other s3d variables ... - component name with MC number generating message - catch case of 0 MC photons for a component - add s3d_lam_short and 'long variables to define nominal NH and spectra grids. - extend arf to NH range; and NHarf to spectrum range - then clip spectrum lookup at the lam_long, lam_short values. ====================================== event2d: ====================================== Changes to consider making: > To allow re-use of a simulation (e.g., X,Y data set and a RADIUS,ENERGY from the same simulation) add a meta field "simtype" that is : "unique"[default], "save", "same" > Re "selected indices" : Have one place where the selection is made. Don't reselect and re-histogram unless view changed... > Add (color-yellow?) tick marks on view and resid axes (or on wavelength axis at least.) > Add ability to use RGS data. > Use a 2D K-S test to compare data-model events ? > Any clever/standard ways to do verbosity levels ? > Use "grace" for e2d plots (K-S, 1D). > Use of VWhere to define the filter-for-FOM region > Add "e2d_fill_pha", to go from E2D to ISIS, if considered generally useful. > Make an e2d_event_diff routine: input x1,y1, x2,y2, oversim2 output: xc,yc (common events), jx1,jy1, jx2,jy2 (just in one set events) > Add usage info for routines if called with no args. > How to add/use a custom instrument easily ? (able to change: PSF, rmf, and arf factor > make an e2d_vwhere_fomlog routine. > adjust the factor from smand to mcmc size depending on length(cg_p0) ? test with N-d Gaussian. > e2d_plot_1d: have it set the plot title > 'fomlog_plot: Allow fom_delta to give a percentage of points (if negative?) > add ave_value = e2d_fomlog_mcave("tage_name"); > Make sure it compiles without imdisplay and volview etc. ifexists ... Changes made: ----1.2.1 ---- 5/12/11 - Changed Data-Model uncertainty to be given by: sigma^2 = 0.37*Di + 0.63*Mi This is a hybrid between "sigma=Data" and "sigma=Model" and has properties similar to the C-statistic. ----1.2.0 ---- 5/10/10 - 'view_data, 'view_model, 'view_resid: all will use save_image_file if non-NULL. - 'plot_ks, 'plot_1d[rat]: ENERGY plot scale is log provided Emax/Emin > 4.0 . - Added .des and .mes : data and model energies; envalid in meta indicates it is present. Makes it Event2D+1 and hopefully more useful for future micro-calorimeter instruments with true 3D data. Modify the 1-D plot routines to allow index "3" for this energy - the energy values used/plotted are only the ones in the current x-y spatial selection. - Add public variables for Micro-X performance: MICROX_TES_FWHM=4.5, MICROX_HPD_ARCMIN=4.0; ---- 1.1.3 ---- 12/28/08 - Added e2d_fomlog_history to plot s3d_ps vs iteration, especially after MCMC. - Added 'tot_nfom and output FOM/sqrt(2*Nfom) with 'list_fom output. - Output individual .ps files per plot from 'fomlog_plot; include tags in filename. - added a public variable e2d_TITLE that can be user defined to set the plot title; a routines e2d_default_title(string) is called to set a nominal title in case the user does not provide one by leaving e2d_TITLE=NULL. - In e2d_merge_data: add copying of model events too if model is valid for first data set being merged. Sets '.modvalid=1 also. ---- 1.1.2 ---- 12/15/08 - Slight adjustment to the 2-Gaussian approx to Chandra PSF, based on streak fit: http://space.mit.edu/HETG/technotes/zo_1d/zo_2gauss.html - e2d_inst_xray: Added Micro-X telescope (2-Gaussian approx) and TES detector. - e2d_inst_xray: Added LETG coarse-support diffraction; improved agreement with LETG-ACIS Capella obs by increasing LETG dp/p and roll rms values. - e2d_plot_1d: adjust lower yrange to be max([0.5,0.5*min(ks_yd)]) ---- 1.1.1 ---- 9/29/08 - e2d_fomlog_plot: add optional delta_fom value to flag low-fom points. - e2d_mcmc_explore updated: add small jitter to new point location and the FOM is re-evaluated (to avoid being stuck by a one-time anomalously low fom.) - a few bug removals in 1d plotting routines. - In e2d_setup_arf look for FRACEXPO only for dispersed ( abs(order) > 0 ) data sets. ---- 1.1.0 ---- 9/23/08 - Added e2d_mcmc_explore to do MCMC using the same setup as the cg fit. - Added e2d_fomlog_plot routine; color coded etc. to view scans,fits,mcmc's. - Add "how to fit user function" to cg_fit no-argument help message. - Add fomlog variables and the routine e2d_fomlog_saveval to keep track of scanning, fitting, and mcmc progress by saving FOM and s3d_ps values. e2d_fomlog_i=0 resets the log; save the type of the fom in 'fomlog_Types: 0 = user-scan, 2 = fit-scan, 1 = fit-deriv, 3 = mcmc explore, etc. - Include oslo and oshi values in 'meta. User can set them and they are used when loading dispersed detector data into model events to remove events that are outside the order selection (relevant for very extended sources, e.g. Hydra A.) Same conventions as in CIAO osort_lo/hi. - Add "ORDER", real-valued = abs(TG_MLAM)/(hc/E_ccd), as a possible event Y-axis. - Added .name to the meta structure: starts as Object and can be user changed to label the dataset in e2d_list_data output. - cg_fit and scan_par no-argument help output improved w/template routine - Added detailed help info when e2d_scan_par and e2d_cg_fit are called with no arguments. - added "..."s to usage for clarity. - e2d_plot_1drat added. - e2d_plot_ks: add dmratio and data counts on plot labels. - add nsmoo[th] to view struct to optionally smooth the histograms. - add a selected data indices, dsel, to data structure; and msel for model. - clip the red/blue residual levels at a max value relative to green. - add +/- 1 sigma error to D/M values of fom printout - propogate the s3d component value through the xray simulation process. Thus model output (e2d_data[didx].m*) now includes a "mic" array giving the s3d-component values, along with the mxs and mys. - added e2d_chipc_plot to show chi--percent errors plot of a dataset. (Only plots the points used in FOM evaluation.) - added "scisigma" to meta strucuture to set the fractional error clipping level when uncertainty and chi's are calculated. Default value is 1.e-5 (i.e., 0). - created new routines: e2d_merge_data(iout, [inputs], [xoffsets], [yoffsets]); to combine events from multiple datasets into one dataset with offsets appled as well. Useful for pretty combined images. Also make a corresponding: e2d_merge_model(iout, [inputs], [xoffsets], [yoffsets]); - If meta[].modvalid is 0 for a dataset when 1d or ks plotting, then set the model to uniform random values in the view range. - Define and add a 'hook' routine, e2d_fomlog_saveval, to the e2d_scan_par routine. This can be user defined to save the FOM and parameter values for VWhere viewing after scanning or cg_fit'ing. - change "target" to "object" in e2d_list_data output. - e2d_inst_xray: Adjust the TIMEs of dimulated events to include the effect of,e.g., readout transfer time: detector time = sim timet / DTCOR e2d_inst2mod: Simulated TIMEs: add the min of data times to them in order to register data/model correctly. (Note that data times are w.r.t. TSTART of the observation so their min is not necessarily 0.0) ---- 1.0.1 ---- 11/16/07 - Add an Iteration 0 to 'cg_fit and evaluate the starting FOM. - Bug: mis-calculated the Delta-p0 value, sqrt( sum( () )^2 ) should be: sqrt( sum( ()^2 ) ) ---- 1.0.0 ---- 11/12/07 - Add e2d_cg_fit routine with heuristics, HTML output w/scan plot links. - Add e2d_scan_par routine with heuristics :-) - Add a "panes" tag to the e2d_view structure: set to vert or horiz. - Add e2d_norm_optimum (more efficient than 'norm_scale; no plot) - Add computation of p-value for KS tests, uses ks_test2 from "stats" module - Bug: add oversim to mhist when viewing the model. ---- 0.9.5 ---- 10/16/07 - print 50%, 90%, and max events/bin when viewing data. - Add e2d_update_pars_NULL to reset e2d_update_pars to do-nothing. - Bug: Found and corrected error in 'inst_xray: detector blur NOT included in dispersed simulations (OK for E0102, but not for '87A !) - Added a second Gaussian to PSF to better match MARX. - Added routine e2d_plot_1d; yrange scaled to max of data,model; data as histogram and model as connected line. - To distinguish a small plus and a small minus residual, 'view_resid now uses 4 color levels: red, green-yellow, green, blue. - Average the "year obs" when doing e2d_addin_data - Changed default Chandra-ACIS blur to be without randomization - New routine: e2d_addin_data(i,j); - Included oversim in uncertainty: sigma^2 = data counts + (scaled model counts / oversim) - Bug: corrected event selection in e2d_plot_ks (oops!) ---- 0.9.3 --- - add nfom to the E2dData_Type struct, e2d_data, with the number of selected residual cells. - change 'eval_fom to not have printing and add a 'list_fom; use list in 'pars2fom. - plot_ks: catch an invalid model and return w/o a plot. - do a flip on data,model,residual arrays before going to imdisplay. =====================================