PRO sim_all_acis, SIM=sim, COMPARABLE=comparable, SMALL_IMAGE=small_image, $ TABLE=table, FORM_DATA_STATS=form_data_stats ; This procedure runs through the ACIS-Grating data sets and ; calls xrcf_sim to simulate them. ; Other functions (SMALL_IMAGE and TABLE) were added to support ; displaying the data in a nice web table and with a web page ; per measurement created. The table and individual web pages ; look to ~dd/xrcf/TRW_IDS/ to see if a trw_id.notes.html ; file is present. If so the first paragraph (up to
) ; is included in the table and the full contents are added ; to the individual web page. ; Gotta use the CMDB @cmdb_common ; define the cmdb column integers, e.g., c_detector if cmdb_using_cal then begin @cmdb_cal_integers end else begin @cmdb_trw_integers end ; Some hard coded locations etc. ; - - - - - - - - - - - - - - - - - - - - - web_dir = '/nfs/spectra/d6/ACIS_anal/' acis_dat_dir = '/nfs/spectra/d6/ACIS_anal/' marx_sim_dir = '/nfs/spectra/d6/MARX/' notes_dir = '/nfs/wiwaxia/h1/dd/xrcf/TRW_IDS/' ; Find and report all the Grating-ACIS measurements ; - - - - - - - - - - - - - - - - - - - - - ; Skip two of them (no PSU data) ; trw_id NE 'H-HAS-SC-7.006' AND trw_id NE 'H-HAS-PI-1.013' gacis = where(cmdb_fields(*,c_grating) NE 'NONE' AND $ (STRPOS(cmdb_fields(*,c_detector),'ACIS,I' ) GE 0 OR $ STRPOS(cmdb_fields(*,c_detector),'ACIS,S' ) GE 0) AND $ (cmdb_fields(*,c_id) NE 'H-HAS-SC-7.006' AND $ cmdb_fields(*,c_id) NE 'H-HAS-PI-1.013') ) ; Report by making a cmdb_summary listing... cmdb_mini_list, gacis, FILE_OUT = web_dir+'grating_acis_cmdb.html' ; Create the web table if desired ; - - - - - - - - - - - - - - - - - - - - - if KEYWORD_SET(TABLE) then begin OPENW, web_unit, web_dir+'acis_analysis_table.html', /GET printf, web_unit, 'Event Plot w/ energy color-coded ' + $ '(click image for more data-summary plots) | '
printf, web_unit, 'CMDB line [ N_OK_events]' printf, web_unit, ' | TRW ID ' + $ '(click for Data/MARX images and detailed Notes)' printf, web_unit, ' | Summary of Analysis |
---|---|---|---|
'+STRING(gacis(im)+1)+' ['+ $ STRING(LONG(data_stats(ids).n02346events),FORMAT='(I9)')+']' printf, web_unit, ' | '
printf, web_unit, 'click here! ' printf, web_unit, '| ' printf, web_unit,'\|/ ' printf, web_unit,' ' printf, web_unit, '' printf, web_unit, trw_id+'' printf, web_unit, ' | '
; Look for trw_id.notes.html in notes_dir
notes_file = FINDFILE(notes_dir+trw_id+'.notes.html',COUNT=notesfound)
if notesfound EQ 1 then begin
notes_file = notes_file(0)
print, ' Found notes file...['+notes_file+']'
OPENR, note_unit, notes_file, /GET
done = 0
while NOT(EOF(note_unit)) AND NOT(DONE) do begin
line_in = ''
readf, note_unit, line_in
printf, web_unit, line_in
; only include up to and including the first line.
if STRPOS(line_in, '') GE 0 then done = 1
end
CLOSE, note_unit
FREE_LUN, note_unit
end else begin
print, ' (no notes)'
printf, web_unit, 'No specific notes for '+trw_id+', yet.'
end
; if its an ENERGY scan include the list of energies
its_rdb = rdb_read(marx_sim_dir+trw_id+'/'+trw_id+'_iters.rdb')
n_iters = n_elements(its_rdb)
if its_rdb(0).type EQ 'ENERGY' then begin
printf, web_unit, ' ' efmt = '(F8.3)' es_string = STRING(its_rdb(0).param, efmt) for iit=1,n_iters-1 do es_string = es_string + ', ' + $ STRING(its_rdb(iit).param, efmt) es_string = STRCOMPRESS(es_string) printf, web_unit, 'Energy scan: '+es_string printf, web_unit, ' ' end printf, web_unit, ' |
'+prev_id_str printf, meas_unit, ' | ' printf, meas_unit, 'back to Analysis Table' printf, meas_unit, ' | '+next_id_str printf, meas_unit, ' |
'
printf, meas_unit, 'XRCF Data (upper: all iterations) '+ $
'and MARX Simulation (lower: first iteration only)'
printf, meas_unit, '
' efmt = '(F8.3)' es_string = STRING(its_rdb(0).param, efmt) for iit=1,n_iters-1 do es_string = es_string + ', ' + $ STRING(its_rdb(iit).param, efmt) es_string = STRCOMPRESS(es_string) printf, meas_unit, 'Energy scan: '+es_string printf, meas_unit, '
' end printf, meas_unit, '' printf, meas_unit, ''+trw_id+' Notes' printf, meas_unit, '' ; Now add all the notes if notesfound EQ 1 then begin OPENR, note_unit, notes_file, /GET while NOT(EOF(note_unit)) do begin line_in = '' readf, note_unit, line_in printf, meas_unit, line_in end CLOSE, note_unit FREE_LUN, note_unit end else begin printf, meas_unit, 'No analysis results for '+trw_id+', yet.
' end CLOSE, meas_unit FREE_LUN, meas_unit ; prev_id = trw_id end end if KEYWORD_SET(TABLE) then begin printf, web_unit, '