PRO eae_do_it_all, PRELIMS=prelims, POSTPROC=postproc, WEBPROC=webproc ; ; This procedure is used to generate the Effective Area / Efficiency ; rdb data tables through a variety of steps. All steps must ; occur through this procedure so that a clear record of construction ; exists and no manual entry is needed. ; ; Needed common @cmdb_common ; Hardwired things: ; . . . . . . . . . . . . . . . . . . . . . . ; ; The CMDB is set by hetgcal_idl_start.pro and cmdb/cmdb_start.pro ; For the 990617 analysis, etc. the CMDB used was: ;;cmdb_file = 'DRAFT_as_run.990531.cmdb' ; ( Should be same as DRAFT_as_run_N19990625.cmdb for these meas'ts.) ;;cmdb_load ; ; Set where to get and put eae analysis products ; Use the CALDB area: keep_em_dir = !DDHETGCAL+'/cmp/eae/' if KEYWORD_SET(PRELIMS) then begin ;------------------- ; . . . . . . . . . . . . . . . . . . . . . . ; First read in the whole starting cmdb ; This should have been done by hetgcal_idl_start ; Do not need to execute: cmdb_load ; get access to the CMDB column definition integers if cmdb_using_cal then begin @cmdb_cal_integers end else begin @cmdb_trw_integers end ; . . . . . . . . . . . . . . . . . . . . . . ; Now create initial rdb file based on this cmdb: ; (also creates a cmdb file of just the selected measurements) eae_fill_from_cmdb, keep_em_dir+'eae_from_cmdb' ; . . . . . . . . . . . . . . . . . . . . . . ; Now go through this rdb file and add in the values of ; the MST date and run id eae_fill_runids, keep_em_dir+'eae_from_cmdb.rdb', $ keep_em_dir+'eae_wids.rdb' ; . . . . . . . . . . . . . . . . . . . . . . ; Make a listing of the eae file eae_rdb = rdb_read(keep_em_dir+'eae_wids.rdb') eae_list, eae_rdb, keep_em_dir+'eae_wids.summary' ; and also the eae-only cmdb file cmdb_file_path = keep_em_dir cmdb_file = 'eae_from_cmdb.cmdb' cmdb_load glist SPAWN, 'cp eae_from_cmdb.summary '+keep_em_dir ;---------------------------- END ; of PRELIMS selection ;------------------------------------------------------ ;--- skip the counts extraction/analysis - generally ; done manually in sections at a time (as shown here) if 0 EQ 1 then begin ; . . . . . . . . . . . . . . . . . . . . . . ; Now do ROI analysis on the HXDS data ; This can take time so do them in pieces... eae = rdb_read(keep_em_dir+'eae_wids.rdb') eae_pha_anal, eae(11:14), /VERBOSE, /NOPLOTS, $ OUT_FILE= keep_em_dir+'eae_wcounts_11-14.rdb' eae_pha_anal, eae(22:40), /VERBOSE, /NOPLOTS, $ OUT_FILE= keep_em_dir+'eae_wcounts_22-40.rdb' ; etc. end ;--- end of skipping ; . . . . . . . . . . . . . . . . . . . . . . ; Combine them all into one eae_wcounts.rdb file ; (OK, a manual step...) ; Now we have counts,errors,time and iteration ; values... These could also have been filled in ; from someone's XSPEC analysis results. ;------------------------------------------------------ if KEYWORD_SET(POSTPROC) then begin ;------------------- ; This processing is reletively speedy and can be ; carried out if QEs of detectors change, etc. ; . . . . . . . . . . . . . . . . . . . . . . ; Need to calculate the flux and effective ; area... eae_rdb = rdb_read(keep_em_dir+'eae_wcounts.rdb') eae_fill_order, eae_rdb eae_flux_anal, eae_rdb rdb_write, keep_em_dir+'eae_wflux.rdb', eae_rdb ; Calculate Efficiencies ; load in the reference values: eae_fill_refs, eae_rdb ; get the reference values eae_update_ref_vals, eae_rdb ; OLD non-fraction corrected efficiencies eae_effic_anal, eae_rdb ;write it out rdb_write, keep_em_dir+'eae_weffics.rdb', eae_rdb eae_list, eae_rdb, keep_em_dir+'eae_weffics.summary' ; - - - - - - - - - - - - - ; Create the feature_fractions.rdb file ; noted here for reference - generally not rerun ; Several steps: ; - Make sure that xss_sim creates realistic source spectra ; based on the HSI source images. This is done by running ; hsi_do_source_spectra, /ANAL, /WEB ; which calls hsi_source_spectra.pro. CMDB must be accurate ; for source parameters, HSI, HRMA, grating cal values are ; used as well as HSI QE depression. ; - Make sure that xrcf_sim.pro is all set for the version of ; MARX that it is using, now version 2.21 is used. ; Also update FPC, SSD QEs, etc. ; The simulations will go in !DDPHASE1SIM and marx.par in that ; directory has to be correct, see eae_marx.990518.par here. ; - Simulate the eae measurments w/MARX, by running: ; eae = rdb_read(keep_em_dir+'eae_weffics.rdb') ; eae_sim, eae, /SIM ; last time it took a week to run!!! ; "6/17/99" run: start 2pm 6/17, ..., finish 6/20 5:30 am ; (three cheers for Ultra 10 because there were more sims too) ; - Create and save the feature_fractions.rdb file (finally!): ; eae_sim, eae, /ANAL ; takes 1/2 hour or so, can be combined w/SIM ; SPAWN, 'cp feature_fractions.rdb '+ keep_em_dir+'feature_fractions.rdb' ; - Check the errors assigned by feat_frac_err by doing: ; ffs = rdb_read(keep_em_dir+'feature_fractions.rdb') ; eae = rdb_read(keep_em_dir+'eae_weffics.rdb') ; dummy=feat_frac_err(ffs, eae, /PLOT, STAT_REL=stat_rel) ; The output of this includes a list of tests for which the ; simulation statistical error should be reduced - for these ; eae_sim is re-run with a highe requested counts... ; - - - - - - - - - - - - - ; read in the feature_fractions.rdb ... ffs = rdb_read(keep_em_dir+'feature_fractions.rdb') ; Now perform fraction correction efficiency analysis ; It will call marx/feat_frac_err.pro to get fraction errors eae_effic_anal, eae_rdb, /FRAC, ffs ;write it out rdb_write, keep_em_dir+'eae_wfracs.rdb', eae_rdb ; and make summary listing with links to .gifs: eae_list, eae_rdb, keep_em_dir+'eae_wfracs.summary' ; retrieve what links have been simulated... eae_sim, eae_rdb, SEL=eaesimmed eae_list, eae_rdb, keep_em_dir+'eae_wfracs.html', FRAC=eaesimmed ; . . . . . . . . . . . . . . . . . . . . . . ; Now we have something to plot ; using: eae_plots ; eae_to_web, below, creates many useful plots ; Plots codes: for eae_plots ; 0 - BND comparisons ; 1 - HRMA effective area ; 2,3,4,5 HEG/MEG Effective Areas ; 6,7 LEG Effective Areas ; 12,13,14,15 HEG/MEG Efficiencies ; 16,17 LEG Efficiencies ; . . . . . . . . . . . . . . . . . . . . . . ; or to compare with other Phase 1 Efficiency analyses: ; Compare measurement results, outputs detailed comparison ; test file, plots saved to web by eae_to_web, below. ;;eae_jdkp, /L_CORR ; [, /PLTRUNID] ; Make efficiency plots of the different results: ;;jdkp_first_orders, gselect=0 ; 1 or 2 ;------------- end ; of POSTPROC if KEYWORD_SET(WEBPROC) then begin ; . . . . . . . . . . . . . . . . . . . . . . ; Put it all "on the web"... eae_to_web end RETURN END